Add csharp support

This commit is contained in:
Rui Xuan 2024-07-27 08:01:46 +08:00
parent bdcf55a34b
commit 0d7d0567ab
1 changed files with 534 additions and 510 deletions

View File

@ -412,7 +412,7 @@ require('lazy').setup({
'neovim/nvim-lspconfig', 'neovim/nvim-lspconfig',
dependencies = { dependencies = {
-- Automatically install LSPs and related tools to stdpath for Neovim -- Automatically install LSPs and related tools to stdpath for Neovim
{ 'williamboman/mason.nvim', config = true }, -- NOTE: Must be loaded before dependants { 'williamboman/mason.nvim', config = true, opts = { ensure_installed = { "csharpier", "netcoredbg" }} }, -- NOTE: Must be loaded before dependants
'williamboman/mason-lspconfig.nvim', 'williamboman/mason-lspconfig.nvim',
'WhoIsSethDaniel/mason-tool-installer.nvim', 'WhoIsSethDaniel/mason-tool-installer.nvim',
@ -578,6 +578,26 @@ require('lazy').setup({
-- tsserver = {}, -- tsserver = {},
-- --
omnisharp = {
handlers = {
["textDocument/definition"] = function(...)
return require("omnisharp_extended").handler(...)
end,
},
keys = {
{
"gd",
function()
require("omnisharp_extended").telescope_lsp_definitions()
end,
desc = "Goto Definition",
},
},
enable_roslyn_analyzers = true,
organize_imports_on_format = true,
enable_import_completion = true,
},
lua_ls = { lua_ls = {
-- cmd = {...}, -- cmd = {...},
-- filetypes = { ...}, -- filetypes = { ...},
@ -652,7 +672,8 @@ require('lazy').setup({
end, end,
formatters_by_ft = { formatters_by_ft = {
lua = { 'stylua' }, lua = { 'stylua' },
json = { 'jq' }, json = { 'fixjson' },
cs = { 'csharpier' },
-- Conform can also run multiple formatters sequentially -- Conform can also run multiple formatters sequentially
-- You can use a sub-list to tell conform to run *until* a formatter -- You can use a sub-list to tell conform to run *until* a formatter
-- is found. -- is found.
@ -771,6 +792,9 @@ require('lazy').setup({
} }
end, end,
}, },
{
"Issafalcon/neotest-dotnet",
},
{ -- You can easily change to a different colorscheme. { -- You can easily change to a different colorscheme.
-- Change the name of the colorscheme plugin below, and then -- Change the name of the colorscheme plugin below, and then
@ -852,7 +876,7 @@ require('lazy').setup({
'nvim-treesitter/nvim-treesitter', 'nvim-treesitter/nvim-treesitter',
build = ':TSUpdate', build = ':TSUpdate',
opts = { opts = {
ensure_installed = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'vim', 'vimdoc', 'python', 'rust', 'zig' }, ensure_installed = { 'bash', 'c_sharp', 'lua', 'luadoc', 'markdown', 'vim', 'python', 'rust', 'zig' },
-- Autoinstall languages that are not installed -- Autoinstall languages that are not installed
auto_install = true, auto_install = true,
highlight = { highlight = {