What version of Go, VS Code & VS Code Go extension are you using?
Version Information
- Run
go version to get version of Go from the VS Code integrated terminal.
- go version go1.26.5 linux/amd64
- Run
gopls -v version to get version of Gopls from the VS Code integrated terminal.
- golang.org/x/tools/gopls v0.23.0 ← the version where the bug occurs
(I have since downgraded to v0.22.0 as a workaround, where the commands work)
- Run
code -v or code-insiders -v to get version of VS Code or VS Code Insiders.
- 1.128.1 (VS Code Server, commit 5264f2156cbcd7aea5fd004d29eaa10209155d66)
- Check your installed extensions to get the version of the VS Code Go extension
- Run Ctrl+Shift+P (Cmd+Shift+P on Mac OS) >
Go: Locate Configured Go Tools command.
- (omitted; let me know if you need it and I'll paste the output)
Share the Go related settings you have added/edited
None — all default settings. No go. / gopls prefixed settings were customized.
Describe the bug
The command-palette commands "Go: Add Tags to Struct Fields" and "Go: Remove Tags From Struct Fields" fail with unsupported modify tags operation (the operation value is empty) when running gopls v0.23.0 with vscode-go 0.56.0.
Every invocation logs this in the "gopls (server)" output channel:
[Error - ...] Request command/resolve failed.
Message: unsupported modify tags operation:
Code: 0
No tags are added/removed. The same commands worked fine with gopls v0.22.0.
Root cause analysis
I traced this through the source of both projects:
-
gopls v0.23.0 changed the interactiveResolveProvider capability format (breaking change, gopls/internal/server/general.go):
- v0.22.0:
"interactiveResolveProvider": []string{"command"} (array)
- v0.23.0:
"interactiveResolveProvider": {kinds: ["command"]} (object)
-
vscode-go 0.56.0's InteractiveFormsFeature middleware (extension/src/language/form.ts) activates when Array.isArray(option.kinds) && option.kinds.includes('command'). With v0.23.0 this now matches, so every workspace/executeCommand is first routed through a command/resolve request.
-
The command-palette path still sends the legacy argument format (extension/src/goModifytags.ts): {URI, range, add, addOptions, transform, valueFormat} — i.e. no Modification field. (The code-action path from gopls sends Modification: "add"/"remove" and works fine.)
-
gopls's resolveModifyTags (gopls/internal/golang/resolve.go) switches on a0.Modification and only handles "add" / "remove", falling through to:
default:
return fmt.Errorf("unsupported modify tags operation: %s", a0.Modification)
Since the legacy args have no Modification, the error surfaces with an empty operation.
Steps to reproduce the behavior:
- Open any .go file and select/place cursor on a struct (e.g. type Foo struct { A string }).
- Run command palette (Ctrl+Shift+P) → "Go: Add Tags to Struct Fields" (or "Go: Remove Tags From Struct Fields").
- Observe the "gopls (server)" output channel:
Request command/resolve failed. Message: unsupported modify tags operation
- No changes are applied to the struct.
Expected behavior
Tags are added/removed as before (or the new interactive dialog is shown), without errors.
Workarounds
- Use the lightbulb code action "Add struct tags" instead of the command palette — this path sends the new Modification-style args and works correctly.
- Downgrade gopls to v0.22.0 (go install golang.org/x/tools/gopls@v0.22.0) — the commands work again.
Screenshots or recordings
N/A — the error is fully reproduced in the gopls output channel text above.
What version of Go, VS Code & VS Code Go extension are you using?
Version Information
go versionto get version of Go from the VS Code integrated terminal.gopls -v versionto get version of Gopls from the VS Code integrated terminal.(I have since downgraded to v0.22.0 as a workaround, where the commands work)
code -vorcode-insiders -vto get version of VS Code or VS Code Insiders.Go: Locate Configured Go Toolscommand.Share the Go related settings you have added/edited
None — all default settings. No
go./goplsprefixed settings were customized.Describe the bug
The command-palette commands "Go: Add Tags to Struct Fields" and "Go: Remove Tags From Struct Fields" fail with
unsupported modify tags operation(the operation value is empty) when running gopls v0.23.0 with vscode-go 0.56.0.Every invocation logs this in the "gopls (server)" output channel:
No tags are added/removed. The same commands worked fine with gopls v0.22.0.
Root cause analysis
I traced this through the source of both projects:
gopls v0.23.0 changed the
interactiveResolveProvidercapability format (breaking change,gopls/internal/server/general.go):"interactiveResolveProvider": []string{"command"}(array)"interactiveResolveProvider": {kinds: ["command"]}(object)vscode-go 0.56.0's
InteractiveFormsFeaturemiddleware (extension/src/language/form.ts) activates whenArray.isArray(option.kinds) && option.kinds.includes('command'). With v0.23.0 this now matches, so everyworkspace/executeCommandis first routed through acommand/resolverequest.The command-palette path still sends the legacy argument format (
extension/src/goModifytags.ts):{URI, range, add, addOptions, transform, valueFormat}— i.e. noModificationfield. (The code-action path from gopls sendsModification: "add"/"remove"and works fine.)gopls's
resolveModifyTags(gopls/internal/golang/resolve.go) switches ona0.Modificationand only handles"add"/"remove", falling through to:default: return fmt.Errorf("unsupported modify tags operation: %s", a0.Modification)Since the legacy args have no Modification, the error surfaces with an empty operation.
Steps to reproduce the behavior:
Request command/resolve failed. Message: unsupported modify tags operation
Expected behavior
Tags are added/removed as before (or the new interactive dialog is shown), without errors.
Workarounds
Screenshots or recordings
N/A — the error is fully reproduced in the gopls output channel text above.