-
-
Notifications
You must be signed in to change notification settings - Fork 329
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
Adding command continue_always and continue_breakpoint #377
Adding command continue_always and continue_breakpoint #377
Conversation
Great stuff @tacnoman! Literally every time I leave However, I would like to discuss the behavior of those commands a bit and maybe simplify them. It looks like
So I can run something like: something.each do |x|
# some code to debug
byebug
end
# and this is the other loop in totally different place
otherthings.each do |y|
# more code to debug here
byebug
end And when I am done with the first loop, I hit Would that make sense to you? PS does it seem like we can invent a new name for |
Hi @tacnoman @bak1an, thanks for the PR and discussion! It's definitely a problem I continuously run into myself, and would love it fixed! What do you think about copying
This would involve making a backwards incompatible change on So when you're in a loop, you could say Do you think this would solve the problem? |
|
Hi @tacnoman. I decided to introduce But I think your Are you still interested in this? If yes, can you remove the |
Hello @deivid-rodriguez I'm interested yet. I should make this today. If you prefer, I can remove the command continue_breakpoint and make another PR to the future. The behavior in
With this behavior I don't need to know how many loops are sill missing // arr = long array
arr.each do |value|
byebug
puts value
end
byebug In line 2, if I continue_breakpoint (I didn't like this name too) will ignore all breakpoints in line 2 until arrive in line 7 I'll remove the continue_breakpoint, make a rebase and change the command continue_always to c[ont[inue]]! |
60f71d7
to
66a998f
Compare
I changed the code, but I kept the commit with continue_breakpoint, because if in the future we decided to create this command, we can get the code in the commit list. All tests passed Command:
I created another command file, but if you prefer i can merge with the |
@tacnoman I'm sorry I probably didn't explain my suggestion properly. I have already implemented I have looked at how it works and I like it. I'm only not convinced by the current naming but I don't have a better suggestion so let's do it as it is. Thanks and sorry for the confusion! |
Hello @deivid-rodriguez I can change again to keep only the continue_breakpoint I'll make this today at night If I think a better name, I'll change |
Thanks @tacnoman!! |
I made it When skip the breakpoint the stdio are printing the lines of code many times In Is there a way to avoid this? The command are working Another question. What's your opinion about the command called |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking great, just added a few minor comments! Also, can you rebase and add a changelog entry?
Right. It's not pretty but the only obvious solution I can think of is to do what you did: removing |
Yeah, I think it's better. The regular |
b856f87
to
412006d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than the nitpick about the test style, which I can live without, this is almost ready from my side. Only needs a changelog entry and a new row in the table of commands in the README file.
I was thinking about maybe calling this new command just |
Changed to skip |
374ce74
to
2cc914d
Compare
@deivid-rodriguez I think that all is done now :D The command is |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tacnoman Thanks for following up. I gave the diff another look and added some tiny extra comments.
Also, could you add a new changelog entry to the "Unreleased > Added" section, and a new entry with the new command the to the table of commands in the README file?
d488bd3
to
4b95ef1
Compare
Regarding the changelog entry, it could read * [#377](https://github.com/deivid-rodriguez/byebug/pull/377): `skip` to continue until the next breakpoint as long as it is different from the current one. You can use this command to get out of loops, for example ([@tacnoman]). |
Will you add in CHANGELOG or I must add? @deivid-rodriguez |
If you can add it, I appreciate it! |
Done :D |
Great, thanks also for fixing my typo in your username! :) |
Last thing missing is to add a new row for the new command to the README table. Could you do it? |
Added now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks so much! I'll merge after CI!
Appveyor is too slow, merged straight away! |
## [11.0.0] - 2019-02-15 ### Added * [#377](deivid-rodriguez/byebug#377): `skip` to continue until the next breakpoint as long as it is different from the current one. You can use this command to get out of loops, for example ([@tacnoman]). * [#524](deivid-rodriguez/byebug#524): `continue!` (or `continue unconditionally`) to continue until the end of the program regardless of the currently enabled breakpoints ([@tacnoman]). ### Fixed * [#527](deivid-rodriguez/byebug#527): `break` help text to clarify placeholders from literals. * [#528](deivid-rodriguez/byebug#528): `quit!` help to not show a space between "quit" and "!". ### Removed * Support for MRI 2.2. Byebug no longer installs on this platform.
Hello.
This PR is for this issue #366 .
I added two commands
c[ont[inue]_]a[lways]
andc[ont[inue]_]b[reak[point]]
(I can change the names if you want). The first command ignore all next breakpoints and the second ignore all breakpoints in the same file and same line.I started making a design pattern state in
ContinueCommand
, but the code started to become a few complex and I separated in two new commands.In
ContinueAlwaysCommand
, the code change thealways_run
in list command to avoid print many things in console. If you prefer I can remove this one.I wrote tests and all passed in my CI. https://travis-ci.org/tacnoman/byebug
If you want any refactor or change, ask to me and I will change.
Thanks for this.