aboutsummaryrefslogtreecommitdiffstats
path: root/lua/lspconfig/util.lua
diff options
context:
space:
mode:
authorRaphael <glepnir@neovim.pro>2022-12-25 12:44:05 +0800
committerGitHub <noreply@github.com>2022-12-25 12:44:05 +0800
commit798632ae01d6cfa347a28e7b845a15b0923726e3 (patch)
tree36b769fdce64ef3ac676f168b2946340385c1e4e /lua/lspconfig/util.lua
parentfix: check server_capabilities field exist (#2348) (diff)
downloadnvim-lspconfig-798632ae01d6cfa347a28e7b845a15b0923726e3.tar
nvim-lspconfig-798632ae01d6cfa347a28e7b845a15b0923726e3.tar.gz
nvim-lspconfig-798632ae01d6cfa347a28e7b845a15b0923726e3.tar.bz2
nvim-lspconfig-798632ae01d6cfa347a28e7b845a15b0923726e3.tar.lz
nvim-lspconfig-798632ae01d6cfa347a28e7b845a15b0923726e3.tar.xz
nvim-lspconfig-798632ae01d6cfa347a28e7b845a15b0923726e3.tar.zst
nvim-lspconfig-798632ae01d6cfa347a28e7b845a15b0923726e3.zip
fix: check client support workspaceFolders (#2350)
Diffstat (limited to 'lua/lspconfig/util.lua')
-rw-r--r--lua/lspconfig/util.lua9
1 files changed, 1 insertions, 8 deletions
diff --git a/lua/lspconfig/util.lua b/lua/lspconfig/util.lua
index 7867e0f9..2296180b 100644
--- a/lua/lspconfig/util.lua
+++ b/lua/lspconfig/util.lua
@@ -241,14 +241,7 @@ 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 found the workspace field in server_capabilities the server support workspace
- -- if server not support the worskspace spawn a new server instance then.
- if
- client
- and client.name == conf.name
- and client.server_capabilities
- and client.server_capabilities.workspace
- then
+ if client and client.name == conf.name and client.supports_method 'workspace/workspaceFolders' then
return client
end
end