diff options
| author | hateonion <ouyang_yingjie@outlook.com> | 2022-05-01 21:45:39 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-05-01 15:45:39 +0200 |
| commit | f55a98082e77c1991f35f6f78d319752c3c92425 (patch) | |
| tree | c8c989154b281a53d3ff53f40c03e703d65e972f /lua/nvim-lsp-installer | |
| parent | feat(receipt): add "github_release" type (#650) (diff) | |
| download | mason-f55a98082e77c1991f35f6f78d319752c3c92425.tar mason-f55a98082e77c1991f35f6f78d319752c3c92425.tar.gz mason-f55a98082e77c1991f35f6f78d319752c3c92425.tar.bz2 mason-f55a98082e77c1991f35f6f78d319752c3c92425.tar.lz mason-f55a98082e77c1991f35f6f78d319752c3c92425.tar.xz mason-f55a98082e77c1991f35f6f78d319752c3c92425.tar.zst mason-f55a98082e77c1991f35f6f78d319752c3c92425.zip | |
fix!(beancount-language-server):update beancount install source (#649)
Diffstat (limited to 'lua/nvim-lsp-installer')
| -rw-r--r-- | lua/nvim-lsp-installer/servers/beancount/init.lua | 35 |
1 files changed, 3 insertions, 32 deletions
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 |
