diff options
Diffstat (limited to 'lua/lspconfig/manager.lua')
| -rw-r--r-- | lua/lspconfig/manager.lua | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/lua/lspconfig/manager.lua b/lua/lspconfig/manager.lua index d5db2833..ca24d31c 100644 --- a/lua/lspconfig/manager.lua +++ b/lua/lspconfig/manager.lua @@ -58,12 +58,10 @@ end --- @param root_dir string --- @param client vim.lsp.Client function M:_notify_workspace_folder_added(root_dir, client) - if is_dir_in_workspace_folders(client, root_dir) then - return - end - - local supported = vim.tbl_get(client, 'server_capabilities', 'workspace', 'workspaceFolders', 'supported') - if not supported then + if + is_dir_in_workspace_folders(client, root_dir) + or not vim.tbl_get(client, 'server_capabilities', 'workspace', 'workspaceFolders', 'supported') + then return end @@ -132,6 +130,10 @@ function M:_start_client(bufnr, new_config, root_dir, single_file, silent) bufnr = bufnr, silent = silent, reuse_client = function(existing_client) + if not vim.tbl_get(existing_client, 'server_capabilities', 'workspace', 'workspaceFolders', 'supported') then + return false + end + if (self._clients[root_dir] or {})[existing_client.name] then self:_notify_workspace_folder_added(root_dir, existing_client) return true |
