lsp: don't manually setup rust-analyzer. rust-tools already does

This commit is contained in:
kalmenn 2023-12-30 12:17:59 +01:00
parent c661e05a2d
commit a9c683440a
Signed by: kalmenn
GPG key ID: F500055C44BC3834

View file

@ -41,10 +41,6 @@ return {
capabilities = capabilities, capabilities = capabilities,
}) })
lspconfig.rust_analyzer.setup({
capabilities = capabilities,
})
lspconfig.lua_ls.setup({ lspconfig.lua_ls.setup({
capabilities = capabilities, capabilities = capabilities,
settings = { settings = {
@ -109,7 +105,11 @@ return {
event = "BufEnter Cargo.toml", event = "BufEnter Cargo.toml",
}, },
}, },
opts = { lazy = false,
config = function()
local capabilities = require("cmp_nvim_lsp").default_capabilities();
require("rust-tools").setup({
server = { server = {
on_attach = function(_, bufnr) on_attach = function(_, bufnr)
local rt = require("rust-tools"); local rt = require("rust-tools");
@ -118,8 +118,9 @@ return {
-- Code action groups -- Code action groups
vim.keymap.set("n", "<Leader>a", rt.code_action_group.code_action_group, { buffer = bufnr }) vim.keymap.set("n", "<Leader>a", rt.code_action_group.code_action_group, { buffer = bufnr })
end, end,
capabilities = capabilities,
}, },
}, });
event = { "LspAttach *.rs" }, end,
} }
} }