Print Email Facebook Twitter Principled Syntactic Code Completion using Placeholders Title Principled Syntactic Code Completion using Placeholders Author de Souza Amorim, L.E. (TU Delft Programming Languages) Erdweg, S.T. (TU Delft Programming Languages) Wachsmuth, G.H. (TU Delft Programming Languages) Visser, Eelco (TU Delft Programming Languages) Contributor Varro, D. (editor) Balland, E. (editor) van der Storm, T. (editor) Date 2016-10-20 Abstract 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. Subject Code completionIdesLanguage workbenches To reference this document use: http://resolver.tudelft.nl/uuid:fb5ffb44-712d-430b-b0cf-f9c47d7479c7 DOI https://doi.org/10.1145/2997364.2997374 Publisher Association for Computing Machinery (ACM), New York, NY ISBN 978-1-4503-4447-0 Source Proceedings of the 2016 ACM SIGPLAN International Conference on Software Language Engineering, co-located with SPLASH 2016 Event SLE 2016, 2016-10-31 → 2016-11-01, Amsterdam, Netherlands Part of collection Institutional Repository Document type conference paper Rights © 2016 L.E. de Souza Amorim, S.T. Erdweg, G.H. Wachsmuth, Eelco Visser Files PDF p163_amorim.pdf 958.31 KB Close viewer /islandora/object/uuid:fb5ffb44-712d-430b-b0cf-f9c47d7479c7/datastream/OBJ/view