racer
racer copied to clipboard
Suggestions don't work in closures
While closure are mentioned in #829, the issue seems to be completely out of sync with what racer supports. (manually annotated closures do work, so does struct member completion)
fn main() {
let r: Result<char, String> = Ok('a');
let z = r.map(|x| x.is_~);
}
should suggest e.g. is_digit. If I hover on the x in VS Code, RLS seems to somehow know that x is a char.
If I manually annotate the type
fn main() {
let r: Result<char, String> = Ok('a');
let z = r.map(|x: char| x.is_~);
}
the methods are correctly suggested.
That requires type inference implemented in Racer, which I don't believe is something that's ultimately planned. We discussed a possible approach of enhancing the Racer with the type information that RLS already has, which should solve this case.
cc https://github.com/racer-rust/racer/issues/935