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

rerun the previous command with corrected spelling in irb. #179

Open
krsinghshubham opened this issue Oct 7, 2022 · 1 comment
Open

Comments

@krsinghshubham
Copy link

krsinghshubham commented Oct 7, 2022

as a Feature request when in IRB when did_you_mean throw us a error , can we run something to re-run the previous command with corrected spelling.
Something like how https://github.com/nvbn/thefuck does this ?
If it sounds good and get a feature-request tag i can work on this to create a PR.

@yuki24
Copy link
Member

yuki24 commented Oct 28, 2022

Thanks for your request! The language of the library isn't really appropriate, but I think it would be interesting to see a keyboard shortcut that is available on irb, that automatically replaces the code hunk that causes a NoMethodError. We should be able to detect where to fix with error_highlight, and we could probably pick the closest match, if and only if there is only one match with the edit distance <= 2.

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

No branches or pull requests

2 participants