From b68fcc6bb2c770495ff8e2508c06dfdd49abcc80 Mon Sep 17 00:00:00 2001 From: William Boman Date: Thu, 21 Apr 2022 12:09:59 +0200 Subject: chore: refactor remaining installers to async impl (#616) --- .../servers/kotlin_language_server/init.lua | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'lua/nvim-lsp-installer/servers/kotlin_language_server/init.lua') diff --git a/lua/nvim-lsp-installer/servers/kotlin_language_server/init.lua b/lua/nvim-lsp-installer/servers/kotlin_language_server/init.lua index 4909b56d..a8330fca 100644 --- a/lua/nvim-lsp-installer/servers/kotlin_language_server/init.lua +++ b/lua/nvim-lsp-installer/servers/kotlin_language_server/init.lua @@ -1,8 +1,7 @@ local server = require "nvim-lsp-installer.server" local process = require "nvim-lsp-installer.process" local path = require "nvim-lsp-installer.path" -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" return function(name, root_dir) return server.Server:new { @@ -10,15 +9,13 @@ return function(name, root_dir) root_dir = root_dir, homepage = "https://github.com/fwcd/kotlin-language-server", languages = { "kotlin" }, - installer = { - context.use_github_release_file("fwcd/kotlin-language-server", "server.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), - }, + async = true, + installer = function() + github.unzip_release_file({ + repo = "fwcd/kotlin-language-server", + asset_file = "server.zip", + }).with_receipt() + end, default_options = { cmd_env = { PATH = process.extend_path { -- cgit v1.2.3-70-g09d2