Skip to content

Commit a42bb6f

Browse files
committed
feat(hls): do not use lspconfig.util
1 parent 37bd4c7 commit a42bb6f

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

lsp/hls.lua

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,19 @@
1212
--- })
1313
--- ```
1414

15-
local util = require 'lspconfig.util'
16-
1715
return {
1816
cmd = { 'haskell-language-server-wrapper', '--lsp' },
1917
filetypes = { 'haskell', 'lhaskell' },
2018
root_dir = function(bufnr, on_dir)
21-
local fname = vim.api.nvim_buf_get_name(bufnr)
22-
on_dir(util.root_pattern('hie.yaml', 'stack.yaml', 'cabal.project', '*.cabal', 'package.yaml')(fname))
19+
on_dir(vim.fs.root(bufnr, function(name, _)
20+
local patterns = { 'hie.yaml', 'stack.yaml', 'cabal.project', '*.cabal', 'package.yaml' }
21+
for _, pattern in ipairs(patterns) do
22+
if vim.glob.to_lpeg(pattern):match(name) ~= nil then
23+
return true
24+
end
25+
end
26+
return false
27+
end))
2328
end,
2429
settings = {
2530
haskell = {

0 commit comments

Comments
 (0)