aboutsummaryrefslogtreecommitdiffstats
path: root/lua/nvim-lsp-installer/servers/ansiblels/init.lua
blob: 2f1546125ada568915bc458c6f5bcce073b7fd0a (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.installers.std"
local npm = require "nvim-lsp-installer.installers.npm"

return function(name, root_dir)
    return server.Server:new {
        name = name,
        root_dir = root_dir,
        languages = { "ansible" },
        homepage = "https://github.com/ansible/ansible-language-server",
        installer = {
            std.git_clone "https://github.com/ansible/ansible-language-server",
            npm.install { "npm@latest" }, -- ansiblels has quite a strict npm version requirement
            npm.exec("npm", { "install" }),
            npm.run "compile",
            npm.exec("npm", { "install", "--production" }),
        },
        default_options = {
            filetypes = { "yaml", "yaml.ansible" },
            cmd = { "node", path.concat { root_dir, "out", "server", "src", "server.js" }, "--stdio" },
        },
    }
end