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

Show StoppedEvent.text in the UI #3101

Closed
felixfbecker opened this issue Feb 18, 2016 · 3 comments
Closed

Show StoppedEvent.text in the UI #3101

felixfbecker opened this issue Feb 18, 2016 · 3 comments
Assignees
Labels
debug Debug viewlet, configurations, breakpoints, adapter issues feature-request Request for new features or functionality verified Verification succeeded
Milestone

Comments

@felixfbecker
Copy link
Contributor

The StoppedEvent defines a text attribute that can include the exception message if type is "exception", and I use this in my adapter:

/** Event message for "stopped" event type.
    The event indicates that the execution of the debugee has stopped due to a break condition.
    This can be caused by by a break point previously set, a stepping action has completed or by executing a debugger statement.
*/
export interface StoppedEvent extends Event {
    body: {
        /** The reason for the event (such as: 'step', 'breakpoint', 'exception', 'pause') */
        reason: string;
        /** The thread which was stopped. */
        threadId?: number;
        /** Additional information. E.g. if reason is 'exception', text contains the exception name. */
        text?: string;
    };
}

Howevery, VS Code currently ignores this.

<- stoppedEvent
StoppedEvent {
  seq: 0,
  type: 'event',
  event: 'stopped',
  body: 
   { reason: 'exception',
     threadId: 1,
     text: 'Warning: Illegal offset type' } }

image

I would expect it to show something like

Paused on exception
Warning: Illegal offset type

but it doesn't use the text at all. It is therefor not possible for my debug adapter to show the exception message to the user without creating a virtual scope "Exception" like the Node debugger does.

@weinand weinand added debug Debug viewlet, configurations, breakpoints, adapter issues feature-request Request for new features or functionality labels Feb 18, 2016
@weinand weinand assigned isidorn and unassigned weinand Feb 18, 2016
@isidorn
Copy link
Contributor

isidorn commented Feb 18, 2016

I can show it in the hover message on the exception. Notice that we have removed the exception box for this milestone.

Creating a vritual scope 'Exception' might make it more clear to the user what is going on

screen shot 2016-02-18 at 16 16 49

@isidorn isidorn added this to the Backlog milestone Feb 18, 2016
@felixfbecker
Copy link
Contributor Author

I now implemented a virtual error scope. But it doesn't make much sense. I have to go through a lot of hurdes to keep it, keep Sets and Maps of all these virtual scopes and virtual variables and stack frames. I have to take care of cases where an error occurs but the stack trace is empty (PHP Fatal Errors) and generate a virtual stack frame for the virtual scope to show up. I then have a virtual stack frame named "Error", a virtual scope named "Error" and inside it a single variable named "message" that contains the error message.

It would be much simpler and better UI if VS Code had a way to show the exception message directly.

@isidorn
Copy link
Contributor

isidorn commented Mar 1, 2016

We will show the exception message on hover over the 'paused on exception' box. This is not very visible, but I suggest we start with that.
As a workaround you can do the virtual error scope which I understand is a hurdle for you.

@isidorn isidorn modified the milestones: March 2016, Backlog Mar 1, 2016
@weinand weinand changed the title Debug: StoppedEvent.text is ignored Show StoppedEvent.text in the UI Mar 1, 2016
@isidorn isidorn closed this as completed in ff7d409 Mar 1, 2016
@isidorn isidorn assigned weinand and unassigned isidorn Mar 1, 2016
@egamma egamma mentioned this issue Mar 1, 2016
82 tasks
@weinand weinand added the verified Verification succeeded label Mar 23, 2016
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
debug Debug viewlet, configurations, breakpoints, adapter issues feature-request Request for new features or functionality verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

3 participants