🤖 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.
📝 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.