codeAction/resolve was introduced to LSP in 3.16. This allows code action requests to omit Edits
for a code action and compute them when necessary.
Currently, gopls implements this lazy computation by passing a command to the codeAction. However, if the client supports it we can use codeAction/resolve
instead. This will enable code action previews in VS Code.
Client support is registered through textDocument.codeAction.resolveSupport:
textDocument.codeAction.resolveSupport = { properties: ['edit'] };
gopls already has ResolveCodeAction
Comment From: gopherbot
Change https://go.dev/cl/548276 mentions this issue: internal/lsp: convert refactor code actions to use codeAction/resolve
Comment From: gopherbot
Change https://go.dev/cl/562118 mentions this issue: gopls/internal/golang: add resolve support for inline refactorings