Skip to content

Make suggestions based on Levenshtein distance #1816

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

Closed
kinnison opened this issue Apr 28, 2019 · 3 comments
Closed

Make suggestions based on Levenshtein distance #1816

kinnison opened this issue Apr 28, 2019 · 3 comments

Comments

@kinnison
Copy link
Contributor

Describe the problem you are trying to solve

From time to time people have difficulty installing components because of typos. Sometimes they're even really hard to spot, particularly for those who are dyslexic. For example, recently someone had difficulty installing the rls component because they kept typing rsl but reading it as rls and so couldn't tell what was wrong.

Describe the solution you'd like

Whenever we issue a component-not-found or target-not-found etc, consider adding a quick check of the available components/targets, sort them by levenshtein distance, and suggest the nearest one.

Notes

That way, instead of:

$ rustup component add rsl
error: toolchain 'stable-x86_64-unknown-linux-gnu' does not contain component 'rsl' for target 'x86_64-unknown-linux-gnu'

We'd maybe get something like:

$ rustup component add rsl
error: toolchain 'stable-x86_64-unknown-linux-gnu' does not contain component 'rsl' for target 'x86_64-unknown-linux-gnu' - Did you perhaps mean 'rls` ?
@hrvolapeter
Copy link
Member

I would like to take this one

@kinnison
Copy link
Contributor Author

Hi @retep007 and thanks for being interested in helping on Rustup.

We hang out on Discord: https://discord.gg/cKdYFVz and we'd be pleased to discuss this with you on there.

@kinnison
Copy link
Contributor Author

kinnison commented May 9, 2019

Closed in #1824

@kinnison kinnison closed this as completed May 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants