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

Feature Request: "next"-style command that runs until the next non-gem line #215

Open
glindsey opened this issue Mar 13, 2019 · 4 comments

Comments

@glindsey
Copy link

My apologies if this has been suggested before, but I think it would be super useful to have a command that lets you run until you hit the next line of non-Rails/non-gem code.

Here's an example scenario: I'd like to use contracts.ruby to enforce calling contracts on methods. The problem I run into is that if I want to use pry-byebug to step into a method call, it ends up stepping into contracts code first. Although a workaround is possible via combinations of step, up and next, it's very easily to screw that up and end up accidentally stepping right over the method call. A single command that would run until hitting code that isn't inside a gem would be way more convenient.

If I have the time at some point, I'll see if I can delve into this myself and maybe get a PR up for it, but in the meantime I wanted to mention it. Thanks a lot!

@deivid-rodriguez
Copy link
Owner

Yes. This has been requested in byebug but I never found the time to look into it. See deivid-rodriguez/byebug#47.

@vsppedro
Copy link
Contributor

Hi, @deivid-rodriguez, I would like to work on this if you don't mind.

@deivid-rodriguez
Copy link
Owner

Sure, that'd be awesome.

@vsppedro
Copy link
Contributor

vsppedro commented Aug 20, 2020

Sorry for taking so long to ask, but what do you have in mind about what this feature should look like?

I was thinking about something like:

next --filter folder

With the possibility to pass more than one like:

next --filter models controllers

Or maybe the whole project:

next --filter .

Finally the ~/.pryrc would be able to have this configuration, for example:

if defined?(PryByebug)
  Pry.commands.alias_command 'c', 'continue'
  Pry.commands.alias_command 's', 'step --filter .'
  Pry.commands.alias_command 'n', 'next --filter .'
  Pry.commands.alias_command 'f', 'finish'
end

What do you think?

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

3 participants