🤖 AI Summary
This work addresses the challenge that existing programming environments, relying solely on plain-text editing, struggle to reliably track and maintain program structure during tool integration. To bridge this gap, the paper proposes a hybrid structured editing approach that preserves the familiar text-based interface for users while providing structural guarantees for tools. By integrating declarative structural constraints, a mechanism for tracking structural changes, and a synchronization strategy between textual and structural representations, the method ensures consistency and safety of program structure throughout the editing process. This approach is the first to simultaneously accommodate user editing habits and the structural reliability required by development tools. A prototype implementation and multiple case studies demonstrate its effectiveness in enhancing both the safety of tool integration and the consistency of the user experience.
📝 Abstract
In programming, better tools often yield better results. For that, modern programming environments offer mechanisms to allow for their extensibility. The closer those tools are to the code, the easier it is for programmers to map the information provided by a tool to the code this information is about. However, existing extension mechanisms do not facilitate the close integration of tools with textual source code. Tools must be able to track program structures across edits to appear at the right positions but the parsing step of text complicates tracking structures. We propose hybrid structured editing, an approach that supports tool builders by providing structural guarantees while providing tool users with a familiar and consistent text editing interface. Hybrid structured editing allows tool builders to declare constraints on the structure that a program must conform to and ensures their observance. We present an implementation and several case studies of tools based on hybrid structured editing to demonstrate its effectiveness. Hybrid structured editing supports the safe extension of programming environments with tools that work on a structured representation of code and provide a consistent and reliable user experience.