mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 05:15:04 +00:00
Reuse Semantics instances
This commit is contained in:
parent
ec8b4dca02
commit
9710ad8c48
7 changed files with 39 additions and 39 deletions
|
@ -39,10 +39,11 @@ pub(crate) fn call_hierarchy(
|
|||
|
||||
pub(crate) fn incoming_calls(db: &RootDatabase, position: FilePosition) -> Option<Vec<CallItem>> {
|
||||
let sema = Semantics::new(db);
|
||||
|
||||
// 1. Find all refs
|
||||
// 2. Loop through refs and determine unique fndef. This will become our `from: CallHierarchyItem,` in the reply.
|
||||
// 3. Add ranges relative to the start of the fndef.
|
||||
let refs = references::find_all_refs(db, position, None)?;
|
||||
let refs = references::find_all_refs(&sema, position, None)?;
|
||||
|
||||
let mut calls = CallLocations::default();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue