aboutsummaryrefslogtreecommitdiffstats
path: root/lua/nvim-lsp-installer/servers/phpactor/init.lua
blob: af5d863cacba25dceb72ec141f6a2e5b5cd73b02 (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
local path = require "nvim-lsp-installer.path"
local server = require "nvim-lsp-installer.server"
local composer = require "nvim-lsp-installer.core.managers.composer"
local git = require "nvim-lsp-installer.core.managers.git"
local installer = require "nvim-lsp-installer.core.installer"
local process = require "nvim-lsp-installer.process"
local platform = require "nvim-lsp-installer.platform"

return function(name, root_dir)
    return server.Server:new {
        name = name,
        root_dir = root_dir,
        homepage = "https://phpactor.readthedocs.io/en/master/",
        languages = { "php" },
        async = true,
        installer = installer.serial {
            function()
                assert(platform.is_unix, "Phpactor only supports UNIX environments.")
            end,
            git.clone { "https://github.com/phpactor/phpactor.git" },
            composer.install(),
        },
        default_options = {
            cmd_env = {
                PATH = process.extend_path { path.concat { root_dir, "bin" } },
            },
        },
    }
end