rust-lang/vscode-rust

Is there a way to invert the order clippy/rustc?

frederikhors opened this issue · 1 comments

I'm using this in VSCode settings.json:

{
  "rust-analyzer.checkOnSave.command": "clippy",
}

it works good.

But I would like to have rustc errors before and only after the clippy errors/warnings because sometimes clippy can take many more seconds than rustc.

Is there a way to invert the order?

The right repository to file this would be https://github.com/rust-analyzer/rust-analyzer.

We show the diagnostics as returned by cargo clippy, which happen to include the ones from rustc. I don't think we can really distinguish them:

warning: long literal lacking separators
  --> src/vector/defn.rs:18:16
   |
18 | const X: i32 = 1000000000;
   |                ^^^^^^^^^^ help: consider: `1_000_000_000`
   |
   = note: requested on the command line with `-W clippy::unreadable-literal`
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unreadable_literal

warning: unused variable: `s`
  --> src/vector/defn.rs:26:13
   |
26 |         let s = 2;
   |             ^ help: if this is intentional, prefix it with an underscore: `_s`
   |
   = note: `#[warn(unused_variables)]` on by default

I suggest running clippy only from time to time, not on every file save. I even disable cargo check in favour of the native diagnostics.