-
Notifications
You must be signed in to change notification settings - Fork 517
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
"Did you mean ...?" suggestions for misspelled commands #2844
Comments
👍 In Fwiw, I'd very much like to see this in |
I've long though we should have Jaro/Damerau-Levenstein in the |
Yeah I don't have any opposition to that. The See rebar3/apps/rebar/src/rebar_core.erl Lines 97 to 107 in a16f41a
|
Seems like I triggered one of my collegues at Erlang/OTP team, so we will soon see a PR for this in the Erlang/OTP repo. |
Ah, I had actually already started on a PR to Erlang/OTP. I will submit what I have upstream and they can take it over or supersede it if they'd like :) |
Thats what you get when you use gossip as coordination protocol :) Always good to have more implementation to take inspiration from! |
If we do depend on the Erlang/OTP module, we'll need to do a dynamic check to avoid failing when running on older releases. It's rather straightforward, just something we need to make an exception for. |
Some CLI tools make suggestions when you mistype a command. For example with Mix or Cargo:
They find any commands where the edit distance to the input command is above some threshold. Mix uses Jaro distance while Cargo uses Damerau–Levenshtein.
I think it would be an easy QoL win to add this to rebar. Elixir's
String.jaro_distance/2
is not a very large chunk of code when translated / vendored: https://gist.github.com/the-mikedavis/db39019721fab873980df3560345a93b. Then any places that return an error message thatCommand ~ts not found
can suggest#provider.name
s where the jaro distance is close enough to1.0
(Mix uses0.8
).What do you think? I could submit a PR if you're interested.
The text was updated successfully, but these errors were encountered: