-
Notifications
You must be signed in to change notification settings - Fork 28.2k
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
Debugging - UI/protocol support for "blackbox script"/"Just my code" #14728
Comments
My use case is mostly black-boxing everything required from |
@roblourens makes sense, I'll look into this. Protocol change should be possible for November. |
Cool. I can write something more comprehensive if needed. Another optional UI feature that I didn't mention is that VS and F12 collapse library code frames into one, so that you see
instead of
but you can double-click to expand |
@roblourens as you've pointed out, there are two 'UIs' possible for this feature request:
All feature requests from above ask only for the static mechanism ('black box everything'). Having only the interactive UI available would require to exclude each and every file manually (which would be a pain). I propose that we first implement the static launch config based approach for node-debug and node-debug2 (Nov) and then add the interactive UI (Dec/Jan) after we have resolved the following questions/issues:
The CDP API for Blackbox patterns is marked as experimental. So node-debug2 has to deal with the situation that the API might disappear in newer versions of node. |
I think it's unlikely that they'd remove the API entirely, but if they did, I think it would be easy to implement the same as smartStep. I think the remaining work on the debug adapter (without adding anything to the protocol) is-
And another UI thing to think about is that if we blackblox a script via the call stack, how do we unmark it? In other tools you do this by finding it in the file explorer, but that doesn't feel like the right model for us. Plus there are scripts that don't show up in our file explorer. Another option would be to add another section to the debug viewlet (like call stack, breakpoints, etc) where patterns could be added and removed. |
Protocol issue here - microsoft/vscode-debugadapter-node#87 Let's use this issue for the context menu item on the call stack. It could say "Library code" with a checkmark, or "Mark as library code"/"Unmark ...". Or something else. I like the "library code" terminology over the "blackbox script" terminology. |
'Mark as library code' might be a bit cryptic to the user as to how that changes the debugging experience for him. 'Blackbox' is more intuitive. |
'Library' is what's used by VS and F12 - it might be useful to match them. Some web developers will be more familiar with 'blackbox', but if we go that direction, we shouldn't use 'scripts'. |
@roblourens since the UI for this feature will be mostly based on context menu actions, I suggest that we try to build this first as a pure extension (and not as a generic VS Code debugger UI). However, before we can do this, the following problems must be solved:
What do you think? /cc @isidorn |
Good idea, sounds like a good time to solve those problems. |
Chrome devtools calls this "Blackboxed scripts" and VS/F12 use "Library code" and "Just my code".
This feature has been requested several times - examples,
It could be implemented entirely in the debug adapter, with a new option in the launch config, and I hope to do that to try it out. But when I've used it, I've found it most useful when I can mark a script as "library code" on the fly. For this, we would need a context menu option on the callstack which can mark/unmark a particular script as library code, debug protocol support, and a toggle button to globally enable/disable the feature. (For the last item, we could use the 'exceptionBreakpointFilters' - is there anything wrong with reusing that for something besides exception breakpoints?) We also need to persist these.
This is implemented by the chrome debugging protocol. For reference it looks like this - https://chromedevtools.github.io/debugger-protocol-viewer/v8/Debugger/#method-setBlackboxPatterns - but we really just need a message that includes a DebugProtocol.Source and the library code state. I think this is of general interest since VS implements it for Javascript, C++, C# and other languages.
Thoughts/comments?
The text was updated successfully, but these errors were encountered: