-
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 rustdoc of proc macros #14772
Comments
This is a really unfortunate consequence of #12603. We do show rustdoc of proc macros, but we fail to expand your internal macros to generate the attribute macros in the first place. The problem is that your internal macro One thing you can do to workaround this is to have I hate to suggest a workaround instead of fixing the bug, but we've been failing to figure out how to resolve it properly, so this should be the quickest way to make your crate work in rust-analyzer. Sorry for the inconvenience. |
Hi Ryo, Thank you so mach for deep insight. Workarounds are fine. Only for reference, or for anyone curious or with a similar problem: Unfortunately, and to my surprise, paths (or some paths, at least: like That's with
Update: The above is even more strange, because I do have
Anyway, I am exploring a different workaround: Since all prefixed lints have only one path level (either |
Another surprise: If a macro (by example) accepts a macro_rules! consume_path_only_as_path_then_pass_down_as_tt {
($lint_path:path) => {
consume_tt_only!($lint_path);
};
}
macro_rules! consume_tt_only {
($lint_path:tt) => {};
}
pub fn test_macro() {
// ...
// the following does compile!
consume_path_only_as_path_then_pass_down_as_tt!(clippy::alloc_instead_of_core);
} (Updated https://github.com/peter-kehl/macro_rules_path_as_tt.) |
Thank you. I confirm that using (Then my only problem was that Feel free to close this issue (since it can be worked around), or keep open, as you see fit. |
Thank you for
rust-analyzer
.use ... as ...;
under an alias.Example: Attribute macros aliased on purpose from https://docs.rs/allow_prefixed/latest/allow_prefixed (or from https://docs.rs/allow_prefixed/latest/allow):
Crrent
rust-analyzer
versionv0.3.1506
in current VS Code:Thank you in advance.
The text was updated successfully, but these errors were encountered: