From 7e68bc339103af63990de283ae15035a01870caf Mon Sep 17 00:00:00 2001 From: rootiest Date: Sun, 31 May 2026 00:44:12 -0400 Subject: [PATCH] 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. --- lua/plugins.lua | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/lua/plugins.lua b/lua/plugins.lua index d9f65d2..0a96171 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -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, }, })