Skip to content

Commit 07b0073

Browse files
committed
feat(msbuild_project_tools_server): do not use lspconfig.util
1 parent 39f298b commit 07b0073

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

lsp/msbuild_project_tools_server.lua

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,19 @@
3333
--- ```
3434

3535
local host_dll_name = 'MSBuildProjectTools.LanguageServer.Host.dll'
36-
local util = require 'lspconfig.util'
3736

3837
return {
3938
filetypes = { 'msbuild' },
4039
root_dir = function(bufnr, on_dir)
41-
local fname = vim.api.nvim_buf_get_name(bufnr)
42-
on_dir(util.root_pattern('*.sln', '*.slnx', '*.*proj', '.git')(fname))
40+
on_dir(vim.fs.root(bufnr, function(name, _)
41+
local patterns = { '*.sln', '*.slnx', '*.*proj', '.git' }
42+
for _, pattern in ipairs(patterns) do
43+
if vim.glob.to_lpeg(pattern):match(name) ~= nil then
44+
return true
45+
end
46+
end
47+
return false
48+
end))
4349
end,
4450
init_options = {},
4551
cmd = { 'dotnet', host_dll_name },

0 commit comments

Comments
 (0)