lsp: use installed rust-analyzer instead of Mason

This commit is contained in:
Fabrice Mouhartem 2023-12-25 10:33:56 +01:00
parent 432fabeed0
commit e7334ea6e7

View File

@ -77,7 +77,7 @@ local servers = {
clangd = {},
-- gopls = {},
pyright = {},
rust_analyzer = {},
-- rust_analyzer = {},
tsserver = {},
-- html = { filetypes = { 'html', 'twig', 'hbs'} },
texlab = {},
@ -116,3 +116,35 @@ mason_lspconfig.setup_handlers {
}
end,
}
-- System LSPs
local lspconfig = require('lspconfig')
servers = {
rust_analyzer = {
["rust-analyzer"] = {
imports = {
granularity = {
group = "module",
},
prefix = "self",
},
cargo = {
buildScripts = {
enable = true,
},
},
procMacro = {
enable = true
},
}
},
}
for server_name, server_settings in pairs(servers) do
lspconfig[server_name].setup {
capabilities = capabilities,
on_attach = on_attach,
settings = server_settings,
}
end