Install some default lsp servers
This commit is contained in:
parent
836528db95
commit
4daa257f8d
@ -1,15 +1,35 @@
|
||||
local lsp_installer = require("nvim-lsp-installer")
|
||||
local async = require("plenary.async")
|
||||
|
||||
local required_servers = {
|
||||
"sumneko_lua",
|
||||
"rust_analyzer",
|
||||
"bashls",
|
||||
"eslint",
|
||||
"dockerls",
|
||||
"yamlls",
|
||||
}
|
||||
|
||||
for _, name in pairs(required_servers) do
|
||||
local server_is_found, server = lsp_installer.get_server(name)
|
||||
if server_is_found then
|
||||
if not server:is_installed() then
|
||||
async.run(function()
|
||||
vim.notify.async("Installing Language Server " .. name, "info", {
|
||||
title = "Lsp Installer",
|
||||
}
|
||||
)
|
||||
end)
|
||||
server:install()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
local function on_attach(client, bufnr)
|
||||
async.run(function()
|
||||
vim.notify.async(
|
||||
"Attached server " .. client.name,
|
||||
"info",
|
||||
{
|
||||
title = "lsp"
|
||||
}
|
||||
).close()
|
||||
vim.notify.async("Attached server " .. client.name, "info", {
|
||||
title = "Lsp Attach",
|
||||
}).close()
|
||||
end)
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user