We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
lspconfig.util
1 parent 2c905e2 commit dbfc8f6Copy full SHA for dbfc8f6
1 file changed
lsp/csharp_ls.lua
@@ -8,13 +8,18 @@
8
---
9
--- The preferred way to install csharp-ls is with `dotnet tool install --global csharp-ls`.
10
11
-local util = require 'lspconfig.util'
12
-
13
return {
14
cmd = { 'csharp-ls' },
15
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))
+ on_dir(vim.fs.root(bufnr, function(name, _)
+ local patterns = { '*.sln', '*.csproj' }
+ for _, pattern in ipairs(patterns) do
+ if vim.glob.to_lpeg(pattern):match(name) ~= nil then
18
+ return true
19
+ end
20
21
+ return false
22
+ end))
23
end,
24
filetypes = { 'cs' },
25
init_options = {
0 commit comments