fix: properly import all types of macros with #[macro_use] again

This commit is contained in:
Jonas Schievink 2022-03-23 14:30:04 +01:00
parent 0b3daef537
commit 18ad750786
5 changed files with 59 additions and 20 deletions

View file

@ -103,9 +103,11 @@ impl ChildBySource for ItemScope {
},
);
self.legacy_macros().for_each(|(_, id)| {
let loc = id.lookup(db);
if loc.id.file_id() == file_id {
res[keys::MACRO_RULES].insert(loc.source(db).value, id);
if let MacroId::MacroRulesId(id) = id {
let loc = id.lookup(db);
if loc.id.file_id() == file_id {
res[keys::MACRO_RULES].insert(loc.source(db).value, id);
}
}
});
self.derive_macro_invocs().filter(|(id, _)| id.file_id == file_id).for_each(