We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 57cc2a6 + e50712c commit add8539Copy full SHA for add8539
crates/ide/src/hover.rs
@@ -119,7 +119,14 @@ pub(crate) fn hover(
119
});
120
}
121
122
- let in_attr = matches!(original_token.parent().and_then(ast::TokenTree::cast), Some(tt) if tt.syntax().ancestors().any(|it| ast::Meta::can_cast(it.kind())));
+ let in_attr = original_token
123
+ .parent_ancestors()
124
+ .filter_map(ast::Item::cast)
125
+ .any(|item| sema.is_attr_macro_call(&item))
126
+ && !matches!(
127
+ original_token.parent().and_then(ast::TokenTree::cast),
128
+ Some(tt) if tt.syntax().ancestors().any(|it| ast::Meta::can_cast(it.kind()))
129
+ );
130
// prefer descending the same token kind in attribute expansions, in normal macros text
131
// equivalency is more important
132
let descended = if in_attr {
0 commit comments