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

Institutions

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
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Enhancing Code Completion with Position Embedding of Abstract Syntax Tree

Junyu Lu, Jiahao Li, Linbo Zhu
Natural Language Processing Techniques
article

Enhancing Code Completion with Position Embedding of Abstract Syntax Tree

Junyu Lu, Jiahao Li, Linbo Zhu
article en

Abstract

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.

University of Science and Technology of China (CN), Anhui University (CN)
Openalex Percentile: Top 74%
Natural Language Processing Techniques
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.