aboutsummaryrefslogtreecommitdiffstats
path: root/lua/nvim-lsp-installer/servers/csharp_ls
diff options
context:
space:
mode:
authorAccess <3237126351@qq.com>2021-11-29 17:51:23 +0800
committerGitHub <noreply@github.com>2021-11-29 10:51:23 +0100
commitcf08ebc74aa4546b51f11fd0d8a0f8fa5721f021 (patch)
treed24299d5018fdfd241a9e9cd91dd517aa7da9e9e /lua/nvim-lsp-installer/servers/csharp_ls
parentfix(fsharp): update cmd (#290) (diff)
downloadmason-cf08ebc74aa4546b51f11fd0d8a0f8fa5721f021.tar
mason-cf08ebc74aa4546b51f11fd0d8a0f8fa5721f021.tar.gz
mason-cf08ebc74aa4546b51f11fd0d8a0f8fa5721f021.tar.bz2
mason-cf08ebc74aa4546b51f11fd0d8a0f8fa5721f021.tar.lz
mason-cf08ebc74aa4546b51f11fd0d8a0f8fa5721f021.tar.xz
mason-cf08ebc74aa4546b51f11fd0d8a0f8fa5721f021.tar.zst
mason-cf08ebc74aa4546b51f11fd0d8a0f8fa5721f021.zip
add csharpls (#294)
Resolves #291.
Diffstat (limited to 'lua/nvim-lsp-installer/servers/csharp_ls')
-rw-r--r--lua/nvim-lsp-installer/servers/csharp_ls/init.lua41
1 files changed, 41 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