-
-
Notifications
You must be signed in to change notification settings - Fork 959
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
cwd
option not work for custom lsp
#5149
Comments
I'm using https://github.com/xiyaowong/coc-sumneko-lua extension to run the lua-language-server, will test the From your test, what you want is: the configured |
right, make ps:
|
The After vim opens any Lua file, coc.nvim will detect the workspace root by rootPattern, from the file location. https://github.com/neoclide/coc.nvim/wiki/Using-workspaceFolders#resolve-workspace-folder For your use case, the workpaceFolder or rootUri or rootPath will match your need, but you can't set it from |
@ZSaberLv0 I don't understand your case for now. For example we have two projects:
Do want to language server runs on p1 even you launch vim in p2? Why? In my workflow:
Can you describe your workflow case? |
|
Yes, the global
I'm interested in this case. If you open the certain Lua file in root project, your startup dir, the lua-LS indeed to perform huge indexing because the current dir is used as rootUri/rootPath for the server. I don't think there's anyway to stop the server to index, unless you put the Lua file in a sub folder with rootPattern, in coc.nvim's current detecting logic. Setting a custom rootUri/rootPath/workspaceFolder is the way. The Same issue #4938 |
Result from CocInfo
Describe the bug
the document says
"cwd": Working directory used to start languageserver, vim's cwd is used by default
but not work, process still started on
getcwd()
Reproduce the bug
install lua-language-server
Create file
mini.vim
with:cd
to any dir except/path/to/test
, Start (neo)vim with command:vim -u mini.vim
edit any lua file, input something to make lsp run
open the log file of
lua-language-server
in/path/to/logs
, searchrootUri
rootUri
would begetcwd()
, which should be the value configured bycwd
lua-language-server
index all files undergetcwd()
, see alsoThe text was updated successfully, but these errors were encountered: