Skip to content

Commit 6663468

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

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

lsp/fsharp_language_server.lua

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,18 @@
1313
---
1414
--- `autocmd BufNewFile,BufRead *.fs,*.fsx,*.fsi set filetype=fsharp`
1515

16-
local util = require 'lspconfig.util'
17-
1816
return {
1917
cmd = { 'dotnet', 'FSharpLanguageServer.dll' },
2018
root_dir = function(bufnr, on_dir)
21-
local fname = vim.api.nvim_buf_get_name(bufnr)
22-
on_dir(util.root_pattern('*.sln', '*.fsproj', '.git')(fname))
19+
on_dir(vim.fs.root(bufnr, function(name, _)
20+
local patterns = { '*.sln', '*.fsproj', '.git' }
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
filetypes = { 'fsharp' },
2530
init_options = {

0 commit comments

Comments
 (0)