rust-lang / rust-analyzer

A Rust compiler front-end for IDEs
https://rust-analyzer.github.io/
Apache License 2.0
14.06k stars 1.56k forks source link

Improve code navigation in macros #7890

Open flodiebold opened 3 years ago

flodiebold commented 3 years ago

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 get

macro_rules! println {
    () => ($crate::print!("\n"));
    ($($arg:tt)*) => ({
        $crate::io::_print($crate::format_args_nl!($($arg)*));
    })
}

and can't click on _print, for example.

Here are various ideas, in order of how hard I expect them to be:

flodiebold commented 3 years ago

(Labeling actionable for the first part, which I think should be pretty doable.)