Tools Team: tell us your sorrows

Area: debugging proc-macros

When writing a procedural macro, you want to see the expanded result for some examples for debugging. The only way I could find is to println! the final TokenStream in proc-macro. But without any formatting, it’s very hard to read.

I’d like a tool that can expand a proc-macro (once the proc-macro crate is compiled) and format the result with rustfmt. Ideally, this should be integrated in my IDE. IntelliJ can expand normal macro_rules! macros, but not procedural ones.

11 Likes