mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 12:54:58 +00:00
internal: Record all macro definitions in ItemScope
This commit is contained in:
parent
cd42b20ce3
commit
db49ac8734
9 changed files with 57 additions and 27 deletions
|
@ -102,13 +102,15 @@ impl ChildBySource for ItemScope {
|
|||
res[keys::ATTR_MACRO_CALL].insert(ast_id.to_node(db.upcast()), call_id);
|
||||
},
|
||||
);
|
||||
self.legacy_macros().for_each(|(_, 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.legacy_macros().for_each(|(_, ids)| {
|
||||
ids.iter().for_each(|&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(
|
||||
|(ast_id, calls)| {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue