Skip to content

Commit dbfc8f6

Browse files
committed
feat(csharp_ls): do not use lspconfig.util
1 parent 2c905e2 commit dbfc8f6

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

lsp/csharp_ls.lua

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,18 @@
88
---
99
--- The preferred way to install csharp-ls is with `dotnet tool install --global csharp-ls`.
1010

11-
local util = require 'lspconfig.util'
12-
1311
return {
1412
cmd = { 'csharp-ls' },
1513
root_dir = function(bufnr, on_dir)
16-
local fname = vim.api.nvim_buf_get_name(bufnr)
17-
on_dir(util.root_pattern '*.sln'(fname) or util.root_pattern '*.csproj'(fname))
14+
on_dir(vim.fs.root(bufnr, function(name, _)
15+
local patterns = { '*.sln', '*.csproj' }
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
filetypes = { 'cs' },
2025
init_options = {

0 commit comments

Comments
 (0)