LSP should not be passed workspace/didChangeWorkspaceFolders
when started in single file mode
#3598
Labels
bug
Something isn't working
Summary
LSPs started in single file mode are passed
workspace/didChangeWorkspaceFolders
which causes them to scan the whole disk.Description
Minimal vimrc:
Relevant parts of lsp.log
The LSP is correctly started with rootPath = nil and workspaceFolders = nil.
Immediately afterwards though, we have a:
After which Pyright starts scanning all the files in my disk. A random example:
Some relevant parts from manager.lua that seem responsible are:
nvim-lspconfig/lua/lspconfig/manager.lua
Lines 104 to 106 in ead2fbc
which seems to unconditionally trigger a
_notify_workspace_folder_added
, without checking the value ofsingle_file
.Commenting out this block seems to fix this issue.
Some other problematic parts seem to be:
nvim-lspconfig/lua/lspconfig/manager.lua
Lines 134 to 142 in ead2fbc
Which attaches a workspace folder when reusing a client, without checking the value of
single_file
.root_dir
here is the “pseudo-root”, so is not NIL.——
It seems that this bit of the code is deprecated though (#3531 (comment)). I can send a PR for this, otherwise.
The text was updated successfully, but these errors were encountered: