mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-06-23 09:18:51 +02:00
fix(root): dont use single-file lsps for root detection. use workspaces only
This commit is contained in:
parent
8af7309c7e
commit
6f88b8b36f
1 changed files with 2 additions and 3 deletions
|
@ -32,13 +32,12 @@ function M.detectors.lsp(buf)
|
|||
end
|
||||
local roots = {} ---@type string[]
|
||||
for _, client in pairs(Util.lsp.get_clients({ bufnr = buf })) do
|
||||
-- only check workspace folders, since we're not interested in clients
|
||||
-- running in single file mode
|
||||
local workspace = client.config.workspace_folders
|
||||
for _, ws in pairs(workspace or {}) do
|
||||
roots[#roots + 1] = vim.uri_to_fname(ws.uri)
|
||||
end
|
||||
if client.config.root_dir then
|
||||
roots[#roots + 1] = client.config.root_dir
|
||||
end
|
||||
end
|
||||
return vim.tbl_filter(function(path)
|
||||
path = Util.norm(path)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue