diff options
author | Folke Lemaitre <folke.lemaitre@gmail.com> | 2023-05-28 07:51:28 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-28 07:51:28 +0200 |
commit | ddd92a70d2aab5247895e89abaaa79c62ba7dbb4 (patch) | |
tree | 12d216a7fbc41d7f70dfefa3148f84435d1cd41b /runtime/lua/vim/lsp/buf.lua | |
parent | e41b2e34b46a806b0fc59914263f8f4af9ac62f1 (diff) | |
download | rneovim-ddd92a70d2aab5247895e89abaaa79c62ba7dbb4.tar.gz rneovim-ddd92a70d2aab5247895e89abaaa79c62ba7dbb4.tar.bz2 rneovim-ddd92a70d2aab5247895e89abaaa79c62ba7dbb4.zip |
feat(lsp): initial support for dynamic capabilities (#23681)
- `client.dynamic_capabilities` is an object that tracks client register/unregister
- `client.supports_method` will additionally check if a dynamic capability supports the method, taking document filters into account. But only if the client enabled `dynamicRegistration` for the capability
- updated the default client capabilities to include dynamicRegistration for:
- formatting
- rangeFormatting
- hover
- codeAction
- hover
- rename
Diffstat (limited to 'runtime/lua/vim/lsp/buf.lua')
-rw-r--r-- | runtime/lua/vim/lsp/buf.lua | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/runtime/lua/vim/lsp/buf.lua b/runtime/lua/vim/lsp/buf.lua index a307dea673..b2f202c4ba 100644 --- a/runtime/lua/vim/lsp/buf.lua +++ b/runtime/lua/vim/lsp/buf.lua @@ -683,11 +683,7 @@ local function on_code_action_results(results, ctx, options) -- local client = vim.lsp.get_client_by_id(action_tuple[1]) local action = action_tuple[2] - if - not action.edit - and client - and vim.tbl_get(client.server_capabilities, 'codeActionProvider', 'resolveProvider') - then + if not action.edit and client and client.supports_method('codeAction/resolve') then client.request('codeAction/resolve', action, function(err, resolved_action) if err then vim.notify(err.code .. ': ' .. err.message, vim.log.levels.ERROR) |