feat: Allow DapToggleBreakpoint for placing conditional breakpoints #1325
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi,
I was looking for a way of creating conditional breakpoints through user commands and the easiest solution is to allow
DapToggleBreakpoint
to take additional args and pass them all as condition intodap.toggle_breakpoint
. Since user can place two types of BPs now, I also made sure said command only removes BP when invoked with the same condition, in other cases it replaces the BP which is intuitive when you wish to change the condition or turn un-conditional BP into the conditional one.The only problem I'm a bit concerned about is that when you have a conditional BP, calling
:DapToggleBreakpoint
(without args) would change it into un-conditional one (instead of removing) which might be a bit confusing. I could adjust this so calling command without args at existing BP would always disable it, no matter condition. But I think this is just a minor inconvenience and depends on preference.Cheers!
Relates: #670
2024-08-27_19-11-50.mp4