diff options
| author | Patricio Serrano <43413954+serranomorante@users.noreply.github.com> | 2024-02-06 06:54:41 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-02-06 13:54:41 +0800 |
| commit | 0a1a2aa549da0d2294e072e2d725f02cca32f64e (patch) | |
| tree | 84653772bc0a83156352ed2492ce96576e58b5aa /lua/lspconfig/manager.lua | |
| parent | docs: update server_configurations.md (diff) | |
| download | nvim-lspconfig-0a1a2aa549da0d2294e072e2d725f02cca32f64e.tar nvim-lspconfig-0a1a2aa549da0d2294e072e2d725f02cca32f64e.tar.gz nvim-lspconfig-0a1a2aa549da0d2294e072e2d725f02cca32f64e.tar.bz2 nvim-lspconfig-0a1a2aa549da0d2294e072e2d725f02cca32f64e.tar.lz nvim-lspconfig-0a1a2aa549da0d2294e072e2d725f02cca32f64e.tar.xz nvim-lspconfig-0a1a2aa549da0d2294e072e2d725f02cca32f64e.tar.zst nvim-lspconfig-0a1a2aa549da0d2294e072e2d725f02cca32f64e.zip | |
fix: enforce single file mode check when root_dir differs from client (#2998)
fixes issue [#2959](https://github.com/neovim/nvim-lspconfig/issues/2959#issue-2068768094)
Diffstat (limited to 'lua/lspconfig/manager.lua')
| -rw-r--r-- | lua/lspconfig/manager.lua | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lua/lspconfig/manager.lua b/lua/lspconfig/manager.lua index 5d260b41..0c7bc823 100644 --- a/lua/lspconfig/manager.lua +++ b/lua/lspconfig/manager.lua @@ -203,7 +203,8 @@ function M:add(root_dir, single_file, bufnr) local new_config = self.make_config(root_dir) local client = self:_get_client_from_cache(root_dir, new_config.name) - if not client then + ---If single_file_mode is false then root_dir should match client otherwise start a new client + if not client or (not single_file and client.config.root_dir and client.config.root_dir ~= root_dir) then return self:_start_new_client(bufnr, new_config, root_dir, single_file) end |
