Closed
Description
The basic infra for macros is in place: hir uses HirFileId
which can refer to both usual files and macro expansions.
Now we need to learn how to actually expand macros. We need to handle two kinds of macros: macro by example (macro_rules
) and procedural macros. Crates like https://github.com/nrc/proc-macro-rules (thanks @nrc!) should allow us to handle only the second case. Basically, the pipeline should look like
ra::SyntaxNode
-> proc_macro2::TokenStream
-> existing macro ecosystem
-> proc_macro2::TokenStream
-> ra::SyntaxNode
We need to implement only first and last arrow (which might be not easy as it seems because we need hygiene info somewhere).
The next big step after understanding macro_rules
would be plugging them into the resolver in a proper recursive way.
Metadata
Metadata
Assignees
Labels
No labels