mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-06-22 08:53:33 +02:00
fix(root): also check root_dir. Fixes #3732
This commit is contained in:
parent
67eece6d74
commit
d4991d5aac
1 changed files with 3 additions and 2 deletions
|
@ -30,12 +30,13 @@ function M.detectors.lsp(buf)
|
||||||
end
|
end
|
||||||
local roots = {} ---@type string[]
|
local roots = {} ---@type string[]
|
||||||
for _, client in pairs(LazyVim.lsp.get_clients({ bufnr = buf })) do
|
for _, client in pairs(LazyVim.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
|
local workspace = client.config.workspace_folders
|
||||||
for _, ws in pairs(workspace or {}) do
|
for _, ws in pairs(workspace or {}) do
|
||||||
roots[#roots + 1] = vim.uri_to_fname(ws.uri)
|
roots[#roots + 1] = vim.uri_to_fname(ws.uri)
|
||||||
end
|
end
|
||||||
|
if client.root_dir then
|
||||||
|
roots[#roots + 1] = client.root_dir
|
||||||
|
end
|
||||||
end
|
end
|
||||||
return vim.tbl_filter(function(path)
|
return vim.tbl_filter(function(path)
|
||||||
path = LazyVim.norm(path)
|
path = LazyVim.norm(path)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue