Skip to content

Commit 251d82e

Browse files
committed
feat(gitlab_ci_ls): do not use lspconfig.util
1 parent 6663468 commit 251d82e

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

lsp/gitlab_ci_ls.lua

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,21 @@
77
--- `gitlab-ci-ls` can be installed via cargo:
88
--- cargo install gitlab-ci-ls
99

10-
local util = require 'lspconfig.util'
11-
1210
local cache_dir = vim.uv.os_homedir() .. '/.cache/gitlab-ci-ls/'
1311

1412
return {
1513
cmd = { 'gitlab-ci-ls' },
1614
filetypes = { 'yaml.gitlab' },
1715
root_dir = function(bufnr, on_dir)
18-
local fname = vim.api.nvim_buf_get_name(bufnr)
19-
on_dir(util.root_pattern('.gitlab*', '.git')(fname))
16+
on_dir(vim.fs.root(bufnr, function(name, _)
17+
local patterns = { '.gitlab*', '.git' }
18+
for _, pattern in ipairs(patterns) do
19+
if vim.glob.to_lpeg(pattern):match(name) ~= nil then
20+
return true
21+
end
22+
end
23+
return false
24+
end))
2025
end,
2126
init_options = {
2227
cache_path = cache_dir,

0 commit comments

Comments
 (0)