lsp: don't manually setup rust-analyzer. rust-tools already does
This commit is contained in:
parent
c661e05a2d
commit
a9c683440a
|
@ -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,17 +105,22 @@ return {
|
||||||
event = "BufEnter Cargo.toml",
|
event = "BufEnter Cargo.toml",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
opts = {
|
lazy = false,
|
||||||
server = {
|
config = function()
|
||||||
on_attach = function(_, bufnr)
|
local capabilities = require("cmp_nvim_lsp").default_capabilities();
|
||||||
local rt = require("rust-tools");
|
|
||||||
-- Hover actions
|
require("rust-tools").setup({
|
||||||
vim.keymap.set("n", "<C-space>", rt.hover_actions.hover_actions, { buffer = bufnr })
|
server = {
|
||||||
-- Code action groups
|
on_attach = function(_, bufnr)
|
||||||
vim.keymap.set("n", "<Leader>a", rt.code_action_group.code_action_group, { buffer = bufnr })
|
local rt = require("rust-tools");
|
||||||
end,
|
-- Hover actions
|
||||||
},
|
vim.keymap.set("n", "<C-space>", rt.hover_actions.hover_actions, { buffer = bufnr })
|
||||||
},
|
-- Code action groups
|
||||||
event = { "LspAttach *.rs" },
|
vim.keymap.set("n", "<Leader>a", rt.code_action_group.code_action_group, { buffer = bufnr })
|
||||||
|
end,
|
||||||
|
capabilities = capabilities,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
end,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue