42 lines
894 B
Lua
42 lines
894 B
Lua
local status_ok, _ = pcall(require, "lspconfig")
|
|
if not status_ok then
|
|
return
|
|
end
|
|
|
|
require("mason").setup({
|
|
ui = {
|
|
icons = {
|
|
package_installed = "✓",
|
|
package_pending = "➜",
|
|
package_uninstalled = "✗",
|
|
},
|
|
},
|
|
})
|
|
|
|
require("mason-lspconfig").setup({
|
|
ensure_installed = {
|
|
"cssls", -- css
|
|
"html", -- html
|
|
"clangd", -- cpp / c
|
|
"tsserver", -- python
|
|
"sumneko_lua", -- lua
|
|
"pyright", -- python
|
|
"rust_analyzer", -- rust
|
|
"cmake", -- cmake
|
|
"bashls", -- shell
|
|
"ansiblels", -- ansible
|
|
"marksman",
|
|
},
|
|
automatic_installation = true,
|
|
})
|
|
|
|
local capabilities = require("cmp_nvim_lsp").default_capabilities(vim.lsp.protocol.make_client_capabilities())
|
|
|
|
require("mason-lspconfig").setup_handlers({
|
|
function(server_name) -- default handler (optional)
|
|
require("lspconfig")[server_name].setup({
|
|
capabilities = capabilities,
|
|
on_attach = on_attach,
|
|
})
|
|
end,
|
|
})
|