Sourcify classify_name_ref

This commit is contained in:
Aleksey Kladov 2019-11-16 13:33:25 +03:00
parent d9d99369b2
commit 272af56a5c
5 changed files with 22 additions and 21 deletions

View file

@ -2,7 +2,7 @@
use rustc_hash::{FxHashMap, FxHashSet};
use hir::{Mutability, Name};
use hir::{Mutability, Name, Source};
use ra_db::SourceDatabase;
use ra_prof::profile;
use ra_syntax::{ast, AstNode, Direction, SyntaxElement, SyntaxKind, SyntaxKind::*, TextRange, T};
@ -80,7 +80,8 @@ pub(crate) fn highlight(db: &RootDatabase, file_id: FileId) -> Vec<HighlightedRa
}
let name_ref = node.as_node().cloned().and_then(ast::NameRef::cast).unwrap();
let name_kind = classify_name_ref(db, file_id, &name_ref).map(|d| d.kind);
let name_kind =
classify_name_ref(db, Source::new(file_id.into(), &name_ref)).map(|d| d.kind);
if let Some(Local(local)) = &name_kind {
if let Some(name) = local.name(db) {