dotnet and c# lsp, need to restore all proj first

This commit is contained in:
Luis Miguel Pinto 2024-12-03 16:05:34 +00:00 committed by Luis Miguel Pinto
parent a5897304f2
commit 7f44b50898
1 changed files with 27 additions and 0 deletions

View File

@ -578,6 +578,7 @@ require('lazy').setup({
-- tsserver = {}, -- tsserver = {},
-- --
jdtls = { cmd = { 'jdtls' } }, jdtls = { cmd = { 'jdtls' } },
omnisharp = {},
lua_ls = { lua_ls = {
-- cmd = {...}, -- cmd = {...},
@ -626,6 +627,32 @@ require('lazy').setup({
end, end,
}, },
{
'Hoffs/omnisharp-extended-lsp.nvim',
ft = 'cs', -- Only load for C# files
config = function()
require('lspconfig').omnisharp.setup {
root_dir = require('lspconfig').util.root_pattern('*.csproj', '*.sln'),
settings = {
omnisharp = {
enableEditorConfigSupport = true, -- Enable support for editorconfig
enableMsBuildLoadProjectsOnDemand = true, -- Load projects on demand (avoids excessive loading)
enableRoslynAnalyzers = false, -- Enable Roslyn analyzers
scriptFileSupport = true, -- Enable CSX script support if not needed
loggingLevel = 'debug', -- Enable debugging logs for better diagnostics
},
},
on_attach = function(_, bufnr)
vim.keymap.set('n', 'gd', require('omnisharp_extended').lsp_definition, { buffer = bufnr, desc = 'LSP: ' .. '[G]oto [D]efinition' })
vim.keymap.set('n', 'gr', require('omnisharp_extended').lsp_references, { buffer = bufnr, desc = 'LSP: ' .. '[G]oto [R]eferences' })
vim.keymap.set('n', 'gI', require('omnisharp_extended').lsp_implementation, { buffer = bufnr, desc = 'LSP: ' .. '[G]oto [I]implementation' })
vim.keymap.set('n', '<leader>D', require('omnisharp_extended').lsp_type_definition, { buffer = bufnr, desc = 'LSP: ' .. 'Type [D]efinition' })
print 'OmniSharp is ready!'
end,
}
end,
},
{ -- Autoformat { -- Autoformat
'stevearc/conform.nvim', 'stevearc/conform.nvim',
lazy = false, lazy = false,