aboutsummaryrefslogtreecommitdiffstats
path: root/lua/lspconfig/util.lua
diff options
context:
space:
mode:
authorYuki Ito <mrno110y@gmail.com>2022-12-24 15:43:32 +0900
committerGitHub <noreply@github.com>2022-12-24 14:43:32 +0800
commit011e51b33d667bd36591833a2c5d20bbe18fbfc5 (patch)
tree049ec4ec2471eb49c9581b4df93d7a953a0867a0 /lua/lspconfig/util.lua
parentrefactor: remove single_clients and improve clients reuse (#2334) (diff)
downloadnvim-lspconfig-011e51b33d667bd36591833a2c5d20bbe18fbfc5.tar
nvim-lspconfig-011e51b33d667bd36591833a2c5d20bbe18fbfc5.tar.gz
nvim-lspconfig-011e51b33d667bd36591833a2c5d20bbe18fbfc5.tar.bz2
nvim-lspconfig-011e51b33d667bd36591833a2c5d20bbe18fbfc5.tar.lz
nvim-lspconfig-011e51b33d667bd36591833a2c5d20bbe18fbfc5.tar.xz
nvim-lspconfig-011e51b33d667bd36591833a2c5d20bbe18fbfc5.tar.zst
nvim-lspconfig-011e51b33d667bd36591833a2c5d20bbe18fbfc5.zip
fix: check server_capabilities field exist (#2348)
Diffstat (limited to 'lua/lspconfig/util.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 20244bb8..7867e0f9 100644
--- a/lua/lspconfig/util.lua
+++ b/lua/lspconfig/util.lua
@@ -243,7 +243,12 @@ function M.server_per_root_dir_manager(make_config)
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.workspace then
+ if
+ client
+ and client.name == conf.name
+ and client.server_capabilities
+ and client.server_capabilities.workspace
+ then
return client
end
end