Hai, I’ve tried to setup rust analyzer using the rust tools plugin. It works fine for the most part, only I don’t get the clippy warnings. I get other warnings, for example missing a semicolon, but if I have an unused variable for example it won’t say anything.
This is currently how I have rust tools setup:
local rt = require("rust-tools")
rt.setup({
server = {
on_attach = function(_, bufnr)
vim.keymap.set("n", "K", rt.hover_actions.hover_actions, { buffer = bufnr })
vim.keymap.set("n", "<leader>ca", rt.code_action_group.code_action_group, { buffer = bufnr })
end,
settings = {
["rust_analyzer"] = {
cargo = { all_features = true },
check = {
command = "clippy",
},
checkOnSave = true,
},
},
},
})
rt.inlay_hints.enable()
vim.diagnostic.config({
virtual_text = true,
signs = true,
update_in_insert = true,
underline = true,
severity_sort = false,
float = {
focusable = false,
style = "minimal",
border = "rounded",
source = "always",
header = "",
prefix = "",
},
})
Note the check = { command = "clippy" }
and checkOnSave = true
. This is one variant I’ve tried, I’ve also tried checkOnSave = { command = "clippy" }
which didn’t work either.
Am I making a dumb mistake, is this some kind of bug or is there something completely different I’m supposed to do?
Thanks in advance!