PAPER / ARXIV:2609.20279
Abedelkader, O.; Ducasse, S.; Polito, G.
RESUMO
Source code is organized in repositories, packages, and projects, yet token-level completion engines rarely exploit this structure. Pharo provides a semantic completion engine based on ordered, lazy heuristics that retrieve and rank candidates. Its default strategy follows language semantics scoping rules, but ignores package structure and dependencies. Consequently, classes from the same package or project, and classes used by them, receive no special priority. We introduce and evaluate three package-aware heuristics: Lateral Packages, Direct Package Dependencies, and Two-Level Package Dependencies. Our benchmark covers method call sites from 219 packages including 4,535 classes and 35,972 methods across major Pharo projects such as Iceberg, Moose, Roassal, Seaside, Spec. We assess class-name and method-name completion asking whether explicit package dependencies can provide a lightweight structural signal for improving candidate ranking without introducing a new learning model. The Package Dependencies heuristic produced the strongest results. For 3-character prefixes, Mean Reciprocal Rank increased from 0.20 to 0.44 for class-name completion and from 0.10 to 0.41 for method-name completion. These findings show that package-aware strategies provide more accurate and relevant suggestions than the Semantics-Based default strategy evaluated on projects. Based on improvement in code completion, the Pharo Industrial Consortium adopted Direct Package Dependencies 13.
NO MESMO MAPA