Skip to content
Open access

Evaluating package-level scoping strategies for repository-level code completion in Pharo

Jul 2026 · Journal of Computer Languages · Vol 88, pp. 101412 · 0 citations · 47 references
Computer Science

TL;DR

It is shown that package-aware strategies provide more accurate and relevant suggestions than the default Semantics-Based strategy on the evaluated projects, and the Direct Package Dependencies heuristic produced the strongest results.

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.

Read PDF

Similar papers

#artificial intelligence Preprint Sep 2026

FeatLens: Feature-Guided Dynamic Code Graph Construction and Retrieval for Repository-Level Code Generation

FeatLens builds a feature index that links natural-language feature descriptions to function-level code entities and dynamically constructs a task-specific seed graph from the feature index and applies semantic-structural graph reasoning with personalized PageRank to select a compact reasoning graph.

Xu-Tian Li, Bo Xiong, Yi-Feng Zhu et al. · 0 citations
Preprint Sep 2026

Beyond Repository Boundaries: Cross-Repository Graph Retrieval for Code Generation

CrossCoder is proposed, a cross-repository code generation framework that explicitly incorporates external libraries into the retrieval context through a unified knowledge graph over repository and library entities that consistently improves both functional correctness and robustness to dependency-version changes.

Minh Le-Anh, Nam Le Hai, Quyen Tran et al. · 0 citations
Conference Sep 2026

A Model of Software Code Quality Analysis, Assessment, and Improvement System

Existing code analysis systems address individual aspects of software quality (complexity, duplication, style) but do not combine multi-level analysis, metric aggregation, and learning-based inference within a single formal framework, nor do they close the loop between refactoring outcomes and assessment. This paper pr...

Ihor Prokofiev, Oleg Savenko · 0 citations
Open access Oct 2026

LLM See, LLM Do: Enhancing Repository-Aware Code Generation in LLMs Through Logical Context and Usage Knowledge

Large language models (LLMs) have significantly advanced automatic code generation. Although they have demonstrated remarkable ability in writing standalone code, they still struggle with real-world repository-level coding tasks due to the lack of repository-specific knowledge. Existing studies typically employ retriev...

Tanghaoran Zhang, Xin-Jun Mao, Yu-Xin Zhao et al. · 0 citations
Open access Aug 2026

StructFix: a structure-aware reasoning framework for automated program repair with code property graphs

StructFix is proposed, a structure-aware APR framework that grounds masked patch generation in Code Property Graphs (CPGs), and explicitly coupling structural dependencies with masked generation improves repair effectiveness and enables transfer across datasets.

Mengtian Cui, Yang-Fan Liu, Zhibo Lu et al. · 0 citations
Open access Oct 2026

ProgSCA: Software Composition Analysis via Program-Level Modeling

Software composition analysis (SCA) aims to identify third-party dependencies in programs, which plays a critical role in ensuring software supply chain security. Existing approaches largely follow a rule-based paradigm: they first compute function-level similarities, then aggregate these results using handcrafted heur...

Pei-Hong Li, Cheng Li, Yu-Chen Gu et al. · 0 citations

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.