diff options
author | Lewis Russell <lewis6991@gmail.com> | 2024-11-05 17:34:21 +0000 |
---|---|---|
committer | Lewis Russell <me@lewisr.dev> | 2024-11-18 17:09:53 +0000 |
commit | 989a37a594649528f28432388c0e7e28e8be2753 (patch) | |
tree | 995df7bc856bc61d69d6666d3c569b5bb1a1f905 /runtime/lua/vim/lsp/buf.lua | |
parent | e2ad251c8d01726ecd54d925b5280ab32b448c13 (diff) | |
download | rneovim-989a37a594649528f28432388c0e7e28e8be2753.tar.gz rneovim-989a37a594649528f28432388c0e7e28e8be2753.tar.bz2 rneovim-989a37a594649528f28432388c0e7e28e8be2753.zip |
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
Diffstat (limited to 'runtime/lua/vim/lsp/buf.lua')
-rw-r--r-- | runtime/lua/vim/lsp/buf.lua | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/runtime/lua/vim/lsp/buf.lua b/runtime/lua/vim/lsp/buf.lua index a75e322e90..6383855a30 100644 --- a/runtime/lua/vim/lsp/buf.lua +++ b/runtime/lua/vim/lsp/buf.lua @@ -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 |