From f55a98082e77c1991f35f6f78d319752c3c92425 Mon Sep 17 00:00:00 2001 From: hateonion Date: Sun, 1 May 2022 21:45:39 +0800 Subject: fix!(beancount-language-server):update beancount install source (#649) --- lua/nvim-lsp-installer/servers/beancount/init.lua | 35 ++--------------------- 1 file changed, 3 insertions(+), 32 deletions(-) (limited to 'lua') diff --git a/lua/nvim-lsp-installer/servers/beancount/init.lua b/lua/nvim-lsp-installer/servers/beancount/init.lua index e857e44b..fdadbb5d 100644 --- a/lua/nvim-lsp-installer/servers/beancount/init.lua +++ b/lua/nvim-lsp-installer/servers/beancount/init.lua @@ -1,11 +1,5 @@ local server = require "nvim-lsp-installer.server" -local github = require "nvim-lsp-installer.core.managers.github" -local pip3 = require "nvim-lsp-installer.core.managers.pip3" -local Data = require "nvim-lsp-installer.data" -local platform = require "nvim-lsp-installer.platform" -local process = require "nvim-lsp-installer.process" - -local coalesce, when = Data.coalesce, Data.when +local cargo = require "nvim-lsp-installer.core.managers.cargo" return function(name, root_dir) return server.Server:new { @@ -14,32 +8,9 @@ return function(name, root_dir) languages = { "beancount" }, homepage = "https://github.com/polarmutex/beancount-language-server", async = true, - ---@param ctx InstallContext - installer = function(ctx) - local asset_file = assert( - coalesce( - when(platform.is_mac, "beancount-language-server-macos-x64.zip"), - when(platform.is_linux and platform.arch == "x64", "beancount-language-server-linux-x64.zip"), - when(platform.is_win and platform.arch == "x64", "beancount-language-server-windows-x64.zip") - ), - "Unsupported platform" - ) - github.unzip_release_file({ - repo = "polarmutex/beancount-language-server", - asset_file = asset_file, - }).with_receipt() - - local file_ext = platform.is_win and ".exe" or "" - -- We rename the binary to conform with lspconfig - ctx.fs:rename(("beancount-language-server%s"):format(file_ext), ("beancount-langserver%s"):format(file_ext)) - - pip3.install { "beancount" } - ctx.receipt:with_secondary_source(ctx.receipt.pip3 "beancount") - end, + installer = cargo.crate "beancount-language-server", default_options = { - cmd_env = { - PATH = process.extend_path { root_dir, pip3.venv_path(root_dir) }, - }, + cmd_env = cargo.env(root_dir), }, } end -- cgit v1.2.3-70-g09d2