Basic Support Macro 2.0

This commit is contained in:
Edwin Cheng 2021-03-27 13:44:54 +08:00
parent c8066ebd17
commit a193666361
7 changed files with 209 additions and 63 deletions

View file

@ -151,7 +151,7 @@ impl HirFileId {
let def = loc.def.ast_id().left().and_then(|id| {
let def_tt = match id.to_node(db) {
ast::Macro::MacroRules(mac) => mac.token_tree()?,
ast::Macro::MacroDef(_) => return None,
ast::Macro::MacroDef(mac) => mac.body()?,
};
Some(InFile::new(id.file_id, def_tt))
});