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

Update util.rootpath to search all patterns per path => Fixes kotlin-ls root dir on multi-project builds #3321

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions lua/lspconfig/util.lua
Original file line number Diff line number Diff line change
Expand Up @@ -276,18 +276,18 @@ function M.root_pattern(...)
local patterns = M.tbl_flatten { ... }
return function(startpath)
startpath = M.strip_archive_subpath(startpath)
for _, pattern in ipairs(patterns) do
local match = M.search_ancestors(startpath, function(path)
local match = M.search_ancestors(startpath, function(path)
for _, pattern in ipairs(patterns) do
for _, p in ipairs(vim.fn.glob(M.path.join(M.path.escape_wildcards(path), pattern), true, true)) do
if M.path.exists(p) then
return path
end
end
end)

if match ~= nil then
return match
end
end)

if match ~= nil then
return match
end
end
end
Expand Down
Loading