Code completion is an editor service in IDEs that proposes code fragments for the user to insert at the caret position in their code. Code completion should be sound and complete. It should be sound, such that it only proposes fragments that do not violate the syntactic and static semantic rules of the language. It should be complete, such that it proposes all valid fragments so that code completion can be used to construct all programs. To realize soundness and completeness, code completion should be informed by the language definition. In practice, the implementation of code completion is an additional effort in the implementation of a language.
In this paper, we develop a framework for language-parametric semantic code completion for statically typed programming languages based on their specification of syntax and static semantics, realizing the implementation of a code completion editor service with minimal additional effort. The framework builds on the SDF3 syntax definition formalism and the Statix static semantics specification language. The algorithm reinterprets the static semantics definition to find sound expansions of predicates and solutions to name resolution queries in scope graphs. This allows a search strategy to explore the solution space and synthesize completion proposals. The implementation of the strategy language and code completion algorithm extend the implementation of the Statix solver, and can be used for any language defined in Statix. We demonstrate soundness and completeness of the completion proposal synthesis, and evaluate its performance.
Sat 10 DecDisplayed time zone: Auckland, Wellington change
10:30 - 12:00
|Can Guided Decomposition Help End-Users Write Larger Block-Based Programs? A Mobile Robot Experiment
Nico Ritschel University of British Columbia, Felipe Fronchetti Virginia Commonwealth University, Reid Holmes University of British Columbia, Ronald Garcia University of British Columbia, David C. Shepherd Virginia Commonwealth UniversityDOI
|Compositional Embeddings of Domain-Specific Languages
Yaozhu Sun University of Hong Kong, Utkarsh Dhandhania University of Hong Kong, Bruno C. d. S. Oliveira University of Hong KongDOI Pre-print
|Language-parametric static semantic code completion
Daniel A. A. Pelsmaeker Delft University of Technology, Netherlands, Hendrik van Antwerpen Delft University of Technology, Casper Bach Poulsen Delft University of Technology, Eelco Visser Delft University of TechnologyDOI