mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 05:15:04 +00:00
Remove lossy Definition::from_token
/Definition::from_node
methods
This commit is contained in:
parent
68bc12c3b8
commit
c5a9985fc5
6 changed files with 91 additions and 92 deletions
|
@ -1,7 +1,7 @@
|
|||
use hir::Semantics;
|
||||
use ide_db::{
|
||||
base_db::{FileId, FilePosition},
|
||||
defs::Definition,
|
||||
defs::{Definition, IdentClass},
|
||||
helpers::{for_each_break_expr, for_each_tail_expr, node_ext::walk_expr, pick_best_token},
|
||||
search::{FileReference, ReferenceCategory, SearchScope},
|
||||
RootDatabase,
|
||||
|
@ -293,7 +293,8 @@ fn cover_range(r0: Option<TextRange>, r1: Option<TextRange>) -> Option<TextRange
|
|||
fn find_defs(sema: &Semantics<RootDatabase>, token: SyntaxToken) -> FxHashSet<Definition> {
|
||||
sema.descend_into_macros(token)
|
||||
.into_iter()
|
||||
.flat_map(|token| Definition::from_token(sema, &token))
|
||||
.filter_map(|token| IdentClass::classify_token(sema, &token).map(IdentClass::definitions))
|
||||
.flatten()
|
||||
.collect()
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue