Rather obvious: you have to execute user code at analyze phase.
In Scala, people deal with that by providing an IDE plug-in along with the macro-based library.
I don't know how mature Rust plugin for IDEA is, in particular what happens when you have user-defined macros in code.