about summary refs log tree commit diff
diff options
context:
space:
mode:
authorLukas Wirth <lukastw97@gmail.com>2021-12-05 11:59:07 +0100
committerLukas Wirth <lukastw97@gmail.com>2021-12-05 11:59:07 +0100
commit9b4ca77572c4cfa71f51fef052ef0aa3cc8d6d19 (patch)
treee6a90d2b21a3dfa0f2f8ac95ba2be47bd211caaa
parent6434ada19e7cf2e96015fb2668d64a0fdfc08b23 (diff)
downloadrust-9b4ca77572c4cfa71f51fef052ef0aa3cc8d6d19.tar.gz
rust-9b4ca77572c4cfa71f51fef052ef0aa3cc8d6d19.zip
fix: Add highlighting hack back for unresolved attributes
-rw-r--r--crates/ide/src/syntax_highlighting/highlight.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/crates/ide/src/syntax_highlighting/highlight.rs b/crates/ide/src/syntax_highlighting/highlight.rs
index 88c469df265..a52b2247c5a 100644
--- a/crates/ide/src/syntax_highlighting/highlight.rs
+++ b/crates/ide/src/syntax_highlighting/highlight.rs
@@ -262,6 +262,13 @@ fn highlight_name_ref(
         None if name_ref.self_token().is_some() && is_in_fn_with_self_param(&name_ref) => {
             return SymbolKind::SelfParam.into()
         }
+        // FIXME: This is required for helper attributes used by proc-macros, as those do not map down
+        // to anything when used.
+        // We can fix this for derive attributes since derive helpers are recorded, but not for
+        // general attributes.
+        None if name_ref.syntax().ancestors().any(|it| it.kind() == ATTR) => {
+            return HlTag::Symbol(SymbolKind::Attribute).into();
+        }
         None => return HlTag::UnresolvedReference.into(),
     };
     let mut h = match name_class {