-
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
Default lints should correspond to rustc #16628
Comments
The specification doesn't list a "WeakWarning" level. I think non-standard extensions should be either disabled by default or gated to editors known to support them? Or is the LSP standard too dated to be useful now (but surely it should also correspond to what VSCode supports since they're both MS products)? (This should probably be forked to a new issue.) That very inconspicuous hint sounds fine for The |
Sorry, we apparently call "WeakWarning" what's called "Hint" on the LSP level. It's not a non-standard extension. |
I don't know. I think these hints are more intended as "there's a useful thing to do here", not necessarily that there's something wrong. And you might not be using Clippy at all, so I don't think we should only go by what's enabled for Clippy. OTOH we should probably honor if a similar lint is explicitly disabled for Clippy. |
This is very opinionated (the "useful" part). Your example above (where the More generally,
There is a counter-argument that certain things should be hinted by |
Why would we want to "minimize the difference in experience between those who use [rust-analyzer] and those who don't"? You can always turn off any of these diagnostics using the |
Sorry, I mean to minimize the difference in reported lints, so that usage of |
minor: Mark remove_unnecessary_else as experimental cc #16566 (comment) #16628 There seem to be some leftover issues with this, additionally its a style lint so it's not too nice to see for some people. We should flesh out our diagnostics stuff before adding more style lints I think
Summary
I would expect that
rust-analyzer
, with default settings, would report the same lints (warnings, errors, etc.) asrustc
Details
Currently this is not the case; for example I also see messages about these:
inactive-code
— this may have a special purpose in some editors? In Kate it's more annoying than useful, but that may be just Kate.remove-unnecessary-else
— nearest equivalent is Clippy'sredundant_else
?The default enabled lints also do not correspond to Clippy's default lints (there is a note in the manual about enabling Clippy by default).
Motivation
I would (naively) expect that a project which is clean (reports no lints) under
cargo check
is also clean underrust-analyzer
, and vice-versa. This makes it easier for developers using different tools to collaborate on a project.Further motivation: the
rust-analyzer
project should probably not be responsible for choosing which lints are enabled by default (especially when bothrustc
andclippy
already do this).The text was updated successfully, but these errors were encountered: