project.nvim icon indicating copy to clipboard operation
project.nvim copied to clipboard

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

Open hawk78 opened this issue 1 year ago • 3 comments

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 avatar May 31 '23 07:05 hawk78

Looks like this project is unmaintained, is anyone here?

hawk78 avatar Jun 09 '23 10:06 hawk78

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

ahmedkhalf avatar Jun 11 '23 19:06 ahmedkhalf

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.

gmerzu avatar Aug 20 '23 18:08 gmerzu