aboutsummaryrefslogtreecommitdiffstats
path: root/lua/nvim-lsp-installer/servers/rust_analyzer/init.lua
diff options
context:
space:
mode:
authorWilliam Boman <william@redwill.se>2021-09-29 13:48:39 +0200
committerGitHub <noreply@github.com>2021-09-29 13:48:39 +0200
commite267fe517feaaf7a48323349e3775944db49c158 (patch)
tree1c9d869d71c32b0d3b2f9304d9433dbb4ced9903 /lua/nvim-lsp-installer/servers/rust_analyzer/init.lua
parentfix stylua (#104) (diff)
downloadmason-e267fe517feaaf7a48323349e3775944db49c158.tar
mason-e267fe517feaaf7a48323349e3775944db49c158.tar.gz
mason-e267fe517feaaf7a48323349e3775944db49c158.tar.bz2
mason-e267fe517feaaf7a48323349e3775944db49c158.tar.lz
mason-e267fe517feaaf7a48323349e3775944db49c158.tar.xz
mason-e267fe517feaaf7a48323349e3775944db49c158.tar.zst
mason-e267fe517feaaf7a48323349e3775944db49c158.zip
support installing specific version of language servers, defaults to latest (#106)
Diffstat (limited to 'lua/nvim-lsp-installer/servers/rust_analyzer/init.lua')
-rw-r--r--lua/nvim-lsp-installer/servers/rust_analyzer/init.lua14
1 files changed, 8 insertions, 6 deletions
diff --git a/lua/nvim-lsp-installer/servers/rust_analyzer/init.lua b/lua/nvim-lsp-installer/servers/rust_analyzer/init.lua
index 8fe0c740..c81e37b1 100644
--- a/lua/nvim-lsp-installer/servers/rust_analyzer/init.lua
+++ b/lua/nvim-lsp-installer/servers/rust_analyzer/init.lua
@@ -2,10 +2,9 @@ local server = require "nvim-lsp-installer.server"
local path = require "nvim-lsp-installer.path"
local platform = require "nvim-lsp-installer.platform"
local std = require "nvim-lsp-installer.installers.std"
+local context = require "nvim-lsp-installer.installers.context"
local Data = require "nvim-lsp-installer.data"
-local VERSION = "2021-06-28"
-
local target = Data.coalesce(
Data.when(
platform.is_mac,
@@ -35,10 +34,13 @@ return function(name, root_dir)
name = name,
root_dir = root_dir,
installer = {
- std.gunzip_remote(
- ("https://github.com/rust-analyzer/rust-analyzer/releases/download/%s/%s"):format(VERSION, target),
- platform.is_win and "rust-analyzer.exe" or "rust-analyzer"
- ),
+ context.github_release_file("rust-analyzer/rust-analyzer", target),
+ context.capture(function(ctx)
+ return std.gunzip_remote(
+ ctx.github_release_file,
+ platform.is_win and "rust-analyzer.exe" or "rust-analyzer"
+ )
+ end),
std.chmod("+x", { "rust-analyzer" }),
},
default_options = {