-
Notifications
You must be signed in to change notification settings - Fork 29.4k
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
Allow debug extensions to show diagnostic information in the breakpoints view #142870
Comments
👍 I was bugging @connor4312 for unbound breakpoints in a project which has a wrong webpack output config. Due to the misconfig, the source maps are wrong. It would be helpful the unbound breakpoint has some tooltip/hover as suggested above and send to me a diagnostic/troubleshooting view. |
I think a link in the breakpoint hover message would be more discoverable |
The hover message of breakpoint is markdown, we can double check if it's |
Is it ok to just allow command links in the markdown hover @connor4312 ? I think that's discoverable, I hardly ever look at the breakpoints view in the debug pane. |
The initial comment proposed to "show markdown text below the breakpoints in the BREAKPOINTS view" which seems to be discoverable. Having the additional information in the breakpoint hover makes sense too, but that location is not very discoverable. If we go this route we should use a visual cue (e.g. a small 'i' badge in one corner of the grey breakpoint icon) to make users aware of the additional info. For this we might have to extend DAP so that a client can detect that there is "additional info". |
To me this is a natural thing to do, like hovering squiggles in the editor. When something is confusing, I hover it to get more context. To me it's less natural to set a breakpoint, see that it didn't work, then go find a different view to get context on it. |
On the other hand, command links in breakpoint messages are a vscode-specific concept in DAP, we might not like that. We can explore the breakpoints view text direction too. Are there any other uses for it except this kind of hint? |
I'm not saying that we should show the additional information in the breakpoints view only. I'd like the additional info in the breakpoint hover. My point was that most VS Code debugger users won't hover over grey breakpoints in the gutter because they already know that it means "unbound" and they do not expect to find more information there. This is different to problem icons where only the hover reveals the real info. An 'i' badge on the breakpoint icon could help here. |
If we want info in the breakpoint hover, we should add a flag to Breakpoint in DAP to indicate whether the message is markdown. Can look at The message also shows up in a native tooltip in the breakpoints view, so I'd want to switch to the custom hover for that tree, I guess. |
Here's a mockup of some text in the breakpoints view. I think this would have to be a new contribution point, with js-debug contributing a static message and turning it on and off with a context key. It doesn't fit into |
some questions/comments:
BTW, here is the original discussion for "Improving discoverability of js-debug diagnostic tool" and the corresponding js-debug feature "diagnostic tool". |
The latter. Re previous discussion: I also have never intentionally hovered over an unbound breakpoint, but maybe that's just me. I was invisioning text in the view like what Rob has in his screenshots.
I think this should be a package.json contribution with visibility driven by a |
@connor4312 how would that "when" clause look like? Please note that breakpoints in the breakpoints view are owned by VS Code and are not associated with a particular debugger. So there could be two concurrent debug sessions (e.g. one Python, one js-debug) and both Python and JS/TS breakpoints... |
In js-debug I would probably use some custom context key that I set from the extension side when I detect things are amiss.
Indeed. I don't have a good answer for this, maybe the message is shown below or otherwise visually associated with the first unbound breakpoint from that extension? |
When designing the semantics of the new contribution point, we should consider VS Code's possible strategies around the fix for #126608:
In both cases the "when" clause should only express the condition where "things are amiss", but not when to show/hide. Maybe it is even better to not support a "when" clause at all and just provide extension API like "showMessage"/"clearMessage" |
Thanks for pointing out that other issue. A dynamic |
I think we have 4 options, 3 DAP-based and 1 extension-API based:
@roblourens @connor4312 did I miss anything? My preference is option 4. |
Option 1 is actually okay for js-debug. I would just show the same message for every breakpoint, though, inviting users to use the diagnostic tool. While I can try to diagnose why a single breakpoint isn't working, doing so at runtime when the breakpoint is initially set is expensive and I would not do so without the second level action of opening the tool. However, the message could not be interpreted as command-link-capable markdown, so this would not be a particularly good experience. I think an API works for this. |
Thinking about an extension API, it's possible for a DA to talk to the EH through some channel, and I know some adapters do this already, do you think that this is common, or will the breakpoint info be totally inaccessible from the EH for some popular DAs? But since the purpose of this is specifically to drive vscode UI, it makes sense to me to have it in extension API. Does this go on the debug session, or is it global? I think session. And does it return a disposable to hide the message, with multiple calls stacking up, or should we just allow one message per session, and call it |
The common way for DA's to communicate is to use a custom DAP call and then going on a debug session makes the most sense to me. Probably one message per session. |
@roblourens I prefer your suggested
no, a DA can either send a custom event to the extension or the extension can install a |
And @connor4312 said that we should make it clear that only the extension that owns the DebugSession should use this API. I won't try to restrict any other extension from calling it and possibly wiping out the message that the DA extension set, but that would basically be misuse of the API, any API can be misused. |
Another suggestion from Kai: Instead of showing the message outright, we could show some icon indicator like a lightbulb, or warning icon like the Terminal uses. When you hover or click it, we show a box with the message. This wouldn't take up vertical space, so you wouldn't have any resize flashing from the message appearing/hiding or switching DebugSessions like mentioned above. And in case we did want to enable showing multiple messages, this would be a nicer format for that. I was wondering how much flickering there might be. When will this message be shown? Anytime there is an unbound breakpoint? If I set a breakpoint and press F5, will it be shown until the sourcemaps are loaded and the breakpoint is bound? |
A place where we have a custom icon in a viewpane header is for extensions: I can add a hover icon in the same place, and it looks like this I think this looks ok, any thoughts? I talked with @sbatten about doing this today, we decided to try to fit something in the body of the viewpane rather than customizing the header. I tried a floating icon that would overlap the breakpoints list, but I just don't think that is going to look good, and it might block a button or detail on a breakpoint row. And anything else in the view body is going to change the height, which we don't want to do. |
I like how it looks. |
I like this too! |
Looks great! |
We will try using a static message declared in the
In this case, vscode is in control of when and where to show this message. |
Code for the basic feature is in main. More code to add this message to the breakpoint hover, and to filter breakpoints by the debugger's supported language, is in a pending PR. Since the PR in js-debug will be shipped in june, and this isn't actually exposed anywhere for May, I will move this to June for testing. |
* Show unverified breakpoint warning on breakpoint hover For #142870 * Add warning icon to breakpoint hover as well * Filter breakpoint warning indicator for breakpoints in languages that the debugger supports * Update src/vs/workbench/contrib/debug/browser/breakpointEditorContribution.ts Co-authored-by: Connor Peet <[email protected]> * Fix tests * Fix tests Co-authored-by: Connor Peet <[email protected]>
js-debug has a breakpoint helper to diagnose issues. It's there and there's some heuristics for when we show a notification, but notifications are disruptive, thus the heuristics are conservative, and thus not many people know about the tool. Something that could be helpful is a contribution point that would show markdown text below the breakpoints in the BREAKPOINTS view. js-debug could embed a command link there to open the diagnostic tool, and use a
when
clause to show it at appropriate times.The text was updated successfully, but these errors were encountered: