aboutsummaryrefslogtreecommitdiffstats
path: root/lua/nvim-lsp-installer/servers/haxe_language_server/init.lua
blob: 394aa85e39128606f5a4141a5bbc8ca4cd8084d0 (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 path = require "nvim-lsp-installer.path"
local std = require "nvim-lsp-installer.core.managers.std"
local git = require "nvim-lsp-installer.core.managers.git"
local npm = require "nvim-lsp-installer.core.managers.npm"

return function(name, root_dir)
    return server.Server:new {
        name = name,
        root_dir = root_dir,
        homepage = "https://github.com/vshaxe/haxe-language-server",
        languages = { "haxe" },
        ---@param ctx InstallContext
        installer = function(ctx)
            std.ensure_executable("haxelib", { help_url = "https://haxe.org" })
            git.clone({ "https://github.com/vshaxe/haxe-language-server" }).with_receipt()
            ctx.spawn.npm { "install" }
            npm.exec { "lix", "run", "vshaxe-build", "-t", "language-server" }
        end,
        default_options = {
            cmd = { "node", path.concat { root_dir, "bin", "server.js" } },
        },
    }
end