Skip to content
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

Clarify documentation on when and where the 'text' for StoppedEvent shows up in the UI #104475

Closed
polinasok opened this issue Aug 11, 2020 · 10 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug debug Debug viewlet, configurations, breakpoints, adapter issues verified Verification succeeded
Milestone

Comments

@polinasok
Copy link

My goal is to implement a StoppedEvent when a go program stops due to a segfault. I am considering setting the event's reason to 'exception' or maybe something more custom, but in either case I need a way to report the detailed error to the user. The spec says

   /**
     * Additional information. E.g. if reason is 'exception', text contains the exception name. This string is shown in the UI.
     */
    text?: string;

I am setting 'text' in the event I send to the client:

[-> to client]{"seq":0,"type":"event","event":"stopped","body":{"reason":"exception","threadId":1,"text":"bad access","allThreadsStopped":true}}

But I do not see it displayed anywhere in the UI, including when I hover as suggested in #3101
image
Is this feature still operational? Should it work with any reason? Where should it appear? The only related issue I found is #63416, which suggests that this feature worked a while back, but doesn't offer any screenshots with the details.

@weinand
Copy link
Contributor

weinand commented Aug 11, 2020

@polinasok the DAP spec does not know what exact UI a DAP client uses. So the description of the "text" property is accurate.
If you do not see the "text" showing up anywhere in VS Code, then it makes sense to create an issue against VS Code.
BTW, please note that DAP has an ExceptionInfo request to provide additional information about an exception.

@isidorn where does VS Code show the "text" property? Is it on hover?

@weinand weinand self-assigned this Aug 11, 2020
@isidorn
Copy link
Contributor

isidorn commented Aug 11, 2020

It is shown on the hover of the "PAUSED ON EXCEPTION" element.
Code pointer

this.pauseMessageLabel.title = thread.stoppedDetails.text || '';

@weinand weinand closed this as completed Aug 11, 2020
@hyangah
Copy link

hyangah commented Aug 12, 2020

FYI when debugging javascript, I couldn't hover of the PAUSED ON EXCEPTION because the 'profile' button always appears and interferes. But I do see some exception details in the code section. Not sure though if that's from the ExceptionInfo response or the text property.
Screen Shot 2020-08-11 at 7 57 30 PM

@weinand
Copy link
Contributor

weinand commented Aug 12, 2020

@hyangah the exception details are coming from the ExceptionInfo request.

@isidorn are you aware of the "profile"button interaction?

@isidorn
Copy link
Contributor

isidorn commented Aug 12, 2020

@weinand @hyangah I missed the "profile" button interaction.
A workaround would be to show it as hover over the whole session element. Currently on hover it just says "Session" which is not that useful. What do you think?

@weinand weinand transferred this issue from microsoft/debug-adapter-protocol Aug 12, 2020
@weinand
Copy link
Contributor

weinand commented Aug 12, 2020

I've moved the issue to VS Code because the discussion has revealed a VS Code implementation issue.

@weinand weinand added the debug Debug viewlet, configurations, breakpoints, adapter issues label Aug 12, 2020
@weinand weinand reopened this Aug 12, 2020
@isidorn isidorn added the bug Issue identified by VS Code Team member as probable bug label Aug 12, 2020
@isidorn isidorn added this to the August 2020 milestone Aug 12, 2020
@isidorn
Copy link
Contributor

isidorn commented Aug 12, 2020

Ok. I will make the change as I suggested above, hover over the whole Session element will show the text if adapter provided it.
@doudou you can try it out with vscode insiders starting from Friday.

@polinasok
Copy link
Author

I am able to get the hover when raising an exception in Python. The log shows:

                 "type": "event", 
                 "event": "stopped", 
                 "body": {
                     "preserveFocusHint": false, 
                     "description": "('spam', 'eggs')", 
                     "text": "Exception", 
                     "allThreadsStopped": true, 
                     "reason": "exception", 
                     "threadId": 1
                 }

image

Setting the exact same stopped event fields in my new Go adapter:

{"seq":0,"type":"event","event":"stopped","body":{"reason":"exception","description":"Some description","threadId":1,"text":"Exception","allThreadsStopped":true}}

I get very different UI behavior. Description is ignored.
image
When I hover, "paused on exception" turns into a control panel
image

So there seems to be more to impacting what the UI shows, then just setting the fields in the Stopped Event. Perhaps, having or not having support for ExceptionInfo plays into this as well?

@weinand weinand reopened this Aug 12, 2020
@weinand
Copy link
Contributor

weinand commented Aug 12, 2020

@isidorn any additional insights?

@isidorn
Copy link
Contributor

isidorn commented Aug 13, 2020

Insiders with my fix is not yet released. Please try this out with VS Code insiders from tomorrow or next week.
As for the description of the exception, that seems like a different but similar issue, can you please file a new issue for this. Thanks

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug debug Debug viewlet, configurations, breakpoints, adapter issues verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

6 participants
@weinand @isidorn @connor4312 @hyangah @polinasok and others