Skip to content

Commit 1cf1359

Browse files
bors[bot]Veykril
andauthored
Merge #10937
10937: fix: Add highlighting hack back for unresolved attributes r=Veykril a=Veykril cc #10935 bors r+ Co-authored-by: Lukas Wirth <[email protected]>
2 parents 8a084e6 + 9b4ca77 commit 1cf1359

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)