-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
#[rust_analyzer::skip] attribute #7449
Comments
This could also be a As for the effect, I'm not sure. We'd like to skip that item or expression completely, but we still need to parse it to see where it ends. In the linked issue we run into a step limit in the parser. |
Another option would be to move the problematic code to a different file and mark it as excluded, although that's still editor-dependent for now. |
Noted, thank you. |
Note that this requires upstream support in order to register |
This would be useful as a general feature I think, other people have also asked for it: https://internals.rust-lang.org/t/pre-rfc-implementation-defined-lints/13870/10 |
You can do this on nightly with register_tool: rust-lang/rust#66079 |
It may also apply to proc macros instead of (or in addition to) the current setting |
I think |
But there are macros that does not need expansion at all (e.g. In a second thought, however, maybe all of those macros, even if should not be expanded today, should be in the future when we'll implement full diagnostics support. |
#18907 implements such an attribute for bodies, that is functions / consts / statics for now. We do not make any stability promises wrt to the attribute for the time being though (although it is unlikely to change behavior or syntax in this case) |
@Veykril i am confused: how do you expect people to add (i would like to improve the situation around register_tool, i'm aware it's a pain. but i'm asking about how RA works today.) |
|
Though an annotation like #[rustanalyzer::skip] would be nice for some fuctions we do not want to be analyzed.
Originally posted by @giftal in #4500 (comment)
The text was updated successfully, but these errors were encountered: