You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

26 lines
648 B

local lsp_installer_servers = require "nvim-lsp-installer.servers"
local utils = require "utils"
local M = {}
function M.setup(servers, options)
for server_name, _ in pairs(servers) do
local server_available, server = lsp_installer_servers.get_server(server_name)
if server_available then
server:on_ready(function()
local opts = vim.tbl_deep_extend("force", options, servers[server.name] or {})
server:setup(opts)
end)
if not server:is_installed() then
utils.info("Installing " .. server.name)
server:install()
end
else
utils.error(server)
end
end
end
return M