mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 21:35:20 +00:00
internal: Remove unnecessary usages of ExpansionInfo
This commit is contained in:
parent
604479c373
commit
d252247ab7
7 changed files with 175 additions and 106 deletions
|
@ -303,14 +303,18 @@ impl Definition {
|
|||
DefWithBody::InTypeConst(_) => return SearchScope::empty(),
|
||||
};
|
||||
return match def {
|
||||
Some(def) => SearchScope::file_range(def.as_ref().original_file_range_full(db)),
|
||||
Some(def) => SearchScope::file_range(
|
||||
def.as_ref().original_file_range_with_macro_call_body(db),
|
||||
),
|
||||
None => SearchScope::single_file(file_id),
|
||||
};
|
||||
}
|
||||
|
||||
if let Definition::SelfType(impl_) = self {
|
||||
return match impl_.source(db).map(|src| src.syntax().cloned()) {
|
||||
Some(def) => SearchScope::file_range(def.as_ref().original_file_range_full(db)),
|
||||
Some(def) => SearchScope::file_range(
|
||||
def.as_ref().original_file_range_with_macro_call_body(db),
|
||||
),
|
||||
None => SearchScope::single_file(file_id),
|
||||
};
|
||||
}
|
||||
|
@ -327,7 +331,9 @@ impl Definition {
|
|||
hir::GenericDef::Const(it) => it.source(db).map(|src| src.syntax().cloned()),
|
||||
};
|
||||
return match def {
|
||||
Some(def) => SearchScope::file_range(def.as_ref().original_file_range_full(db)),
|
||||
Some(def) => SearchScope::file_range(
|
||||
def.as_ref().original_file_range_with_macro_call_body(db),
|
||||
),
|
||||
None => SearchScope::single_file(file_id),
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue