aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/lsp/buf.lua
diff options
context:
space:
mode:
authorMichael Lingelbach <m.j.lbach@gmail.com>2022-04-30 02:22:30 -0700
committerGitHub <noreply@github.com>2022-04-30 11:22:30 +0200
commitc618b314c6a266806edf692122b16ba9ff7a8e10 (patch)
tree8e78db8393fc2a567fd3515c73a60f6041a2a6bb /runtime/lua/vim/lsp/buf.lua
parentdf09e03cf74337675751c3240069a26aec75fa3b (diff)
downloadrneovim-c618b314c6a266806edf692122b16ba9ff7a8e10.tar.gz
rneovim-c618b314c6a266806edf692122b16ba9ff7a8e10.tar.bz2
rneovim-c618b314c6a266806edf692122b16ba9ff7a8e10.zip
chore(lsp): remove capabilities sanitization (#17814)
* feat(lsp)!: remove capabilities sanitization Users must now access client.server_capabilities which matches the same structure as the protocol. https://microsoft.github.io/language-server-protocol/specification client.resolved_capabilities is no longer used to gate capabilities, and will be removed in a future release. BREAKING CHANGE Co-authored-by: Mathias Fussenegger <f.mathias@zignar.net>
Diffstat (limited to 'runtime/lua/vim/lsp/buf.lua')
-rw-r--r--runtime/lua/vim/lsp/buf.lua5
1 files changed, 2 insertions, 3 deletions
diff --git a/runtime/lua/vim/lsp/buf.lua b/runtime/lua/vim/lsp/buf.lua
index 00919c6b04..62de8d7321 100644
--- a/runtime/lua/vim/lsp/buf.lua
+++ b/runtime/lua/vim/lsp/buf.lua
@@ -224,7 +224,7 @@ function M.formatting_seq_sync(options, timeout_ms, order)
-- loop through the clients and make synchronous formatting requests
for _, client in pairs(clients) do
- if client.resolved_capabilities.document_formatting then
+ if vim.tbl_get(client.server_capabilities, "documentFormattingProvider") then
local params = util.make_formatting_params(options)
local result, err = client.request_sync("textDocument/formatting", params, timeout_ms, vim.api.nvim_get_current_buf())
if result and result.result then
@@ -545,8 +545,7 @@ local function on_code_action_results(results, ctx, options)
local action = action_tuple[2]
if not action.edit
and client
- and type(client.resolved_capabilities.code_action) == 'table'
- and client.resolved_capabilities.code_action.resolveProvider then
+ and vim.tbl_get(client.server_capabilities, "codeActionProvider", "resolveProvider") then
client.request('codeAction/resolve', action, function(err, resolved_action)
if err then