mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-16 15:25:38 +00:00
Auto merge of #16461 - Veykril:expansion-info, r=Veykril
internal: Remove unnecessary usages of ExpansionInfo And some follow up simplifications to https://github.com/rust-lang/rust-analyzer/pull/16439
This commit is contained in:
commit
2661c272c9
7 changed files with 175 additions and 106 deletions
|
@ -304,14 +304,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),
|
||||
};
|
||||
}
|
||||
|
@ -328,7 +332,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