aboutsummaryrefslogtreecommitdiffstats
path: root/lua/nvim-lsp-installer/servers/denols/init.lua
diff options
context:
space:
mode:
authorWilliam Boman <william@redwill.se>2022-04-21 12:09:59 +0200
committerGitHub <noreply@github.com>2022-04-21 12:09:59 +0200
commitb68fcc6bb2c770495ff8e2508c06dfdd49abcc80 (patch)
treedf7c71efb59958deb21a18eeccf3e3c43c4cd704 /lua/nvim-lsp-installer/servers/denols/init.lua
parentrun autogen_metadata.lua (diff)
downloadmason-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/denols/init.lua')
-rw-r--r--lua/nvim-lsp-installer/servers/denols/init.lua24
1 files changed, 9 insertions, 15 deletions
diff --git a/lua/nvim-lsp-installer/servers/denols/init.lua b/lua/nvim-lsp-installer/servers/denols/init.lua
index dfd0ab2a..37ae7e6d 100644
--- a/lua/nvim-lsp-installer/servers/denols/init.lua
+++ b/lua/nvim-lsp-installer/servers/denols/init.lua
@@ -2,8 +2,7 @@ local server = require "nvim-lsp-installer.server"
local process = require "nvim-lsp-installer.process"
local platform = require "nvim-lsp-installer.platform"
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 coalesce, when = Data.coalesce, Data.when
@@ -13,10 +12,11 @@ return function(name, root_dir)
root_dir = root_dir,
homepage = "https://deno.land/x/deno/cli/lsp",
languages = { "deno" },
- installer = {
- context.use_github_release_file(
- "denoland/deno",
- coalesce(
+ async = true,
+ installer = function()
+ github.unzip_release_file({
+ repo = "denoland/deno",
+ asset_file = coalesce(
when(
platform.is_mac,
coalesce(
@@ -26,15 +26,9 @@ return function(name, root_dir)
),
when(platform.is_linux, "deno-x86_64-unknown-linux-gnu.zip"),
when(platform.is_win, "deno-x86_64-pc-windows-msvc.zip")
- )
- ),
- context.capture(function(ctx)
- return std.unzip_remote(ctx.github_release_file)
- end),
- context.receipt(function(receipt, ctx)
- receipt:with_primary_source(receipt.github_release_file(ctx))
- end),
- },
+ ),
+ }).with_receipt()
+ end,
default_options = {
cmd_env = {
PATH = process.extend_path { root_dir },