aboutsummaryrefslogtreecommitdiffstats
path: root/lua/nvim-lsp-installer/servers/scry/init.lua
blob: 43a2ccd68075902c7ce48c465dc8bfa7e2f372cf (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
28
29
30
31
local server = require "nvim-lsp-installer.server"
local process = require "nvim-lsp-installer.process"
local path = require "nvim-lsp-installer.path"
local std = require "nvim-lsp-installer.core.managers.std"
local git = require "nvim-lsp-installer.core.managers.git"

return function(name, root_dir)
    return server.Server:new {
        name = name,
        root_dir = root_dir,
        languages = { "crystal" },
        homepage = "https://github.com/crystal-lang-tools/scry",
        async = true,
        ---@param ctx InstallContext
        installer = function(ctx)
            std.ensure_executable("crystal", {
                help_url = "https://crystal-lang.org/install/",
            })
            std.ensure_executable("shards", {
                help_url = "https://crystal-lang.org/install/",
            })
            git.clone({ "https://github.com/crystal-lang-tools/scry.git" }).with_receipt()
            ctx.spawn.shards { "build", "--verbose", "--release" }
        end,
        default_options = {
            cmd_env = {
                PATH = process.extend_path { path.concat { root_dir, "bin" } },
            },
        },
    }
end