switch to mason

This commit is contained in:
Jidbo 2023-02-23 15:26:09 +01:00 committed by saibotk
parent f9a922636d
commit 48fade5749
Signed by: saibotk
GPG key ID: 67585F0065E261D5

View file

@ -63,19 +63,27 @@ local on_attach = function(client, bufnr)
end end
-- LSP INSTALLER -- LSP INSTALLER
local lsp_installer = require "nvim-lsp-installer" require("mason").setup()
lsp_installer.setup { require("mason-lspconfig").setup()
automatic_installation = false,
}
local lspconfig = require "lspconfig"
for _, server in ipairs(lsp_installer.get_installed_servers()) do require("mason-lspconfig").setup_handlers {
lspconfig[server.name].setup { -- The first entry (without a key) will be the default handler
-- and will be called for each installed server that doesn't have
-- a dedicated handler.
function (server_name) -- default handler (optional)
require("lspconfig")[server_name].setup {
on_attach = on_attach, on_attach = on_attach,
capabilities = require("cmp_nvim_lsp").update_capabilities(vim.lsp.protocol.make_client_capabilities()) capabilities = require("cmp_nvim_lsp").default_capabilities(vim.lsp.protocol.make_client_capabilities())
} }
end,
-- Next, you can provide a dedicated handler for specific servers.
-- For example, a handler override for the `rust_analyzer`:
["rust_analyzer"] = function ()
require("rust-tools").setup {}
end end
}
-- EXTRA SETUP -- EXTRA SETUP
require'lspconfig'.lua_ls.setup { require'lspconfig'.lua_ls.setup {
@ -101,6 +109,7 @@ require'lspconfig'.lua_ls.setup {
}, },
} }
-- LSP SIGNATURE -- LSP SIGNATURE
require "lsp_signature".setup { require "lsp_signature".setup {
handler_opts = { handler_opts = {