Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(lsp): use the same lsp server for filetype if it exists #2287

Merged
merged 1 commit into from
Dec 4, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions lua/lspconfig/util.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down