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.
翻译:Pharo提供了一个基于语义启发式的复杂补全引擎,该引擎在惰性架构中协调特定的提取器。这些启发式方法可被重组以支持多种活动(例如实时编程或历史使用导航)。尽管该系统功能强大,但在建议全局名称(如类名、类变量或全局变量)时并未考虑仓库结构。因此,它不会优先处理同一包或项目中的类,而是将所有全局名称等同对待。本文提出了一种新的启发式方法以解决此限制。我们的方法以结构化方式搜索变量名:首先从请求类所在的包开始,然后扩展到同一仓库内的其他包,最后考虑全局命名空间。我们阐述了该启发式方法背后的逻辑,并将其与默认语义启发式方法以及直接查询全局命名空间的方法进行了对比评估。初步结果表明,平均倒数排名(MRR)有所提升,这证实了包感知补全相较于先前扁平的全局方法能提供更准确且相关的建议。