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

Make LSP root detection more robust "borrowing" the lspconfig strategy #120

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

hawk78
Copy link

@hawk78 hawk78 commented May 31, 2023

The current implementation does not always get the right path for some LPSs. E.g. lua_ls.

This implementation strategy comes from lspconfig itself, but does not add new any dependency.

The current implementation that this request replaces is using deprecated API in vim.lsp.

@hawk78
Copy link
Author

hawk78 commented Jun 9, 2023

Looks like this project is unmaintained, is anyone here?

@ahmedkhalf
Copy link
Owner

Not much time to maintain it, will have a look when I get the chance to

@gmerzu
Copy link

gmerzu commented Aug 20, 2023

Hello,

I can confirm this PR targets important issue.

The easiest way to reproduce:

  1. Open two files from different projects
  2. When switching between the buffers, root dir is the same, since vim.lsp.buf_get_clients()[X].config.root_dir returns the same. As mentioned here, need to follow lspconfig strategy and check for vim.lsp.buf_get_clients()[X].workspace_folders

With this fix, there is no such issue on my side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants