diff --git a/lua/lspconfig/server_configurations/csharp_ls.lua b/lua/lspconfig/server_configurations/csharp_ls.lua index 0952457b44..131862fbc7 100644 --- a/lua/lspconfig/server_configurations/csharp_ls.lua +++ b/lua/lspconfig/server_configurations/csharp_ls.lua @@ -3,7 +3,9 @@ local util = require 'lspconfig.util' return { default_config = { cmd = { 'csharp-ls' }, - root_dir = util.root_pattern('*.sln', '*.csproj', '*.fsproj', '.git'), + root_dir = function(fname) + return util.root_pattern '*.sln'(fname) or util.root_pattern '*.csproj'(fname) + end, filetypes = { 'cs' }, init_options = { AutomaticWorkspaceInit = true,