Skip to content

Commit

Permalink
Set kotlin-ls root dir to closest to startpath
Browse files Browse the repository at this point in the history
  • Loading branch information
paulodiovani committed Sep 27, 2024
1 parent a9bc587 commit 181dd66
Showing 1 changed file with 6 additions and 6 deletions.
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

0 comments on commit 181dd66

Please sign in to comment.