-
-
Notifications
You must be signed in to change notification settings - Fork 250
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(pack): add csharp support with
omnisharp
(#1241)
feat(cs-omnisharp): add csharp support with omnisharp
- Loading branch information
Showing
2 changed files
with
86 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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, | ||
}, | ||
} |