mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 21:35:20 +00:00
refactor name_ref_kind.rs
This commit is contained in:
parent
11577288c2
commit
d6ae1b5f0f
6 changed files with 61 additions and 64 deletions
|
@ -14,7 +14,7 @@ use ra_syntax::{
|
|||
|
||||
use crate::{
|
||||
db::RootDatabase,
|
||||
name_ref_kind::{classify_name_ref, NameKind::*},
|
||||
name_kind::{classify_name_ref, NameKind::*},
|
||||
FileId,
|
||||
};
|
||||
|
||||
|
@ -104,7 +104,6 @@ pub(crate) fn highlight(db: &RootDatabase, file_id: FileId) -> Vec<HighlightedRa
|
|||
// FIXME: try to reuse the SourceAnalyzers
|
||||
let analyzer = hir::SourceAnalyzer::new(db, file_id, name_ref.syntax(), None);
|
||||
match classify_name_ref(db, &analyzer, &name_ref) {
|
||||
Some(Method(_)) => "function",
|
||||
Some(Macro(_)) => "macro",
|
||||
Some(FieldAccess(_)) => "field",
|
||||
Some(AssocItem(hir::AssocItem::Function(_))) => "function",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue