Skip to content

Commit 2c905e2

Browse files
committed
feat(autotools_ls): do not use lspconfig.util
1 parent ee49fe5 commit 2c905e2

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

lsp/autotools_ls.lua

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,19 @@
99
---
1010
--- Language server for autoconf, automake and make using tree sitter in python.
1111

12-
local util = require 'lspconfig.util'
13-
1412
local root_files = { 'configure.ac', 'Makefile', 'Makefile.am', '*.mk' }
1513

1614
return {
1715
cmd = { 'autotools-language-server' },
1816
filetypes = { 'config', 'automake', 'make' },
1917
root_dir = function(bufnr, on_dir)
20-
local fname = vim.api.nvim_buf_get_name(bufnr)
21-
on_dir(util.root_pattern(unpack(root_files))(fname))
18+
on_dir(vim.fs.root(bufnr, function(name, _)
19+
for _, pattern in ipairs(root_files) do
20+
if vim.glob.to_lpeg(pattern):match(name) ~= nil then
21+
return true
22+
end
23+
end
24+
return false
25+
end))
2226
end,
2327
}

0 commit comments

Comments
 (0)