mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 14:51:48 +00:00
Auto merge of #18234 - Veykril:veykril/push-vzynqtlxmrnl, r=Veykril
internal: Filter out opaque tokens in some IDE feature macro descensions
This commit is contained in:
commit
510f72e12c
11 changed files with 114 additions and 70 deletions
|
@ -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(original_token)
|
||||
.descend_into_macros_no_opaque(original_token)
|
||||
.iter()
|
||||
.filter_map(|token| {
|
||||
let parent = token.parent()?;
|
||||
|
|
|
@ -83,7 +83,7 @@ pub(crate) fn goto_definition(
|
|||
}
|
||||
|
||||
let navs = sema
|
||||
.descend_into_macros(original_token.clone())
|
||||
.descend_into_macros_no_opaque(original_token.clone())
|
||||
.into_iter()
|
||||
.filter_map(|token| {
|
||||
let parent = token.parent()?;
|
||||
|
|
|
@ -69,7 +69,7 @@ pub(crate) fn goto_type_definition(
|
|||
}
|
||||
|
||||
let range = token.text_range();
|
||||
sema.descend_into_macros(token)
|
||||
sema.descend_into_macros_no_opaque(token)
|
||||
.into_iter()
|
||||
.filter_map(|token| {
|
||||
let ty = sema
|
||||
|
|
|
@ -409,7 +409,8 @@ fn traverse(
|
|||
let mut r = 0;
|
||||
sema.descend_into_macros_breakable(
|
||||
InRealFile::new(file_id, token.clone()),
|
||||
|tok| {
|
||||
|tok, _ctx| {
|
||||
// FIXME: Consider checking ctx transparency for being opaque?
|
||||
let tok = tok.value;
|
||||
let tok_kind = tok.kind();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue