explaine.rs icon indicating copy to clipboard operation
explaine.rs copied to clipboard

Missing Hint for Lifetime annotations

Open Lotterleben opened this issue 4 years ago • 2 comments

What I expected

It would be super awesome to have a hint for ' lifetime annotations, since they're non-trivial to google for when you don't know what they're called.

Source code

I hope I'm getting the terminology right here. For the example code, I used an example from https://doc.rust-lang.org/1.9.0/book/lifetimes.html

0 | struct Foo<'a> {
  |         /* ↑ lifetime annotation */
1 |   x: &'a i32,
  |    /* ↑ lifetime annotation */
2 | }

Lotterleben avatar Sep 24 '20 17:09 Lotterleben

FYI I've deployed half a fix for this. We now highlight some lifetime generic parameters e.g. https://jrvidal.github.io/explaine.rs/?code=struct+Foo%3C%27a%3E+%7B%0A++x%3A+%26%27a+i32%0A%7D&line=0&ch=12

jrvidal avatar Dec 11 '20 11:12 jrvidal

ooooh nice! That's already a huge help, I think.

Lotterleben avatar Dec 14 '20 08:12 Lotterleben