Show _ type
Hi! I think would be nice be able to see in the IDEs which type currently have the use of "", while some times is needed, I think some time is not always to guess what "" will be, for example on multiple map operations, we can use "_" because we know is implicit, but does not means also know well which is the type, specially if we change it in a prototype.
Also show this would helps readability!
Not sure I understand, do you have an example?
A simpler one:
let a: usize = vec![1, 2, 3];
// Ideally here, to show after the "_" the signature like "_ (usize)" or something like that
let b: Vec<_> = a
.into_iter()
.map(|x| x*x)
.collect()
I think it'll be best if when hovering over a selection of type we'll show the real type, but unfortunately I'm not sure how to implement this, as we have no way to map between the TypeRefId to its inferred type.
D: no way!
I personally, like the idea of see the code and see everything that we need, specially if there is several _, some code have a lot of them, hovering would works better on code that do not use much _.
@latot for this specific need:
let b= a.into_iter().map(|x| x * x).collect::<Vec<_>>();
VScode will show the correct type for b.
Not sure if this helps, and pretty sure you knew it already, but there it is.
Duplicate of #11722.