williamboman / nvim-lsp-installer

Further development has moved to https://github.com/williamboman/mason.nvim!
https://github.com/williamboman/mason.nvim
Apache License 2.0
2k stars 123 forks source link

[New Server] Psalm #422

Closed JSteitz closed 2 years ago

JSteitz commented 2 years ago

Which server would you like to request to be added?

Which languages does this server target?

How is this server distributed?

Sorry for not creating a pull request, I just needed the server just now. The code would be:

-- init.lua
local installers = require "nvim-lsp-installer.installers"
local path = require "nvim-lsp-installer.path"
local server = require "nvim-lsp-installer.server"
local composer = require "nvim-lsp-installer.installers.composer"
local std = require "nvim-lsp-installer.installers.std"
local context = require "nvim-lsp-installer.installers.context"
local process = require "nvim-lsp-installer.process"

return function(name, root_dir)
    return server.Server:new {
        name = name,
        root_dir = root_dir,
        homepage = "https://psalm.dev/",
        languages = { "php" },
        installer = installers.when {
            unix = {
                std.git_clone "https://github.com/vimeo/psalm.git",
                composer.install(),
                context.receipt(function(receipt)
                    receipt:with_primary_source(receipt.git_remote "https://github.com/vimeo/psalm.git")
                end),
            },
        },
        default_options = {
            cmd_env = {
                PATH = process.extend_path { path.concat { root_dir, "bin" } },
            },
        },
    }
end
github-actions[bot] commented 2 years ago

Hello! Cool! Pull requests are always very welcomed to add new servers. If the distribution of the server is simple, the installation will most likely be so as well (existing server installers may be used for reference!). Otherwise, @williamboman will get around to looking into this ASAP!

JSteitz commented 2 years ago

PR created.