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

Provide a list of similar package names on PackageNotFound error #54

Open
colincasey opened this issue Oct 7, 2024 · 0 comments · May be fixed by #69
Open

Provide a list of similar package names on PackageNotFound error #54

colincasey opened this issue Oct 7, 2024 · 0 comments · May be fixed by #69
Labels
enhancement New feature or request

Comments

@colincasey
Copy link
Contributor

colincasey commented Oct 7, 2024

Suggestion from @schneems in the code review of #47. When a package can't be found in the index we could easily provide a list of similar names to save the user from having to look these up themselves.

[Optional suggestion/enhancement] - If we have the index with package names and we think it's mis-spelled we could use levenshtein distance to list what possible alternatives might be https://github.com/schneems/going_the_distance.

I do something like that in which_problem https://github.com/schneems/which_problem/blob/65bda424cf62bc04aa23f192e971a80e4db0ae83/which_problem/src/suggest.rs#L37-L40

@colincasey colincasey added the enhancement New feature or request label Oct 7, 2024
colincasey added a commit that referenced this issue Nov 5, 2024
When the user provides a mistyped package, we can use the package index to provide a list of suggested package names based on a Levenshtein distance. This list is limited to matches between 1 and 3 (inclusive) edit distances with a maximum of 5 results given.

Fixes #54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant