Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestions don't work in closures #1015

Open
marmistrz opened this issue Jan 31, 2019 · 1 comment
Open

Suggestions don't work in closures #1015

marmistrz opened this issue Jan 31, 2019 · 1 comment

Comments

@marmistrz
Copy link

marmistrz commented Jan 31, 2019

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.

@Xanewok
Copy link
Collaborator

Xanewok commented Feb 5, 2019

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 #935

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants