-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How do I temporarily show Clippy warnings? #12323
Comments
…s-schievink feat: Add "cargo clippy" task preset We've had a couple of common presets in `Tasks: Run Task -> cargo -> cargo [check,build,test,...]` before. This PR adds `cargo clippy` to that list, which makes for a convenient way of occasionally running Clippy on your code without having to reconfigure the Check on Save command to clippy. These presets all use the `cargo` task type that we provide, so diagnostics will show up in the editor. However, they don't go through the server-side parsing logic, so it's not possible to apply suggestions, and diagnostics are fairly "low-fidelity". It would be cool if we could somehow pass Cargo's JSON output through the LSP server and render it properly, for arbitrary tasks. cc #12323
I've added a |
IIRC there were some discussions (maybe even a PR) about adding a check-on-command, and it was rejected because task presets can be used instead. I think the diagnostic rendering (including quick fixes, potentially deduplication between the check and our own diagnostics, etc.), and the fact that task presets are VSCode specific, are arguments to build this into rust-analyzer properly though. |
Since version 3.17, LSP has support for pull-based diagnostic reporting. There is no built-in way to specify which diagnostics to report unfortunately, so it might need an extension to allow for that. |
I know that I can edit settings to invoke
cargo clippy
instead ofcargo check
, save a file to trigger RA recheck, observe and fix Clippy issues in the project, then change settings back to use usualcargo check
.Is there (or should there be) a better, more user-friendly way of viewing Clippy diagnostics without modifying settings every time, also without opting in to Clippy notices permanently?
The text was updated successfully, but these errors were encountered: