Here are various ideas, in order of how hard I expect them to be:
we could add a heuristic to detect $crate paths and allow navigating to them in macro definitions.
our "expand macro" functionality could be improved to show expansions inline and allow you to use navigation features in the expanded code. There's already #5949 about this, though I think it'd be cool to overlay the expansion inline.
it might even be possible to keep some context when using "go to definition" on a macro call, which would allow us to interpret the macro definition in the context of the original call. I think IntelliJ does something similar with type parameters already, and I seem to remember talking about this with @matklad before, but I didn't find an existing issue about this.
Inspired by this forum post...
It'd be nice to provide some navigation features in macro definitions / expansions. E.g. if you navigate to the definition of
println
, you getand can't click on
_print
, for example.Here are various ideas, in order of how hard I expect them to be: