feat(editors): improve omnisharp root location
Some of my projects have multiple .sln files, where I'd like to prefer the .sln in the project root directory.
This commit is contained in:
parent
1bdf1fd9bd
commit
c2a279b334
|
@ -89,6 +89,11 @@ config.rust_analyzer.setup {
|
|||
config.omnisharp.setup {
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
root_dir = function(f)
|
||||
local git_root = config.util.root_pattern(".git")(f)
|
||||
local git_root_sln = config.util.root_pattern("*.sln")(git_root)
|
||||
return git_root_sln or config.util.root_pattern("*.sln", "*.csproj")(f)
|
||||
end,
|
||||
cmd = { "OmniSharp", "--languageserver", "--hostPID", tostring(pid) },
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue