mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 05:45:12 +00:00
Improve macro descension API
This commit is contained in:
parent
986577faaa
commit
5b8e386bae
21 changed files with 179 additions and 139 deletions
|
@ -9,7 +9,7 @@
|
|||
//! at the index that the match starts at and its tree parent is
|
||||
//! resolved to the search element definition, we get a reference.
|
||||
|
||||
use hir::{PathResolution, Semantics};
|
||||
use hir::{DescendPreference, PathResolution, Semantics};
|
||||
use ide_db::{
|
||||
base_db::FileId,
|
||||
defs::{Definition, NameClass, NameRefClass},
|
||||
|
@ -126,7 +126,7 @@ pub(crate) fn find_defs<'a>(
|
|||
)
|
||||
});
|
||||
token.map(|token| {
|
||||
sema.descend_into_macros_with_same_text(token, offset)
|
||||
sema.descend_into_macros(DescendPreference::SameText, token, offset)
|
||||
.into_iter()
|
||||
.filter_map(|it| ast::NameLike::cast(it.parent()?))
|
||||
.filter_map(move |name_like| {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue