Skip to content

Commit 0e26351

Browse files
committed
feat(fsautocomplete): do not use lspconfig.util
1 parent dbfc8f6 commit 0e26351

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

lsp/fsautocomplete.lua

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,18 @@
1717
--- This is automatically done by plugins such as [PhilT/vim-fsharp](https://github.com/PhilT/vim-fsharp), [fsharp/vim-fsharp](https://github.com/fsharp/vim-fsharp), and [adelarsq/neofsharp.vim](https://github.com/adelarsq/neofsharp.vim).
1818
---
1919

20-
local util = require 'lspconfig.util'
21-
2220
return {
2321
cmd = { 'fsautocomplete', '--adaptive-lsp-server-enabled' },
2422
root_dir = function(bufnr, on_dir)
25-
local fname = vim.api.nvim_buf_get_name(bufnr)
26-
on_dir(util.root_pattern('*.sln', '*.fsproj', '.git')(fname))
23+
on_dir(vim.fs.root(bufnr, function(name, _)
24+
local patterns = { '*.sln', '*.fsproj', '.git' }
25+
for _, pattern in ipairs(patterns) do
26+
if vim.glob.to_lpeg(pattern):match(name) ~= nil then
27+
return true
28+
end
29+
end
30+
return false
31+
end))
2732
end,
2833
filetypes = { 'fsharp' },
2934
init_options = {

0 commit comments

Comments
 (0)