Vacro Report
Better Panic Reporting for Procedural Macros
Introduction
vacro-report is a diagnostic enhancement tool designed to improve the debugging experience for Rust Procedural Macros.
It currently focuses on solving the opaque panic messages generated by syn::parse_quote!. When parse_quote! fails, it usually just says "failed to parse". vacro-report intercepts these calls and prints the actual generated token stream formatted as code, highlighting the syntax error.
Installation
[]
= "0.1.0"
Usage
Simply decorate your function with #[vacro_report::scope].
Inside the scope, any usage of parse_quote! will be automatically instrumented. No other code changes are required.
use ;
use scope;
Features
- Automatic Interception: Rewrites
parse_quote!calls within the#[scope]function. - Detailed Diagnostics: When a parsing error occurs, it displays the generated code (formatted) and the error location.
- Zero Overhead (Success): Adds minimal overhead only when an error actually occurs (panic path).