feat(lsp): configure rust-analyzer to use clippy for checks

Sets the check command to clippy via both vim.lsp.config (for system-installed
rust-analyzer via rustup) and the mason-lspconfig handler, so diagnostics
reflect clippy lints rather than cargo check output.
This commit is contained in:
2026-05-31 00:44:12 -04:00
parent 5c980a8b57
commit 7e68bc3391
+22
View File
@@ -344,6 +344,16 @@ lazyload.on_vim_enter(function()
local lspconfig = require("lspconfig")
local capabilities = (has_blink_bin or has_cargo) and require("blink.cmp").get_lsp_capabilities() or nil
vim.lsp.config("rust_analyzer", {
settings = {
["rust-analyzer"] = {
check = {
command = "clippy",
},
},
},
})
require("mason-lspconfig").setup({
ensure_installed = {
"lua_ls",
@@ -370,6 +380,18 @@ lazyload.on_vim_enter(function()
},
})
end,
["rust_analyzer"] = function()
lspconfig.rust_analyzer.setup({
capabilities = capabilities,
settings = {
["rust-analyzer"] = {
check = {
command = "clippy",
},
},
},
})
end,
},
})