KIT | KIT-Bibliothek | Impressum | Datenschutz

Principled Syntactic Code Completion using Placeholders

Souza Amorim, Luís Eduardo de; Erdweg, Sebastian ORCID iD icon 1; Wachsmuth, Guido; Visser, Eelco
1 Institut für Programmstrukturen und Datenorganisation (IPD), Karlsruher Institut für Technologie (KIT)

Abstract (englisch):

Principled syntactic code completion enables developers to change source code by inserting code templates, thus increasing developer efficiency and supporting language exploration. However, existing code completion systems are ad-hoc and neither complete nor sound. They are not complete and only provide few code templates for selected programming languages. They also are not sound and propose code templates that yield invalid programs when inserted. This paper presents a generic framework that automatically derives complete and sound syntactic code completion from the syntax definition of arbitrary languages. A key insight of our work is to provide an explicit syntactic representation for incomplete programs using placeholders. This enables us to address the following challenges for code completion separately: (i) completing incomplete programs by replacing placeholders with code templates, (ii) injecting placeholders into complete programs to make them incomplete, and (iii) introducing lexemes and placeholders into incorrect programs through error-recovery parsing to make them correct so we can apply one of the previous strategies. We formalize our framework and provide an implementation in Spoofax.


Verlagsausgabe §
DOI: 10.5445/IR/1000188572
Veröffentlicht am 16.01.2026
Originalveröffentlichung
DOI: 10.1145/2997364.2997374
Dimensions
Zitationen: 14
Cover der Publikation
Zugehörige Institution(en) am KIT Institut für Programmstrukturen und Datenorganisation (IPD)
Publikationstyp Proceedingsbeitrag
Publikationsdatum 20.10.2016
Sprache Englisch
Identifikator ISBN: 978-145034447-0
KITopen-ID: 1000188572
Erschienen in SLE 2016 - Proceedings of the 2016 ACM SIGPLAN International Conference on Software Language Engineering, co-located with SPLASH 2016; Amsterdam, Niederlande, 31.10.-01.11.2016
Veranstaltung 9th ACM SIGPLAN International Conference on Software Language Engineering (2016), Amsterdam, Niederlande, 31.10.2016 – 01.11.2016
Verlag Association for Computing Machinery (ACM)
Seiten S. 163-175
Schlagwörter Code completion; Ides; Language workbenches
Nachgewiesen in Scopus
Dimensions
OpenAlex
KIT – Die Universität in der Helmholtz-Gemeinschaft
KITopen Landing Page