Skip to content

Commit 9b4ca77

Browse files
committed
fix: Add highlighting hack back for unresolved attributes
1 parent 6434ada commit 9b4ca77

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

crates/ide/src/syntax_highlighting/highlight.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,13 @@ fn highlight_name_ref(
262262
None if name_ref.self_token().is_some() && is_in_fn_with_self_param(&name_ref) => {
263263
return SymbolKind::SelfParam.into()
264264
}
265+
// FIXME: This is required for helper attributes used by proc-macros, as those do not map down
266+
// to anything when used.
267+
// We can fix this for derive attributes since derive helpers are recorded, but not for
268+
// general attributes.
269+
None if name_ref.syntax().ancestors().any(|it| it.kind() == ATTR) => {
270+
return HlTag::Symbol(SymbolKind::Attribute).into();
271+
}
265272
None => return HlTag::UnresolvedReference.into(),
266273
};
267274
let mut h = match name_class {

0 commit comments

Comments
 (0)