mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 22:54:58 +00:00
Rename MacroDef to Macro
This commit is contained in:
parent
42d46325a1
commit
ad54ee2939
6 changed files with 57 additions and 31 deletions
|
@ -102,6 +102,12 @@ impl ChildBySource for ItemScope {
|
|||
res[keys::ATTR_MACRO_CALL].insert(ast_id.to_node(db.upcast()), call_id);
|
||||
},
|
||||
);
|
||||
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);
|
||||
}
|
||||
});
|
||||
self.derive_macro_invocs().filter(|(id, _)| id.file_id == file_id).for_each(
|
||||
|(ast_id, calls)| {
|
||||
let adt = ast_id.to_node(db.upcast());
|
||||
|
@ -145,7 +151,9 @@ impl ChildBySource for ItemScope {
|
|||
MacroId::MacroRulesId(id) => insert!(map[keys::MACRO_RULES].insert(id)),
|
||||
MacroId::ProcMacroId(id) => insert!(map[keys::PROC_MACRO].insert(id)),
|
||||
},
|
||||
_ => (),
|
||||
ModuleDefId::ModuleId(_)
|
||||
| ModuleDefId::EnumVariantId(_)
|
||||
| ModuleDefId::BuiltinType(_) => (),
|
||||
}
|
||||
}
|
||||
fn add_impl(db: &dyn DefDatabase, map: &mut DynMap, file_id: HirFileId, imp: ImplId) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue