Skip to content

Commit c897967

Browse files
committed
feat(ocamlls): do not use lspconfig.util
1 parent 67c47cf commit c897967

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

lsp/ocamlls.lua

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,18 @@
77
--- npm install -g ocaml-language-server
88
--- ```
99

10-
local util = require 'lspconfig.util'
11-
1210
return {
1311
cmd = { 'ocaml-language-server', '--stdio' },
1412
filetypes = { 'ocaml', 'reason' },
1513
root_dir = function(bufnr, on_dir)
16-
local fname = vim.api.nvim_buf_get_name(bufnr)
17-
on_dir(util.root_pattern('*.opam', 'esy.json', 'package.json')(fname))
14+
on_dir(vim.fs.root(bufnr, function(name, _)
15+
local patterns = { '*.opam', 'esy.json', 'package.json' }
16+
for _, pattern in ipairs(patterns) do
17+
if vim.glob.to_lpeg(pattern):match(name) ~= nil then
18+
return true
19+
end
20+
end
21+
return false
22+
end))
1823
end,
1924
}

0 commit comments

Comments
 (0)