← All stories
● Covered by 1 source · 1 reportMedium impact1 neutral

gopls Introduces Interactive Refactoring with New LSP Capability

🔄 Updated 21d ago
New to BrevFeed? We gather this story from every outlet covering it into one summary — ranked by real-world impact, not just the latest headline — so you never miss what matters. What is BrevFeed? →

Key points

  • gopls v0.24.0 adds interactive refactoring.
  • New LSP capability enables multi-step dialogs for user input.
  • Developed with Dart team as an open standard.
  • Addresses limitations of parameterless code transformations.

Interactive Refactoring in gopls

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.

New Language Server Protocol (LSP) Capability

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.

Addressing Limitations in Code Transformation

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.

Enabling User Input for Refactoring

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 →

The daily brief

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.

Today's brief

Spend a few minutes, get the whole day. Every topic's top stories in one hands-free rundown — listen, watch, or read the transcript.

~4 min · 3 stories · Nov 07

▶ Play today's brief Listen on Spotify

New every morning, and the back catalogue is archived by date.

Reporting from

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.