aboutsummaryrefslogtreecommitdiffstats
path: root/lua/nvim-lsp-installer/servers/omnisharp/init.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua/nvim-lsp-installer/servers/omnisharp/init.lua')
-rw-r--r--lua/nvim-lsp-installer/servers/omnisharp/init.lua76
1 files changed, 36 insertions, 40 deletions
diff --git a/lua/nvim-lsp-installer/servers/omnisharp/init.lua b/lua/nvim-lsp-installer/servers/omnisharp/init.lua
index 19960003..f45df354 100644
--- a/lua/nvim-lsp-installer/servers/omnisharp/init.lua
+++ b/lua/nvim-lsp-installer/servers/omnisharp/init.lua
@@ -2,8 +2,8 @@ local server = require "nvim-lsp-installer.server"
local platform = require "nvim-lsp-installer.platform"
local path = require "nvim-lsp-installer.path"
local Data = require "nvim-lsp-installer.data"
-local std = require "nvim-lsp-installer.installers.std"
-local context = require "nvim-lsp-installer.installers.context"
+local github = require "nvim-lsp-installer.core.managers.github"
+local std = require "nvim-lsp-installer.core.managers.std"
local coalesce, when = Data.coalesce, Data.when
@@ -13,46 +13,42 @@ return function(name, root_dir)
root_dir = root_dir,
homepage = "https://github.com/OmniSharp/omnisharp-roslyn",
languages = { "c#" },
- installer = {
- std.ensure_executables {
- {
- "dotnet",
- "dotnet was not found in path. Refer to https://dotnet.microsoft.com/download for installation instructions.",
- },
- },
- context.use_github_release_file(
- "OmniSharp/omnisharp-roslyn",
- coalesce(
- when(
- platform.is_mac,
- coalesce(
- when(platform.arch == "x64", "omnisharp-osx-x64-net6.0.zip"),
- when(platform.arch == "arm64", "omnisharp-osx-arm64-net6.0.zip")
- )
- ),
- when(
- platform.is_linux,
- coalesce(
- when(platform.arch == "x64", "omnisharp-linux-x64-net6.0.zip"),
- when(platform.arch == "arm64", "omnisharp-linux-arm64-net6.0.zip")
+ async = true,
+ ---@param ctx InstallContext
+ installer = function(ctx)
+ std.ensure_executable("dotnet", { help_url = "https://dotnet.microsoft.com/download" })
+
+ -- We write to the omnisharp directory for backwards compatibility reasons
+ ctx.fs:mkdir "omnisharp"
+ ctx:chdir("omnisharp", function()
+ github.unzip_release_file({
+ repo = "OmniSharp/omnisharp-roslyn",
+ asset_file = coalesce(
+ when(
+ platform.is_mac,
+ coalesce(
+ when(platform.arch == "x64", "omnisharp-osx-x64-net6.0.zip"),
+ when(platform.arch == "arm64", "omnisharp-osx-arm64-net6.0.zip")
+ )
+ ),
+ when(
+ platform.is_linux,
+ coalesce(
+ when(platform.arch == "x64", "omnisharp-linux-x64-net6.0.zip"),
+ when(platform.arch == "arm64", "omnisharp-linux-arm64-net6.0.zip")
+ )
+ ),
+ when(
+ platform.is_win,
+ coalesce(
+ when(platform.arch == "x64", "omnisharp-win-x64-net6.0.zip"),
+ when(platform.arch == "arm64", "omnisharp-win-arm64-net6.0.zip")
+ )
)
),
- when(
- platform.is_win,
- coalesce(
- when(platform.arch == "x64", "omnisharp-win-x64-net6.0.zip"),
- when(platform.arch == "arm64", "omnisharp-win-arm64-net6.0.zip")
- )
- )
- )
- ),
- context.capture(function(ctx)
- return std.unzip_remote(ctx.github_release_file, "omnisharp")
- end),
- context.receipt(function(receipt, ctx)
- receipt:with_primary_source(receipt.github_release_file(ctx))
- end),
- },
+ }).with_receipt()
+ end)
+ end,
default_options = {
cmd = {
"dotnet",