Package-Aware Approach for Repository-Level Code Completion in Pharo

📅 2026-01-09
🏛️ arXiv.org
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
This work addresses the limitation of existing Pharo code completion engines, which disregard package structure when recommending global names, leading to reduced relevance. To overcome this, we propose a package-aware heuristic that, for the first time, integrates repository and package hierarchy information into the semantic completion mechanism. Our approach retrieves candidate names in a prioritized, layered manner—first from the package containing the requesting class, then from other packages within the same repository, and finally from the global namespace. Built upon Pharo’s lazy-loading architecture, the method incorporates a context-sensitive, hierarchical recommendation strategy. Preliminary evaluation demonstrates that our technique outperforms both the default semantic heuristic and direct global queries in terms of Mean Reciprocal Rank (MRR), significantly improving the accuracy and relevance of code completions.

Technology Category

Application Category

📝 Abstract
Pharo offers a sophisticated completion engine based on semantic heuristics, which coordinates specific fetchers within a lazy architecture. These heuristics can be recomposed to support various activities (e.g., live programming or history usage navigation). While this system is powerful, it does not account for the repository structure when suggesting global names such as class names, class variables, or global variables. As a result, it does not prioritize classes within the same package or project, treating all global names equally. In this paper, we present a new heuristic that addresses this limitation. Our approach searches variable names in a structured manner: it begins with the package of the requesting class, then expands to other packages within the same repository, and finally considers the global namespace. We describe the logic behind this heuristic and evaluate it against the default semantic heuristic and one that directly queries the global namespace. Preliminary results indicate that the Mean Reciprocal Rank (MRR) improves, confirming that package-awareness completions deliver more accurate and relevant suggestions than the previous flat global approach.
Problem

Research questions and friction points this paper is trying to address.

code completion
package-awareness
repository structure
global names
Pharo
Innovation

Methods, ideas, or system contributions that make the work stand out.

package-aware completion
repository-level code completion
semantic heuristics
Mean Reciprocal Rank
Pharo
🔎 Similar Papers
No similar papers found.
O
Omar AbedelKader
Univ. Lille, Inria, CNRS, Centrale Lille, UMR 9189 CRIStAL, Park Plaza, Parc scientifique de la Haute-Borne, 40 Av. Halley Bât A, 59650 Villeneuve-d’Ascq, France
Stéphane Ducasse
Stéphane Ducasse
INRIA Research Director
software maintenanceprogram analysisdynamic languagereflective programming
O
Oleksandr Zaitsev
CIRAD, UMR SENS, F-34000 Montpellier, France
Romain Robbes
Romain Robbes
CNRS Senior Scientist, LaBRI, Université de Bordeaux
Empirical Software EngineeringMining Software RepositoriesMachine Learning for Software Engineering
G
G. Polito
Univ. Lille, Inria, CNRS, Centrale Lille, UMR 9189 CRIStAL, Park Plaza, Parc scientifique de la Haute-Borne, 40 Av. Halley Bât A, 59650 Villeneuve-d’Ascq, France