From 1a7ab4cdb001895e793a49306d9c0e4f8e792261 Mon Sep 17 00:00:00 2001 From: William Boman Date: Tue, 5 Apr 2022 22:01:34 +0200 Subject: fix(taplo): use crate distribution (#576) --- lua/nvim-lsp-installer/servers/taplo/init.lua | 38 +++------------------------ 1 file changed, 3 insertions(+), 35 deletions(-) diff --git a/lua/nvim-lsp-installer/servers/taplo/init.lua b/lua/nvim-lsp-installer/servers/taplo/init.lua index 163a3b5a..94ddcc62 100644 --- a/lua/nvim-lsp-installer/servers/taplo/init.lua +++ b/lua/nvim-lsp-installer/servers/taplo/init.lua @@ -1,12 +1,5 @@ local server = require "nvim-lsp-installer.server" -local context = require "nvim-lsp-installer.installers.context" -local platform = require "nvim-lsp-installer.platform" -local installers = require "nvim-lsp-installer.installers" -local Data = require "nvim-lsp-installer.data" -local std = require "nvim-lsp-installer.installers.std" -local process = require "nvim-lsp-installer.process" - -local coalesce, when = Data.coalesce, Data.when +local cargo = require "nvim-lsp-installer.installers.cargo" return function(name, root_dir) return server.Server:new { @@ -14,34 +7,9 @@ return function(name, root_dir) root_dir = root_dir, languages = { "toml" }, homepage = "https://taplo.tamasfe.dev/lsp/", - installer = { - context.use_github_release_file( - "tamasfe/taplo", - coalesce( - when(platform.is_mac, "taplo-lsp-x86_64-apple-darwin-gnu.tar.gz"), - when(platform.is_linux and platform.arch == "x64", "taplo-lsp-x86_64-unknown-linux-gnu.tar.gz"), - when(platform.is_win and platform.arch == "x64", "taplo-lsp-windows-x86_64.zip") - ), - { - tag_name_pattern = "^release%-lsp%-", - } - ), - context.capture(function(ctx) - return installers.when { - unix = std.untargz_remote(ctx.github_release_file), - win = std.unzip_remote(ctx.github_release_file), - } - end), - context.receipt(function(receipt, ctx) - receipt:with_primary_source(receipt.github_release_file(ctx, { - tag_name_pattern = "^release%-lsp%-", - })) - end), - }, + installer = cargo.crate "taplo-cli", default_options = { - cmd_env = { - PATH = process.extend_path { root_dir }, - }, + cmd_env = cargo.env(root_dir), }, } end -- cgit v1.2.3-70-g09d2