Code-completion suggestions can improve by using the structure already present in a project. A Pharo study tested ways to prioritize suggestions using code packages and their dependencies. Its existing completion engine followed language and scope rules but gave no special priority to this package information. Study abstract.
Across a benchmarkA standard public test set for comparing AI models — the shared scoreboards behind every "model X beats model Y" claim.Full definition → covering 219 packages, the strongest strategy used direct package dependencies: the packages that the current package directly relies on. It improved the ranking of both class-name and method-name suggestions for three-character prefixes. The result identifies a useful structural signal for completion without requiring a new machine-learning model. Reported comparison.
Key takeaways · AI-distilled
Testing on 219 packages (4,535 classes, 35,972 methods) across major Pharo projects, a package-aware 'Direct Package Dependencies' completion heuristic beat Pharo's default semantics-only ranking.
For 3-character prefixes, Mean Reciprocal Rank rose from 0.20 to 0.44 for class-name completion and from 0.10 to 0.41 for method-name completion.
The gain came from a lightweight structural signal (package dependency distance), not a new learning model -- no retraining needed.
Based on these results, the Pharo Industrial Consortium adopted the Direct Package Dependencies heuristic for the upcoming Pharo 13 release.
Terms in this piece · Glossary
benchmark — A standard public test set for comparing AI models — the shared scoreboards behind every "model X beats model Y" claim.