mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 12:29:21 +00:00
Fix syntax highlighting not highlighting derives anymore
This commit is contained in:
parent
f13c98034b
commit
1bbef5af85
5 changed files with 38 additions and 0 deletions
|
@ -237,6 +237,20 @@ fn traverse(
|
|||
continue;
|
||||
}
|
||||
Some(item) if sema.is_attr_macro_call(&item) => current_attr_call = Some(item),
|
||||
Some(item) if current_attr_call.is_none() => {
|
||||
let adt = match item {
|
||||
ast::Item::Enum(it) => Some(ast::Adt::Enum(it)),
|
||||
ast::Item::Struct(it) => Some(ast::Adt::Struct(it)),
|
||||
ast::Item::Union(it) => Some(ast::Adt::Union(it)),
|
||||
_ => None,
|
||||
};
|
||||
match adt {
|
||||
Some(adt) if sema.is_derive_annotated(&adt) => {
|
||||
current_attr_call = Some(adt.into());
|
||||
}
|
||||
_ => (),
|
||||
}
|
||||
}
|
||||
None if ast::Attr::can_cast(node.kind()) => inside_attribute = true,
|
||||
_ => (),
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue