aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/lsp/buf.lua
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/lua/vim/lsp/buf.lua')
-rw-r--r--runtime/lua/vim/lsp/buf.lua9
1 files changed, 8 insertions, 1 deletions
diff --git a/runtime/lua/vim/lsp/buf.lua b/runtime/lua/vim/lsp/buf.lua
index b2f202c4ba..bb3ca0e6d6 100644
--- a/runtime/lua/vim/lsp/buf.lua
+++ b/runtime/lua/vim/lsp/buf.lua
@@ -681,9 +681,16 @@ local function on_code_action_results(results, ctx, options)
-- command: string
-- arguments?: any[]
--
+ ---@type lsp.Client
local client = vim.lsp.get_client_by_id(action_tuple[1])
local action = action_tuple[2]
- if not action.edit and client and client.supports_method('codeAction/resolve') then
+
+ local reg = client.dynamic_capabilities:get('textDocument/codeAction', { bufnr = ctx.bufnr })
+
+ local supports_resolve = vim.tbl_get(reg or {}, 'registerOptions', 'resolveProvider')
+ or client.supports_method('codeAction/resolve')
+
+ if not action.edit and client and supports_resolve then
client.request('codeAction/resolve', action, function(err, resolved_action)
if err then
vim.notify(err.code .. ': ' .. err.message, vim.log.levels.ERROR)