From 91f4c57101d12cfdd9133f5aafe6c36e1eee4026 Mon Sep 17 00:00:00 2001 From: Ben Woodward Date: Sun, 25 Jun 2023 13:26:16 +0100 Subject: [PATCH] feat(pack): add c-sharp base pack (#312) --- lua/astrocommunity/pack/cs/README.md | 11 +++++++++++ lua/astrocommunity/pack/cs/init.lua | 27 +++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 lua/astrocommunity/pack/cs/README.md create mode 100644 lua/astrocommunity/pack/cs/init.lua diff --git a/lua/astrocommunity/pack/cs/README.md b/lua/astrocommunity/pack/cs/README.md new file mode 100644 index 000000000..ba71cac4d --- /dev/null +++ b/lua/astrocommunity/pack/cs/README.md @@ -0,0 +1,11 @@ +# C# Language Pack + +**Requirements:** `dotnet` must be in your `PATH` and executable + +This plugin pack does the following: + +- Adds `c_sharp` Treesitter parsers +- Adds `csharp_ls` language server +- 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/init.lua b/lua/astrocommunity/pack/cs/init.lua new file mode 100644 index 000000000..ea7149872 --- /dev/null +++ b/lua/astrocommunity/pack/cs/init.lua @@ -0,0 +1,27 @@ +local utils = require "astronvim.utils" +return { + -- CSharp support + { + "nvim-treesitter/nvim-treesitter", + opts = function(_, opts) + if opts.ensure_installed ~= "all" then + opts.ensure_installed = utils.list_insert_unique(opts.ensure_installed, "c_sharp") + end + end, + }, + { + "jay-babu/mason-null-ls.nvim", + opts = function(_, opts) opts.ensure_installed = utils.list_insert_unique(opts.ensure_installed, "csharpier") end, + }, + { + "williamboman/mason-lspconfig.nvim", + opts = function(_, opts) opts.ensure_installed = utils.list_insert_unique(opts.ensure_installed, "csharp_ls") end, + }, + { + "mfussenegger/nvim-dap", + { + "jay-babu/mason-nvim-dap.nvim", + opts = function(_, opts) opts.ensure_installed = utils.list_insert_unique(opts.ensure_installed, "coreclr") end, + }, + }, +}