mirror of
https://github.com/NotAShelf/nvf.git
synced 2025-09-06 02:11:33 +00:00
languages/csharp: Replace root_markers with root_dir
Replace the root_markers with root_dir in roslyn_ls and omnisharp
This commit is contained in:
parent
15b9e65368
commit
9eb060dde2
1 changed files with 24 additions and 2 deletions
|
@ -43,7 +43,18 @@
|
||||||
}
|
}
|
||||||
'';
|
'';
|
||||||
filetypes = ["cs" "vb"];
|
filetypes = ["cs" "vb"];
|
||||||
root_markers = [".sln" ".csproj" "omnisharp.json" "function.json"];
|
root_dir = mkLuaInline ''
|
||||||
|
function(bufnr, on_dir)
|
||||||
|
local function find_root_pattern(fname, lua_pattern)
|
||||||
|
return vim.fs.root(0, function(name, path)
|
||||||
|
return name:match(lua_pattern)
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
|
local fname = vim.api.nvim_buf_get_name(bufnr)
|
||||||
|
on_dir(find_root_pattern(fname, "%.sln$") or find_root_pattern(fname, "%.csproj$"))
|
||||||
|
end
|
||||||
|
'';
|
||||||
init_options = {};
|
init_options = {};
|
||||||
capabilities = {
|
capabilities = {
|
||||||
workspace = {
|
workspace = {
|
||||||
|
@ -138,7 +149,18 @@
|
||||||
'';
|
'';
|
||||||
|
|
||||||
filetypes = ["cs"];
|
filetypes = ["cs"];
|
||||||
root_markers = [".sln" ".csproj" ".editorconfig"];
|
root_dir = mkLuaInline ''
|
||||||
|
function(bufnr, on_dir)
|
||||||
|
local function find_root_pattern(fname, lua_pattern)
|
||||||
|
return vim.fs.root(0, function(name, path)
|
||||||
|
return name:match(lua_pattern)
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
|
||||||
|
local fname = vim.api.nvim_buf_get_name(bufnr)
|
||||||
|
on_dir(find_root_pattern(fname, "%.sln$") or find_root_pattern(fname, "%.csproj$"))
|
||||||
|
end
|
||||||
|
'';
|
||||||
init_options = {};
|
init_options = {};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue