Skip to content

Commit a6403a6

Browse files
committed
feat(pasls): do not use lspconfig.util
1 parent a1b447c commit a6403a6

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

lsp/pasls.lua

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,18 @@
1515
--- export FPCTARGETCPU='x86_64' # Target CPU for cross compiling.
1616
--- ```
1717

18-
local util = require 'lspconfig.util'
19-
2018
return {
2119
cmd = { 'pasls' },
2220
filetypes = { 'pascal' },
2321
root_dir = function(bufnr, on_dir)
24-
local fname = vim.api.nvim_buf_get_name(bufnr)
25-
on_dir(util.root_pattern('*.lpi', '*.lpk', '.git')(fname))
22+
on_dir(vim.fs.root(bufnr, function(name, _)
23+
local patterns = { '*.lpi', '*.lpk', '.git' }
24+
for _, pattern in ipairs(patterns) do
25+
if vim.glob.to_lpeg(pattern):match(name) ~= nil then
26+
return true
27+
end
28+
end
29+
return false
30+
end))
2631
end,
2732
}

0 commit comments

Comments
 (0)