Evaluating Package-Level Scoping Strategies for Repository-Level Code Completion in Pharo
Omar Abedelkader, Stéphane Ducasse, Guillermo Polito, Oleksandr Zaitsev, Romain Robbes
Abstract
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 and 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, and Spec. We assess class-name and method-name completion and ask whether explicit package dependencies can provide a lightweight structural signal for improving candidate ranking without introducing a new learning model. The Direct 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 default Semantics-Based strategy on the evaluated projects. Based on the improvement in class-name completion, the Pharo Industrial Consortium adopted the Direct Package Dependencies heuristic for Pharo 13.
Create a lesson
Related papers
Better Call Grep: Evaluating and Improving Grep-Like Lexical Retrieval for Repository-Level Code Completion
Shared title terminology · Baoyi Wang, Xingliang Wang, Guochang Li et al.
RepoReasoner: Evaluating Repository-Level Code Reasoning Ability of Long-Context Language Models
Shared title terminology · Yanlin Wang, Suiquan Wang, Yanli Wang et al.
Deep Agentic Search for Repository-Level Code Question Answering: An Empirical Study
Shared title terminology · Amirkia Rafiei Oskooei, Bora Ilci, Alperen Kayim et al.
MRCoder: An Efficient Context Selecting Approach for Repository-Level Code Generation
Shared title terminology · Peiding Wang, Li Zhang, Fang Liu
Repository-Grounded Rubrics for Execution-Free Evaluation of Coding Agents
Shared title terminology · Matej Gerek, Danylo Zahorulko, Samuel Budai et al.
Alternative UX Extensions and Their Trade-offs for Code Completion in Pharo
Shared title terminology · Mehdi Elkolei, Omar Abedelkader, Stéphane Ducasse