aboutsummaryrefslogtreecommitdiffstats
path: root/lua/nvim-lsp-installer/servers/rescriptls/init.lua
blob: 4f0e78651825113fa1ff5c7ef0b45e7d7c5a0e8b (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
25
26
27
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"

return function(name, root_dir)
    return server.Server:new {
        name = name,
        root_dir = root_dir,
        languages = { "rescript" },
        homepage = "https://github.com/rescript-lang/rescript-vscode",
        installer = {
            context.use_github_release_file("rescript-lang/rescript-vscode", function(version)
                return ("rescript-vscode-%s.vsix"):format(version)
            end),
            context.capture(function(ctx)
                return std.unzip_remote(ctx.github_release_file)
            end),
            context.receipt(function(receipt, ctx)
                receipt:with_primary_source(receipt.github_release_file(ctx))
            end),
        },
        default_options = {
            cmd = { "node", path.concat { root_dir, "extension", "server", "out", "server.js" }, "--stdio" },
        },
    }
end