Description
It is now about the 20th time that I wished I had this feature, so I'm finally filing this feature request.
I think the UX around breakpoint hit conditions can be improved.
Similar to log points I find breakpoint conditions not very accessible (but this might be a personal preference). Thus, I rarely use them even though they could solve some problems I encounter during debugging.
Maybe this is because I'm usually using the mouse when debugging and "programming" the right stop condition requires context switches. Or because they require too many clicks to be setup. Whenever I use breakpoint hit conditions, I feel slow.
This feature is about making breakpoint hit conditions a little bit more accessible.
The Feature
It would be really nice if I could simply exclude a caller from a breakpoint hit condition:
If a breakpoint is hit and the statement that the breakpoint is on is about to be executed, I want to be able to right-click on some stack frame and have an option "Don't trigger breakpoint in this context".
If I click on it, the breakpoint hit condition should be extended to return false
when the selected stack frame is still on the stack.
This way, this breakpoint would never be hit when called from renderLine
(because renderLine
is spammy, which makes it difficult to debug the actually problematic context):
Implementation Details
This requires a small UI part (an additional context menu entry) and a larger debug adapter part (figuring out how to formalute the exclusion as valid JS condition, probably involving new Error().stack
).
More Ideas
I think these contextual actions make hit conditions way easier to use.
Maybe something like this could also make sense for the watch view - "Restrict hit condition to x === 1
" (or x !== 1
), if x
currently is 1
.