This commit is contained in:
Lukas Wirth 2022-08-15 16:16:59 +02:00
parent f982c76161
commit 3f149a63d2
4 changed files with 15 additions and 15 deletions

View file

@ -119,6 +119,8 @@ pub(crate) fn hover(
}
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())));
// prefer descending the same token kind in attribute expansions, in normal macros text
// equivalency is more important
let descended = if in_attr {
[sema.descend_into_macros_with_kind_preference(original_token.clone())].into()
} else {