Gespeichert in:
Bibliographische Detailangaben
Hauptverfasser: Deng, Le, Ren, Xiaoxue, Ni, Chao, Liang, Ming, Lo, David, Liu, Zhongxin
Format: Preprint
Veröffentlicht: 2025
Schlagworte:
Online-Zugang:https://arxiv.org/abs/2507.20888
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
_version_ 1866909709251903488
author Deng, Le
Ren, Xiaoxue
Ni, Chao
Liang, Ming
Lo, David
Liu, Zhongxin
author_facet Deng, Le
Ren, Xiaoxue
Ni, Chao
Liang, Ming
Lo, David
Liu, Zhongxin
contents Project-specific code completion is a critical task that leverages context from a project to generate accurate code. State-of-the-art methods use retrieval-augmented generation (RAG) with large language models (LLMs) and project information for code completion. However, they often struggle to incorporate internal API information, which is crucial for accuracy, especially when APIs are not explicitly imported in the file. To address this, we propose a method to infer internal API information without relying on imports. Our method extends the representation of APIs by constructing usage examples and semantic descriptions, building a knowledge base for LLMs to generate relevant completions. We also introduce ProjBench, a benchmark that avoids leaked imports and consists of large-scale real-world projects. Experiments on ProjBench and CrossCodeEval show that our approach significantly outperforms existing methods, improving code exact match by 22.72% and identifier exact match by 18.31%. Additionally, integrating our method with existing baselines boosts code match by 47.80% and identifier match by 35.55%.
format Preprint
id arxiv_https___arxiv_org_abs_2507_20888
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Enhancing Project-Specific Code Completion by Inferring Internal API Information
Deng, Le
Ren, Xiaoxue
Ni, Chao
Liang, Ming
Lo, David
Liu, Zhongxin
Software Engineering
Computation and Language
Project-specific code completion is a critical task that leverages context from a project to generate accurate code. State-of-the-art methods use retrieval-augmented generation (RAG) with large language models (LLMs) and project information for code completion. However, they often struggle to incorporate internal API information, which is crucial for accuracy, especially when APIs are not explicitly imported in the file. To address this, we propose a method to infer internal API information without relying on imports. Our method extends the representation of APIs by constructing usage examples and semantic descriptions, building a knowledge base for LLMs to generate relevant completions. We also introduce ProjBench, a benchmark that avoids leaked imports and consists of large-scale real-world projects. Experiments on ProjBench and CrossCodeEval show that our approach significantly outperforms existing methods, improving code exact match by 22.72% and identifier exact match by 18.31%. Additionally, integrating our method with existing baselines boosts code match by 47.80% and identifier match by 35.55%.
title Enhancing Project-Specific Code Completion by Inferring Internal API Information
topic Software Engineering
Computation and Language
url https://arxiv.org/abs/2507.20888