You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
A code action that has a command is never resolved, so its lazily computed edit is not applied #2191
A server that computes a code action's edit lazily, to a client that announces codeAction.resolveSupport.properties: ["edit"], may still return the action with a command to run after the edit. LSP4IJ then never sends codeAction/resolve for it: it executes the command alone, and the edit is never applied.
The specification has both apply: "If a code action provides an edit and a command, first the edit is executed and then the command." And codeAction/resolve is how a client fills in a lazily computed edit, whatever else the action has.
Steps to reproduce
A language server answers textDocument/codeAction with an action that has data and a command, and no edit. LSP4IJ announces resolve support for edit.
Choose that action in the editor.
Expected: LSP4IJ sends codeAction/resolve, applies the resolved edit, then executes the command.
Actual: no codeAction/resolve is sent; only the command is executed, and nothing is edited.
Suggested fix
Resolve an action that has no edit when the client supports resolving edit, whether or not it has a command, then apply the resolved action as apply does: its edit first, then its command.
Context
Found with the Ecstasy language server, whose safe delete code action carries a command that the client runs after the edit. Until this is fixed, the server sends the edit eagerly with any action that has a command.
Seen with LSP4IJ 0.30.1, and the condition is unchanged on main at 084bf75.
Activity
File UP85 as redhat-developer/lsp4ij#2191, and name it in the registe…
fix: resolve a code action that has a command but no edit, so that it…
File UP85 as redhat-developer/lsp4ij#2191, and name it in the registe…
File UP85 as redhat-developer/lsp4ij#2191, and name it in the registe…
File UP85 as redhat-developer/lsp4ij#2191, and name it in the registe…
File UP85 as redhat-developer/lsp4ij#2191, and name it in the registe…
File UP85 as redhat-developer/lsp4ij#2191, and name it in the registe…
File UP85 as redhat-developer/lsp4ij#2191, and name it in the registe…
File UP85 as redhat-developer/lsp4ij#2191, and name it in the registe…