Remove old find refs infra

This commit is contained in:
Aleksey Kladov 2020-03-04 14:25:22 +01:00
parent 94189d0a1c
commit f57682c0b3
4 changed files with 23 additions and 54 deletions

View file

@ -19,7 +19,7 @@ use rustc_hash::{FxHashMap, FxHashSet};
use crate::{
db::HirDatabase,
semantics::source_to_def::{ChildContainer, SourceToDefCache, SourceToDefCtx},
source_analyzer::{resolve_hir_path, ReferenceDescriptor, SourceAnalyzer},
source_analyzer::{resolve_hir_path, SourceAnalyzer},
Function, HirFileId, InFile, Local, MacroDef, Module, ModuleDef, Name, Origin, Path,
PathResolution, ScopeDef, StructField, Trait, Type, TypeParam, VariantDef,
};
@ -171,12 +171,6 @@ impl<'db, DB: HirDatabase> Semantics<'db, DB> {
SemanticsScope { db: self.db, resolver }
}
// FIXME: we only use this in `inline_local_variable` assist, ideally, we
// should switch to general reference search infra there.
pub fn find_all_refs(&self, pat: &ast::BindPat) -> Vec<ReferenceDescriptor> {
self.analyze(pat.syntax()).find_all_refs(pat)
}
fn analyze(&self, node: &SyntaxNode) -> SourceAnalyzer {
let src = self.find_file(node.clone());
self.analyze2(src.as_ref(), None)