mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +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
|
@ -160,6 +160,10 @@ impl<'db, DB: HirDatabase> Semantics<'db, DB> {
|
|||
self.imp.is_attr_macro_call(item)
|
||||
}
|
||||
|
||||
pub fn is_derive_annotated(&self, item: &ast::Adt) -> bool {
|
||||
self.imp.is_derive_annotated(item)
|
||||
}
|
||||
|
||||
pub fn speculative_expand(
|
||||
&self,
|
||||
actual_macro_call: &ast::MacroCall,
|
||||
|
@ -470,6 +474,12 @@ impl<'db> SemanticsImpl<'db> {
|
|||
})
|
||||
}
|
||||
|
||||
fn is_derive_annotated(&self, adt: &ast::Adt) -> bool {
|
||||
let file_id = self.find_file(adt.syntax()).file_id;
|
||||
let adt = InFile::new(file_id, adt);
|
||||
self.with_ctx(|ctx| ctx.has_derives(adt))
|
||||
}
|
||||
|
||||
fn is_attr_macro_call(&self, item: &ast::Item) -> bool {
|
||||
let file_id = self.find_file(item.syntax()).file_id;
|
||||
let src = InFile::new(file_id, item.clone());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue