diff options
| author | William Boman <william@redwill.se> | 2022-04-21 12:09:59 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-04-21 12:09:59 +0200 |
| commit | b68fcc6bb2c770495ff8e2508c06dfdd49abcc80 (patch) | |
| tree | df7c71efb59958deb21a18eeccf3e3c43c4cd704 /lua/nvim-lsp-installer/servers/bicep/init.lua | |
| parent | run autogen_metadata.lua (diff) | |
| download | mason-b68fcc6bb2c770495ff8e2508c06dfdd49abcc80.tar mason-b68fcc6bb2c770495ff8e2508c06dfdd49abcc80.tar.gz mason-b68fcc6bb2c770495ff8e2508c06dfdd49abcc80.tar.bz2 mason-b68fcc6bb2c770495ff8e2508c06dfdd49abcc80.tar.lz mason-b68fcc6bb2c770495ff8e2508c06dfdd49abcc80.tar.xz mason-b68fcc6bb2c770495ff8e2508c06dfdd49abcc80.tar.zst mason-b68fcc6bb2c770495ff8e2508c06dfdd49abcc80.zip | |
chore: refactor remaining installers to async impl (#616)
Diffstat (limited to 'lua/nvim-lsp-installer/servers/bicep/init.lua')
| -rw-r--r-- | lua/nvim-lsp-installer/servers/bicep/init.lua | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/lua/nvim-lsp-installer/servers/bicep/init.lua b/lua/nvim-lsp-installer/servers/bicep/init.lua index 89770999..6f5f7064 100644 --- a/lua/nvim-lsp-installer/servers/bicep/init.lua +++ b/lua/nvim-lsp-installer/servers/bicep/init.lua @@ -1,7 +1,7 @@ local server = require "nvim-lsp-installer.server" local path = require "nvim-lsp-installer.path" -local std = require "nvim-lsp-installer.installers.std" -local context = require "nvim-lsp-installer.installers.context" +local std = require "nvim-lsp-installer.core.managers.std" +local github = require "nvim-lsp-installer.core.managers.github" return function(name, root_dir) return server.Server:new { @@ -9,23 +9,23 @@ return function(name, root_dir) root_dir = root_dir, languages = { "bicep" }, homepage = "https://github.com/Azure/bicep", - installer = { - std.ensure_executables { - { "dotnet", "dotnet is required to run the bicep language server." }, - }, - -- The bicep-langserver.zip is a bit broken on POSIX systems - so we download it via the VSCode distribution - -- instead. See https://github.com/Azure/bicep/issues/3704. - context.use_github_release_file("Azure/bicep", "vscode-bicep.vsix"), - context.capture(function(ctx) - return std.unzip_remote(ctx.github_release_file, "vscode") - end), - std.rename(path.concat { "vscode", "extension", "bicepLanguageServer" }, "langserver"), - std.rmrf "vscode", - context.set_working_dir "langserver", - context.receipt(function(receipt, ctx) - receipt:with_primary_source(receipt.github_release_file(ctx)) - end), - }, + async = true, + ---@param ctx InstallContext + installer = function(ctx) + std.ensure_executable("dotnet", { help_url = "https://dotnet.microsoft.com/download" }) + ctx.fs:mkdir "vscode" + ctx:chdir("vscode", function() + -- The bicep-langserver.zip is a bit broken on POSIX systems - so we download it via the VSCode distribution + -- instead. See https://github.com/Azure/bicep/issues/3704. + github.unzip_release_file({ + repo = "Azure/bicep", + asset_file = "vscode-bicep.vsix", + }).with_receipt() + end) + ctx.fs:rename(path.concat { "vscode", "extension", "bicepLanguageServer" }, "langserver") + ctx.fs:rmrf "vscode" + ctx:chdir "langserver" + end, default_options = { cmd = { "dotnet", path.concat { root_dir, "Bicep.LangServer.dll" } }, }, |
