Skip to content

Commit 064eb13

Browse files
committed
feat(ada_ls): do not use lspconfig.util
1 parent ac794fa commit 064eb13

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

lsp/ada_ls.lua

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,18 @@
1818
--- })
1919
--- ```
2020

21-
local util = require 'lspconfig.util'
22-
2321
return {
2422
cmd = { 'ada_language_server' },
2523
filetypes = { 'ada' },
2624
root_dir = function(bufnr, on_dir)
27-
local fname = vim.api.nvim_buf_get_name(bufnr)
28-
on_dir(util.root_pattern('Makefile', '.git', 'alire.toml', '*.gpr', '*.adc')(fname))
25+
on_dir(vim.fs.root(bufnr, function(name, _)
26+
local patterns = { 'Makefile', '.git', 'alire.toml', '*.gpr', '*.adc' }
27+
for _, pattern in ipairs(patterns) do
28+
if vim.glob.to_lpeg(pattern):match(name) ~= nil then
29+
return true
30+
end
31+
end
32+
return false
33+
end))
2934
end,
3035
}

0 commit comments

Comments
 (0)