-
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
Show warnings for unused variables #125
Comments
Oups, sorry, I've somehow missed all three comments on the issue :( I think that we already can detect unused fields, yeah. There might be false-positives due to macros, but they should be rate, and we can hack around them (var is used in a macro if macro's text contains var name), for example. The migration to salsa is mostly complete.
So, #27 is an unrelated issue: validators are purely for checking syntax (in general, we try to remove checks for the parser per se to make it more tolerant to the errors). I think the right place for this is near the
should work. |
It works by running |
Ok, so this is handled by cargo check. Native handling is desirable, but then this issue is indistinguishable from "implement the rest of the |
Right now Rust Analyzer doesn't give much feedback while writing code. There is no autocompletion and you get only syntax errors. I was thinking about a good first step toward giving more feedback and came to the idea of showing warnings for unused variables. This should be doable by reusing
resolve_local_name
, which was defined in #98In the future we will probably want to extend this to detect unused struct fields, types and other stuff. But we need to begin with something.
The text was updated successfully, but these errors were encountered: