mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 12:29:21 +00:00
internal: Flatten Definition::ModuleDef
variant
This commit is contained in:
parent
f724c84e7d
commit
7776aad166
32 changed files with 709 additions and 702 deletions
|
@ -47,15 +47,11 @@ pub(crate) fn incoming_calls(
|
|||
.find_nodes_at_offset_with_descend(file, offset)
|
||||
.filter_map(move |node| match node {
|
||||
ast::NameLike::NameRef(name_ref) => match NameRefClass::classify(sema, &name_ref)? {
|
||||
NameRefClass::Definition(
|
||||
def @ Definition::ModuleDef(hir::ModuleDef::Function(_)),
|
||||
) => Some(def),
|
||||
NameRefClass::Definition(def @ Definition::Function(_)) => Some(def),
|
||||
_ => None,
|
||||
},
|
||||
ast::NameLike::Name(name) => match NameClass::classify(sema, &name)? {
|
||||
NameClass::Definition(def @ Definition::ModuleDef(hir::ModuleDef::Function(_))) => {
|
||||
Some(def)
|
||||
}
|
||||
NameClass::Definition(def @ Definition::Function(_)) => Some(def),
|
||||
_ => None,
|
||||
},
|
||||
ast::NameLike::Lifetime(_) => None,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue