plugins/lsp: use clippy if available
This commit is contained in:
parent
4528deddc2
commit
a3151f43c8
@ -15,8 +15,13 @@ local function rust_analyzer_setup(lsp_config)
|
|||||||
cargo = {
|
cargo = {
|
||||||
features = "all"
|
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
|
-- Don't have rustup available if using nix shell
|
||||||
if vim.fn.executable("rustup") == 1 then
|
if vim.fn.executable("rustup") == 1 then
|
||||||
rust_analyzer_settings = vim.tbl_extend("keep", rust_analyzer_settings, {
|
rust_analyzer_settings = vim.tbl_extend("keep", rust_analyzer_settings, {
|
||||||
|
Loading…
Reference in New Issue
Block a user