aboutsummaryrefslogtreecommitdiffstats
path: root/lua
diff options
context:
space:
mode:
authorRaphael <glepnir@neovim.pro>2022-12-25 17:13:31 +0800
committerGitHub <noreply@github.com>2022-12-25 17:13:31 +0800
commitefafc5d09f1815f29985108f0edfd1fe74b65458 (patch)
tree5c0d9f18d3447249f135030b1c8489fab8d38345 /lua
parentfix: check client support workspaceFolders (#2350) (diff)
downloadnvim-lspconfig-efafc5d09f1815f29985108f0edfd1fe74b65458.tar
nvim-lspconfig-efafc5d09f1815f29985108f0edfd1fe74b65458.tar.gz
nvim-lspconfig-efafc5d09f1815f29985108f0edfd1fe74b65458.tar.bz2
nvim-lspconfig-efafc5d09f1815f29985108f0edfd1fe74b65458.tar.lz
nvim-lspconfig-efafc5d09f1815f29985108f0edfd1fe74b65458.tar.xz
nvim-lspconfig-efafc5d09f1815f29985108f0edfd1fe74b65458.tar.zst
nvim-lspconfig-efafc5d09f1815f29985108f0edfd1fe74b65458.zip
fix: check client exist supports_method (#2351)
Diffstat (limited to 'lua')
-rw-r--r--lua/lspconfig/util.lua7
1 files changed, 6 insertions, 1 deletions
diff --git a/lua/lspconfig/util.lua b/lua/lspconfig/util.lua
index 2296180b..bb8af331 100644
--- a/lua/lspconfig/util.lua
+++ b/lua/lspconfig/util.lua
@@ -241,7 +241,12 @@ function M.server_per_root_dir_manager(make_config)
local client_id_iterator = function(client_ids, conf)
for _, id in ipairs(client_ids) do
local client = lsp.get_client_by_id(id)
- if client and client.name == conf.name and client.supports_method 'workspace/workspaceFolders' then
+ if
+ client
+ and client.name == conf.name
+ and client.supports_method
+ and client.supports_method 'workspace/workspaceFolders'
+ then
return client
end
end