tried to get csharp working better, its a mess :P

This commit is contained in:
kossLAN 2025-05-20 21:13:10 -04:00
parent 64ae6ef9ff
commit a578d94148
Signed by: kossLAN
SSH key fingerprint: SHA256:bdV0x+wdQHGJ6LgmstH3KV8OpWY+OOFmJcPcB0wQPV8
4 changed files with 58 additions and 5 deletions

View file

@ -8,9 +8,36 @@ vim.bo.expandtab = true
local lsp = require('user.lsp')
-- TODO: make a helper function that does the wildcard matching to find the root dir
local root_files = {
'.git',
-- '*.sln',
-- '*.csproj',
-- 'omnisharp.json',
}
vim.lsp.start {
name = 'roslyn',
cmd = { 'OmniSharp', '-z', 'DotNet:enablePackageRestore=false', '--encoding', 'utf-8', '--languageserver' },
cmd = {
'OmniSharp',
'-z',
'DotNet:enablePackageRestore=false',
'--encoding',
'utf-8',
'--languageserver',
},
root_dir = vim.fs.dirname(vim.fs.find(root_files, { upward = true })[1]),
capabilities = lsp.make_client_capabilities(),
on_attach = lsp.on_attach,
settings = {
FormattingOptions = {
EnableEditorConfigSupport = true,
},
MsBuild = {},
RenameOptions = {},
RoslynExtensionsOptions = {},
Sdk = {
IncludePrereleases = true,
},
},
}