diff --git a/lua/valeth/plugins/lsp.lua b/lua/valeth/plugins/lsp.lua index 2deb9de..432af9a 100644 --- a/lua/valeth/plugins/lsp.lua +++ b/lua/valeth/plugins/lsp.lua @@ -15,8 +15,13 @@ local function rust_analyzer_setup(lsp_config) cargo = { features = "all" }, + checkOnSave = true, } + if vim.fn.executable("cargo-clippy") == 1 then + rust_analyzer_settings.check = { command = "clippy" } + end + -- Don't have rustup available if using nix shell if vim.fn.executable("rustup") == 1 then rust_analyzer_settings = vim.tbl_extend("keep", rust_analyzer_settings, {