diff options
| author | sigmaSd <bedisnbiba@gmail.com> | 2022-12-04 11:20:40 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-12-04 18:20:40 +0800 |
| commit | ac132be91a6a8170788e7139964288e673b31c5e (patch) | |
| tree | 984d61e704c3ab3a3dd98bacea5d9c6372e76b5f /lua/lspconfig/util.lua | |
| parent | docs: update server_configurations.md (diff) | |
| download | nvim-lspconfig-ac132be91a6a8170788e7139964288e673b31c5e.tar nvim-lspconfig-ac132be91a6a8170788e7139964288e673b31c5e.tar.gz nvim-lspconfig-ac132be91a6a8170788e7139964288e673b31c5e.tar.bz2 nvim-lspconfig-ac132be91a6a8170788e7139964288e673b31c5e.tar.lz nvim-lspconfig-ac132be91a6a8170788e7139964288e673b31c5e.tar.xz nvim-lspconfig-ac132be91a6a8170788e7139964288e673b31c5e.tar.zst nvim-lspconfig-ac132be91a6a8170788e7139964288e673b31c5e.zip | |
fix(lsp): don't spawn new lsp client if already persent (#2287)
Diffstat (limited to 'lua/lspconfig/util.lua')
| -rw-r--r-- | lua/lspconfig/util.lua | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lua/lspconfig/util.lua b/lua/lspconfig/util.lua index 119c1caf..f8a359f0 100644 --- a/lua/lspconfig/util.lua +++ b/lua/lspconfig/util.lua @@ -253,6 +253,14 @@ function M.server_per_root_dir_manager(make_config) -- Check if we have a client already or start and store it. if not client_id then local new_config = make_config(root_dir) + if next(clients) ~= nil then + for _, id in pairs(clients) do + local client = lsp.get_client_by_id(id) + if client.name == new_config.name then + return id + end + end + end -- do nothing if the client is not enabled if new_config.enabled == false then return |
