-
Notifications
You must be signed in to change notification settings - Fork 28k
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
Extension API for enabling debug extensions to show a message in the breakpoints view #147034
Comments
Should the message be a |
Yes, thanks |
Maybe I have trust issues but I wouldn't rely on that. A debug session is public via |
Not really, they are created by vscode. We could check that extension IDs match, do we do that anywhere?
This is the
The idea is that this isn't for a particular breakpoint but just a hint about some breakpoints in general. It shows in the title bar for the breakpoints view. In general the concept is that this is a pretty simple message which is not expected to be used for rich detailed info, which is why I don't have a severity and why I prefer only showing a single message. If we allow multiple messages, then I am starting to reimplement the notifications pane and everything that entails, but I basically just want an icon with a hover tooltip. @mjbvz also suggested adding a language status bar item for it, but I'm not sure whether this sort of info is expected to go in there. |
Now, I am unsure why this is an API request and not a DAP request? Isn't the latter the better fit for something like this e.g the ownership/driver of data is clearly defined and doesn't come from "the side" via some API |
We discussed that but it doesn't seem to fit into DAP. Feels too targeted at driving a specific piece of vscode UI. This needs markdown and vscode command links which aren't in DAP. |
I would question that. From where I am, it feels much better "contained" within DAP. A good question might be how such messages are forwarded in LiveShare scenarios? You also want to reconsider allowing markdown - like you want to support links but I doubt that you want bullet lists, tables, or code listings in simple messages. |
I think that defining what markdown in DAP means is too heavy just for this little feature, unless there is some other compelling feature that needs markdown. Do you agree @connor4312 @weinand? Besides that, @weinand described the options well here: #142870 (comment) If this went in DAP, we would need something like option 3, except that I think js-debug's heuristic is more complex than "some breakpoints are unverified", so we would need a new DAP event. |
@roblourens That's exactly what I am saying, you do not want to support markdown here, not in DAP and not for this little feature. |
I agree that we do not want to introduce a "heavy" API for this "little" feature so I was thinking about lightweight alternatives... Here is one: But using notifications for the breakpoint information has (at least) two problems:
These problems could be easily addressed by introducing a new The new @roblourens @connor4312 @jrieken opinions? |
One issue with that is that it loses the connection to the DebugSession, and I really think it should be per-DebugSession. It's also not clear in that case how you get to the warning icon in the breakpoints view - can you get 3 icons depending on which show* API you called? I don't really like that. Discussing this morning, it feels like DAP is the right place for this, since that is the real source of truth for this info. Also would be nice to have some flexibility in how exactly it is displayed in the client. Learned that LSP has a markdown concept: https://microsoft.github.io/language-server-protocol/specification#markupContent. @dbaeumer I'm wondering whether that has been a source of pain for LSP clients/servers or if it has not been an issue. If we had a plain text API in DAP, at least to separate the markdown work item, would this still be useful? It can say "Run the xyz command ..." On the other hand, occurs to me that the link we are trying to show here specifically only makes sense in vscode, because the very feature we are trying to prompt (a troubleshooting tool which is a custom vscode editor) only works in vscode, that is a point for extension API. |
@roblourens no, no source of pain. What needs to be noted is that LSP has a Markup content which supports plain text and mark down. So a client can announce that it doesn't understand markdown. But the push is actually to support mark down in more areas not in less :-). |
I generally like the idea, similar to the concept of the ProgressLocation there could be a "MessageLocation" which allows to show contextual messages. Maybe that has the potential to reduce the "notification randomness". However, for this specific topic I think a targeted DAP concept makes more sense. It will allow to associate a message to a session and allow for more flexible UI, e.g show the warning in the breakpoints view and in other places like the debug toolbar or inside the editor etc. Such UI works better with "domain information" instead of a generic show message API |
@roblourens and @jrieken: thanks for the feedback - here some comments:
|
Would this go inside the debugger contribution? Needs to be localized. How would it work to reference a markdown template from a DAP message? |
A DA cannot know anything about markdown templates because they are VS Code specific. |
I don't really understand the suggestion. What would the message from DAP look like? How does the DA know that the client will use this template? |
In case of a breakpoint problem the DAP returns any of the messages listed in the first two options here. |
We will probably not add extension API for this, so we can move the discussion back to #142870 |
In #142870 we are discussing UI for an extension to show a diagnostic message in the breakpoints view. An example of using this would be for a debug extension to prompt the user about the breakpoints troubleshooting tool. This issue is for the extension API.
We could put an API on the
DebugSession
or on thedebug
namespace. We could also only allow a single message at a time, with the advice that a well-behaved extension will only use it if it is responsible for this debug type, or fully allow multiple messages (I don't have a real use-case in mind for that).Some possibilities
cc @jrieken
The text was updated successfully, but these errors were encountered: