Reuse Semantics instances

This commit is contained in:
Laurențiu Nicola 2020-07-01 15:11:34 +03:00
parent ec8b4dca02
commit 9710ad8c48
7 changed files with 39 additions and 39 deletions

View file

@ -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();