#[find_me] // ../my_file.rs
fn foo(){
}
#[proc_macro_attribute] // ../my_macros.rs
pub fn foo(attr: TokenStream, item: TokemStream) -> TokenStream{
// Gets the file name of each `foo` macro attribute
// I test file!() but just returns `../my_macros.rs`
}
I saw the proc_macro::Span
and proc_macro2::Span
APIs but the first is nightly and the second requires to pass a flag in each crate that depends of it.