orga icon indicating copy to clipboard operation
orga copied to clipboard

Support method-aware derive macros in Rust Analyzer

Open mappum opened this issue 2 years ago • 0 comments

We have a few derive macros which read the source of the calling file to find relevant methods outside of the item the macro is invoked on (Call, Query, and Client). This behavior depends on Span::source_file in proc_macro, which is experimental under the proc_macro_span feature.

Rust Analyzer doesn't support this feature, so the derive macros are unable to find relevant methods in a RA context. This will need a creative solution to inform the macro of the relevant methods, which may involve a build script and writing file path info to disk to be read by the macro, or a macro which writes an attribute containing the relative source path into the original source.

mappum avatar Jul 27 '22 19:07 mappum