aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Boman <william@redwill.se>2022-04-05 22:01:34 +0200
committerGitHub <noreply@github.com>2022-04-05 22:01:34 +0200
commit1a7ab4cdb001895e793a49306d9c0e4f8e792261 (patch)
tree235eb74329c3140309f884bd933883755f4340b0
parentrun autogen_metadata.lua (diff)
downloadmason-1a7ab4cdb001895e793a49306d9c0e4f8e792261.tar
mason-1a7ab4cdb001895e793a49306d9c0e4f8e792261.tar.gz
mason-1a7ab4cdb001895e793a49306d9c0e4f8e792261.tar.bz2
mason-1a7ab4cdb001895e793a49306d9c0e4f8e792261.tar.lz
mason-1a7ab4cdb001895e793a49306d9c0e4f8e792261.tar.xz
mason-1a7ab4cdb001895e793a49306d9c0e4f8e792261.tar.zst
mason-1a7ab4cdb001895e793a49306d9c0e4f8e792261.zip
fix(taplo): use crate distribution (#576)
-rw-r--r--lua/nvim-lsp-installer/servers/taplo/init.lua38
1 files 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