return Declaration from classify_name

This commit is contained in:
Ekaterina Babshukova 2019-10-03 06:08:44 +03:00
parent 0b5d0a41fd
commit 83f780eabf
2 changed files with 59 additions and 36 deletions

View file

@ -92,7 +92,7 @@ pub(crate) fn find_all_refs(
) -> Option<RangeInfo<(hir::SourceAnalyzer, NameKind)>> {
if let Some(name) = find_node_at_offset::<ast::Name>(&syntax, position.offset) {
let analyzer = hir::SourceAnalyzer::new(db, position.file_id, name.syntax(), None);
let name_kind = classify_name(db, position.file_id, &name)?;
let name_kind = classify_name(db, position.file_id, &name)?.item;
let range = name.syntax().text_range();
return Some(RangeInfo::new(range, (analyzer, name_kind)));
}