aboutsummaryrefslogtreecommitdiffstats
path: root/lua/nvim-lsp-installer/servers/texlab/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/texlab/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/texlab/init.lua')
-rw-r--r--lua/nvim-lsp-installer/servers/texlab/init.lua21
1 files changed, 12 insertions, 9 deletions
diff --git a/lua/nvim-lsp-installer/servers/texlab/init.lua b/lua/nvim-lsp-installer/servers/texlab/init.lua
index 47dfb09d..cbb17ea3 100644
--- a/lua/nvim-lsp-installer/servers/texlab/init.lua
+++ b/lua/nvim-lsp-installer/servers/texlab/init.lua
@@ -1,17 +1,10 @@
local server = require "nvim-lsp-installer.server"
local path = require "nvim-lsp-installer.path"
local std = require "nvim-lsp-installer.installers.std"
+local context = require "nvim-lsp-installer.installers.context"
local Data = require "nvim-lsp-installer.data"
local platform = require "nvim-lsp-installer.platform"
-local VERSION = "v3.2.0"
-
-local target = Data.coalesce(
- Data.when(platform.is_mac, "texlab-x86_64-macos.tar.gz"),
- Data.when(platform.is_linux, "texlab-x86_64-linux.tar.gz"),
- Data.when(platform.is_win, "texlab-x86_64-windows.tar.gz")
-)
-
return function(name, root_dir)
return server.Server:new {
name = name,
@@ -20,7 +13,17 @@ return function(name, root_dir)
std.ensure_executables {
{ "pdflatex", "A TeX distribution is not installed. Refer to https://www.latex-project.org/get/." },
},
- std.untargz_remote(("https://github.com/latex-lsp/texlab/releases/download/%s/%s"):format(VERSION, target)),
+ context.github_release_file(
+ "latex-lsp/texlab",
+ Data.coalesce(
+ Data.when(platform.is_mac, "texlab-x86_64-macos.tar.gz"),
+ Data.when(platform.is_linux, "texlab-x86_64-linux.tar.gz"),
+ Data.when(platform.is_win, "texlab-x86_64-windows.tar.gz")
+ )
+ ),
+ context.capture(function(ctx)
+ return std.untargz_remote(ctx.github_release_file)
+ end),
},
default_options = {
cmd = { path.concat { root_dir, "texlab" } },