Enhancing Code Completion with Position Embedding of Abstract Syntax Tree
Code completion is a crucial feature in integrated development environments (IDEs) that enhances both the efficiency and experience of developers. By analyzing the context of preceding code, real-time suggestions can be provided, significantly aiding developers in their work. Recent research has highlighted that the abstract syntax tree (AST) contains rich syntactic and structural information, which can assist deep learning models in better understanding code. As a result, AST-based code completion methods have garnered substantial attention. However, existing approaches often overlook the positional information of nodes within the AST, limiting the model's ability to capture structural relationships in the code. This paper explores the positional relationships between AST nodes and proposes a tree structure position embedding method tailored to the AST. Experimental results validate that this position embedding significantly improves the performance of code completion.
Authors
- Junyu Lu (ORCID: https://orcid.org/0009-0008-0574-9519)
- Jiahao Li (ORCID: https://orcid.org/0009-0006-7253-322X)
- Linbo Zhu
Institutions
- University of Science and Technology of China (CN)
- Anhui University (CN)
Publication Details
- Published
- 2024-12-13
- DOI
- https://doi.org/10.1109/icftic64248.2024.10913308
- Primary Topic
- Natural Language Processing Techniques
- Type
- article
- Field-Weighted Citation Impact
- 0.00