From 011e51b33d667bd36591833a2c5d20bbe18fbfc5 Mon Sep 17 00:00:00 2001 From: Yuki Ito Date: Sat, 24 Dec 2022 15:43:32 +0900 Subject: fix: check server_capabilities field exist (#2348) --- lua/lspconfig/util.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lua') 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 -- cgit v1.2.3-70-g09d2