internal: Expand the derive attribute into a pseudo expansion

This commit is contained in:
Lukas Wirth 2022-02-21 02:42:58 +01:00
parent 1fe3b2edd6
commit 7b89d5ede2
17 changed files with 178 additions and 155 deletions

View file

@ -116,11 +116,11 @@ impl ChildBySource for ItemScope {
self.derive_macro_invocs().filter(|(id, _)| id.file_id == file_id).for_each(
|(ast_id, calls)| {
let adt = ast_id.to_node(db.upcast());
calls.for_each(|(attr_id, calls)| {
calls.for_each(|(attr_id, call_id, calls)| {
if let Some(Either::Left(attr)) =
adt.doc_comments_and_attrs().nth(attr_id.ast_index as usize)
{
res[keys::DERIVE_MACRO_CALL].insert(attr, (attr_id, calls.into()));
res[keys::DERIVE_MACRO_CALL].insert(attr, (attr_id, call_id, calls.into()));
}
});
},