aboutsummaryrefslogtreecommitdiffstats
path: root/lua/nvim-lsp-installer/servers/texlab/init.lua
blob: c669806b0a02e50220d2d7bc5eefaae0eb2bf8b5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
local server = require "nvim-lsp-installer.server"
local installers = require "nvim-lsp-installer.installers"
local path = require "nvim-lsp-installer.path"
local zx = require "nvim-lsp-installer.installers.zx"

local root_dir = server.get_server_root_path "latex"

return server.Server:new {
    name = "texlab",
    root_dir = root_dir,
    installer = installers.when {
        unix = zx.file "./install.mjs",
    },
    pre_install_check = function()
        if vim.fn.executable "wget" ~= 1 then
            error "Missing wget. Please, refer to https://www.gnu.org/software/wget/ to install it."
        elseif vim.fn.executable "pdflatex" ~= 1 then
            error "The program pdflatex wasn't found. Please install a TeX distribution: https://www.latex-project.org/get/#tex-distributions"
        end
    end,
    default_options = {
        cmd = { path.concat { root_dir, "texlab" } },
    },
}