fix: reuse of LSP client if the root dir and config name has not changed#378
Closed
AntoineGS wants to merge 9 commits intozbirenbaum:masterfrom
Closed
fix: reuse of LSP client if the root dir and config name has not changed#378AntoineGS wants to merge 9 commits intozbirenbaum:masterfrom
AntoineGS wants to merge 9 commits intozbirenbaum:masterfrom
Conversation
language server now expects to be run directly through language-server.js
…if something fails
bdda0ea to
522b62a
Compare
Prevents scenarios where a second client could be created and cause and caught in store_client_id. May fix zbirenbaum#359
522b62a to
948d589
Compare
Collaborator
Author
|
Turns out lsp.lua wants one of the workspace_folders to match the root_dir or it assumes a new workspace. --- @param client vim.lsp.Client
--- @param config vim.lsp.ClientConfig
--- @return boolean
local function reuse_client_default(client, config)
if client.name ~= config.name then
return false
end
if config.root_dir then
for _, dir in ipairs(client.workspace_folders or {}) do
-- note: do not need to check client.root_dir since that should be client.workspace_folders[1]
if config.root_dir == dir.name then
return true
end
end
end
-- TODO(lewis6991): also check config.workspace_folders
return false
endI am closing this as this is fixed in the workspace implementation. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Prevents scenarios where a second client could be created and cause and caught in store_client_id. May fix #359