mirror of
https://github.com/neovim/neovim.git
synced 2025-10-26 12:27:24 +00:00
refactor(lsp): fold in dynamic_registration code into the client
Problem: Capability register logic is spread across 3 files. Solution: - Consolidate (and simplify) logic into the client. - Teach client.supports_method about resolve methods
This commit is contained in:
committed by
Lewis Russell
parent
e2ad251c8d
commit
989a37a594
@@ -1131,12 +1131,7 @@ local function on_code_action_results(results, opts)
|
||||
local action = choice.action
|
||||
local bufnr = assert(choice.ctx.bufnr, 'Must have buffer number')
|
||||
|
||||
local reg = client.dynamic_capabilities:get(ms.textDocument_codeAction, { bufnr = bufnr })
|
||||
|
||||
local supports_resolve = vim.tbl_get(reg or {}, 'registerOptions', 'resolveProvider')
|
||||
or client.supports_method(ms.codeAction_resolve)
|
||||
|
||||
if not action.edit and client and supports_resolve then
|
||||
if not action.edit and client.supports_method(ms.codeAction_resolve) then
|
||||
client.request(ms.codeAction_resolve, action, function(err, resolved_action)
|
||||
if err then
|
||||
if action.command then
|
||||
|
||||
Reference in New Issue
Block a user