From bc1ee597b184ec53aa95b7ce49057d4eceb7bd33 Mon Sep 17 00:00:00 2001 From: Pasi Bergman Date: Sat, 17 Jul 2021 17:37:01 +0300 Subject: fix(omnisharp): proritize .sln over .csproj for root detection --- lua/lspconfig/omnisharp.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lua') diff --git a/lua/lspconfig/omnisharp.lua b/lua/lspconfig/omnisharp.lua index fcba1be5..335f75f7 100644 --- a/lua/lspconfig/omnisharp.lua +++ b/lua/lspconfig/omnisharp.lua @@ -5,7 +5,9 @@ local server_name = 'omnisharp' configs[server_name] = { default_config = { filetypes = { 'cs', 'vb' }, - root_dir = util.root_pattern('*.csproj', '*.sln'), + root_dir = function(fname) + return util.root_pattern '*.sln'(fname) or util.root_pattern '*.csproj'(fname) + end, init_options = {}, }, -- on_new_config = function(new_config) end; @@ -40,7 +42,7 @@ find /path/to/omnisharp-osx | xargs xattr -r -d com.apple.quarantine ``` ]], default_config = { - root_dir = [[root_pattern(".csproj", ".sln")]], + root_dir = [[root_pattern(".sln") or root_pattern(".csproj")]], }, }, } -- cgit v1.2.3-70-g09d2