diff options
Diffstat (limited to 'lua/nvim-lsp-installer/servers')
| -rw-r--r-- | lua/nvim-lsp-installer/servers/csharp_ls/init.lua | 41 | ||||
| -rw-r--r-- | lua/nvim-lsp-installer/servers/init.lua | 1 |
2 files changed, 42 insertions, 0 deletions
diff --git a/lua/nvim-lsp-installer/servers/csharp_ls/init.lua b/lua/nvim-lsp-installer/servers/csharp_ls/init.lua new file mode 100644 index 00000000..956689e6 --- /dev/null +++ b/lua/nvim-lsp-installer/servers/csharp_ls/init.lua @@ -0,0 +1,41 @@ +local server = require "nvim-lsp-installer.server" +local path = require "nvim-lsp-installer.path" +local process = require "nvim-lsp-installer.process" +local std = require "nvim-lsp-installer.installers.std" + +return function(name, root_dir) + return server.Server:new { + name = name, + root_dir = root_dir, + languages = { "c#" }, + homepage = "https://github.com/razzmatazz/csharp-language-server", + installer = { + std.ensure_executables { + { + "dotnet", + "dotnet was not found in path. Refer to https://dotnet.microsoft.com/download for installation instructions.", + }, + }, + ---@type ServerInstallerFunction + function(_, callback, ctx) + process.spawn("dotnet", { + args = { "tool", "update", "--tool-path", ".", "csharp-ls" }, + cwd = ctx.install_dir, + stdio_sink = ctx.stdio_sink, + }, function(success) + if not success then + ctx.stdio_sink.stderr "Failed to install csharp-ls.\n" + callback(false) + else + callback(true) + end + end) + end, + }, + default_options = { + cmd = { + path.concat { root_dir, "csharp-ls" }, + }, + }, + } +end diff --git a/lua/nvim-lsp-installer/servers/init.lua b/lua/nvim-lsp-installer/servers/init.lua index 376fa3c3..cb217573 100644 --- a/lua/nvim-lsp-installer/servers/init.lua +++ b/lua/nvim-lsp-installer/servers/init.lua @@ -39,6 +39,7 @@ local CORE_SERVERS = Data.set_of { "clojure_lsp", "cmake", "codeqlls", + "csharp_ls", "cssls", "dartls", "denols", |
