gopls, the Go language server, has introduced interactive refactoring in version 0.24.0. This feature allows developers to automate common code transformations with dynamic, multi-step dialogs directly within their editors. The official Go extension for VS Code v0.56.0 already supports this functionality.
The interactive refactoring is built upon a new capability proposed for the Language Server Protocol (LSP). This capability was designed as an open standard for all programming languages and editor ecosystems, not just Go, and was developed in collaboration with the Dart team. The LSP is an open standard that facilitates communication between text editors and language servers, providing features like autocomplete and diagnostics.
Previously, most LSP code transformations operated without parameters, requiring the server to deduce user intent solely from context. When context was insufficient, servers either applied a default transformation or did not offer the refactoring. This limitation meant that gopls, for example, could only guess at user preferences for actions like "Add struct tags," often defaulting to JSON tags in camelCase.
The new LSP mechanism allows language servers to ask users for input, enabling more complex and precise refactoring operations. This means gopls can now provide new operations with one or more parameters, such as specifying which struct tags to add, the naming convention, or where to move a declaration. This change allows for more tailored and accurate code transformations.
✨ This summary was generated by AI from the outlets' reporting listed below. It is not independently verified and may contain errors — check the original sources. How BrevFeed works →
One email each morning: the day's tech stories, clustered across outlets and summarized. No account needed.
One email a day. Unsubscribe in one click, any time.
Spend a few minutes, get the whole day. Every topic's top stories in one hands-free rundown — listen, watch, or read the transcript.
▶ Play today's briefNew every morning, and the back catalogue is archived by date.
gopls v0.24.0 now supports interactive refactoring, powered by a new Language Server Protocol (LSP) capability developed in collaboration with the Dart team. This new LSP feature allows language servers to request user input for multi-step code transformations, addressing a limitation where servers previously had to guess user intent or not offer certain refactorings.