aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_api/src/syntax_highlighting.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_ide_api/src/syntax_highlighting.rs')
-rw-r--r--crates/ra_ide_api/src/syntax_highlighting.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/crates/ra_ide_api/src/syntax_highlighting.rs b/crates/ra_ide_api/src/syntax_highlighting.rs
index 98373a49c..8be93e27e 100644
--- a/crates/ra_ide_api/src/syntax_highlighting.rs
+++ b/crates/ra_ide_api/src/syntax_highlighting.rs
@@ -103,7 +103,9 @@ pub(crate) fn highlight(db: &RootDatabase, file_id: FileId) -> Vec<HighlightedRa
103 if let Some(name_ref) = node.as_node().cloned().and_then(ast::NameRef::cast) { 103 if let Some(name_ref) = node.as_node().cloned().and_then(ast::NameRef::cast) {
104 // FIXME: try to reuse the SourceAnalyzers 104 // FIXME: try to reuse the SourceAnalyzers
105 let analyzer = hir::SourceAnalyzer::new(db, file_id, name_ref.syntax(), None); 105 let analyzer = hir::SourceAnalyzer::new(db, file_id, name_ref.syntax(), None);
106 match classify_name_ref(db, &analyzer, &name_ref) { 106 let name_kind = classify_name_ref(db, file_id, &analyzer, &name_ref)
107 .and_then(|d| Some(d.item));
108 match name_kind {
107 Some(Macro(_)) => "macro", 109 Some(Macro(_)) => "macro",
108 Some(FieldAccess(_)) => "field", 110 Some(FieldAccess(_)) => "field",
109 Some(AssocItem(hir::AssocItem::Function(_))) => "function", 111 Some(AssocItem(hir::AssocItem::Function(_))) => "function",
@@ -119,7 +121,7 @@ pub(crate) fn highlight(db: &RootDatabase, file_id: FileId) -> Vec<HighlightedRa
119 Some(Def(hir::ModuleDef::TypeAlias(_))) => "type", 121 Some(Def(hir::ModuleDef::TypeAlias(_))) => "type",
120 Some(Def(hir::ModuleDef::BuiltinType(_))) => "type", 122 Some(Def(hir::ModuleDef::BuiltinType(_))) => "type",
121 Some(SelfType(_)) => "type", 123 Some(SelfType(_)) => "type",
122 Some(Pat(ptr)) => { 124 Some(Pat((_, ptr))) => {
123 let pat = ptr.to_node(&root); 125 let pat = ptr.to_node(&root);
124 if let Some(name) = pat.name() { 126 if let Some(name) = pat.name() {
125 let text = name.text(); 127 let text = name.text();