diff options
| author | glepnir <glephunter@gmail.com> | 2024-11-26 19:18:12 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-11-26 19:18:12 +0800 |
| commit | 064221eed39e7dc81cf1d27c0d016f4b29a9aad1 (patch) | |
| tree | edd07997186f3b45f027671e0235895e2dde9e59 /lua/lspconfig/manager.lua | |
| parent | fix: check existing_client support workspaceFolder (#3452) (diff) | |
| download | nvim-lspconfig-064221eed39e7dc81cf1d27c0d016f4b29a9aad1.tar nvim-lspconfig-064221eed39e7dc81cf1d27c0d016f4b29a9aad1.tar.gz nvim-lspconfig-064221eed39e7dc81cf1d27c0d016f4b29a9aad1.tar.bz2 nvim-lspconfig-064221eed39e7dc81cf1d27c0d016f4b29a9aad1.tar.lz nvim-lspconfig-064221eed39e7dc81cf1d27c0d016f4b29a9aad1.tar.xz nvim-lspconfig-064221eed39e7dc81cf1d27c0d016f4b29a9aad1.tar.zst nvim-lspconfig-064221eed39e7dc81cf1d27c0d016f4b29a9aad1.zip | |
Revert "fix: check existing_client support workspaceFolder (#3452)" (#3459)
This reverts commit fe88eade4ab50fca9ace99205cad1d91645ed9e8.
Diffstat (limited to 'lua/lspconfig/manager.lua')
| -rw-r--r-- | lua/lspconfig/manager.lua | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/lua/lspconfig/manager.lua b/lua/lspconfig/manager.lua index ca24d31c..d5db2833 100644 --- a/lua/lspconfig/manager.lua +++ b/lua/lspconfig/manager.lua @@ -58,10 +58,12 @@ 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) - or not vim.tbl_get(client, 'server_capabilities', 'workspace', 'workspaceFolders', 'supported') - then + 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 return end @@ -130,10 +132,6 @@ 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 |
