fix: Do not force descend into derives for goto IDE features

Doing so can cause us to duplicate navigation targets for the same ranges which breaks convenience features of some editors where go to def can trigger find all references
This commit is contained in:
Lukas Wirth 2025-06-12 09:36:22 +02:00
parent c15fc9a344
commit c8cedae2f9
4 changed files with 6 additions and 5 deletions

View file

@ -29,7 +29,7 @@ pub(crate) fn goto_declaration(
.find(|it| matches!(it.kind(), IDENT | T![self] | T![super] | T![crate] | T![Self]))?;
let range = original_token.text_range();
let info: Vec<NavigationTarget> = sema
.descend_into_macros_no_opaque(original_token)
.descend_into_macros_no_opaque(original_token, false)
.iter()
.filter_map(|token| {
let parent = token.value.parent()?;

View file

@ -88,7 +88,7 @@ pub(crate) fn goto_definition(
}
let navs = sema
.descend_into_macros_no_opaque(original_token.clone())
.descend_into_macros_no_opaque(original_token.clone(), false)
.into_iter()
.filter_map(|token| {
let parent = token.value.parent()?;

View file

@ -70,7 +70,7 @@ pub(crate) fn goto_type_definition(
}
let range = token.text_range();
sema.descend_into_macros_no_opaque(token)
sema.descend_into_macros_no_opaque(token,false)
.into_iter()
.filter_map(|token| {
sema