internal: Filter out opaque tokens in some of IDE feature macro descensions

This commit is contained in:
Lukas Wirth 2024-10-04 11:08:11 +02:00
parent ac4edbf9dc
commit 24d65bb7cf
11 changed files with 114 additions and 70 deletions

View file

@ -529,9 +529,13 @@ impl<'a> FindUsages<'a> {
})
.into_iter()
.flat_map(move |token| {
sema.descend_into_macros_exact_if_in_macro(token)
.into_iter()
.filter_map(|it| it.parent())
if sema.might_be_inside_macro_call(&token) {
sema.descend_into_macros_exact(token)
} else {
<_>::from([token])
}
.into_iter()
.filter_map(|it| it.parent())
})
}