diff --git a/lua/astrocommunity/pack/cs-omnisharp/README.md b/lua/astrocommunity/pack/cs-omnisharp/README.md new file mode 100644 index 000000000..c12c56dd5 --- /dev/null +++ b/lua/astrocommunity/pack/cs-omnisharp/README.md @@ -0,0 +1,12 @@ +# C# Language Pack + +**Requirements:** `dotnet` must be in your `PATH` and executable + +This plugin pack does the following: + +- Adds `c_sharp` Treesitter parsers +- Adds `omnisharp` language server +- Adds [`omnisharp-extended-lsp.nvim`](https://github.com/Hoffs/omnisharp-extended-lsp.nvim) for better go to definition/type definition +- Adds the following `null-ls` sources: + - [csharpier](https://github.com/belav/csharpier) +- Adds `coreclr` debug adapters for nvim-dap diff --git a/lua/astrocommunity/pack/cs-omnisharp/init.lua b/lua/astrocommunity/pack/cs-omnisharp/init.lua new file mode 100644 index 000000000..347b24586 --- /dev/null +++ b/lua/astrocommunity/pack/cs-omnisharp/init.lua @@ -0,0 +1,74 @@ +return { + -- CSharp support + { + "nvim-treesitter/nvim-treesitter", + optional = true, + opts = function(_, opts) + if opts.ensure_installed ~= "all" then + opts.ensure_installed = require("astrocore").list_insert_unique(opts.ensure_installed, { "c_sharp" }) + end + end, + }, + { + "jay-babu/mason-null-ls.nvim", + optional = true, + opts = function(_, opts) + opts.ensure_installed = require("astrocore").list_insert_unique(opts.ensure_installed, { "csharpier" }) + end, + }, + { + "williamboman/mason-lspconfig.nvim", + optional = true, + opts = function(_, opts) + opts.ensure_installed = require("astrocore").list_insert_unique(opts.ensure_installed, { "omnisharp" }) + end, + }, + { + "Hoffs/omnisharp-extended-lsp.nvim", + dependencies = { + { + "AstroNvim/astrolsp", + opts = { + config = { + csharp_ls = { + handlers = { + ["textDocument/definition"] = function(...) require("omnisharp_extended").definition_handler(...) end, + ["textDocument/typeDefinition"] = function(...) + require("omnisharp_extended").type_definition_handler(...) + end, + ["textDocument/references"] = function(...) require("omnisharp_extended").references_handler(...) end, + ["textDocument/implementation"] = function(...) + require("omnisharp_extended").implementation_handler(...) + end, + }, + }, + }, + }, + }, + }, + }, + { + "jay-babu/mason-nvim-dap.nvim", + optional = true, + opts = function(_, opts) + opts.ensure_installed = require("astrocore").list_insert_unique(opts.ensure_installed, { "coreclr" }) + end, + }, + { + "WhoIsSethDaniel/mason-tool-installer.nvim", + optional = true, + opts = function(_, opts) + opts.ensure_installed = + require("astrocore").list_insert_unique(opts.ensure_installed, { "omnisharp", "csharpier", "netcoredbg" }) + end, + }, + { + "nvim-neotest/neotest", + optional = true, + dependencies = { "Issafalcon/neotest-dotnet", config = function() end }, + opts = function(_, opts) + if not opts.adapters then opts.adapters = {} end + table.insert(opts.adapters, require "neotest-dotnet"(require("astrocore").plugin_opts "neotest-dotnet")) + end, + }, +}