mirror of
https://github.com/neovim/neovim
synced 2025-07-27 00:41:52 +00:00
fix(lsp): use unresolved code action when codeAction/resolve
fails
This commit is contained in:
committed by
Mathias Fußenegger
parent
e46f07b1d2
commit
5d08b65ac2
@ -1155,7 +1155,8 @@ local function on_code_action_results(results, opts)
|
|||||||
if not action.edit or not action.command and client:supports_method(ms.codeAction_resolve) then
|
if not action.edit or not action.command and client:supports_method(ms.codeAction_resolve) then
|
||||||
client:request(ms.codeAction_resolve, action, function(err, resolved_action)
|
client:request(ms.codeAction_resolve, action, function(err, resolved_action)
|
||||||
if err then
|
if err then
|
||||||
if action.command then
|
-- If resolve fails, try to apply the edit/command from the original code action.
|
||||||
|
if action.edit or action.command then
|
||||||
apply_action(action, client, choice.ctx)
|
apply_action(action, client, choice.ctx)
|
||||||
else
|
else
|
||||||
vim.notify(err.code .. ': ' .. err.message, vim.log.levels.ERROR)
|
vim.notify(err.code .. ': ' .. err.message, vim.log.levels.ERROR)
|
||||||
|
Reference in New Issue
Block a user