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

As a user I want to be able to set the exception type for exception breakpoints #11552

Closed
indiejames opened this issue Sep 5, 2016 · 10 comments
Assignees
Labels
debug Debug viewlet, configurations, breakpoints, adapter issues feature-request Request for new features or functionality
Milestone

Comments

@indiejames
Copy link

  • VSCode Version: 1.4.0
  • OS Version: 10.11.5

Currently the exception breakpoint settings apply to all types of exceptions. In many languages such as Clojure/Java, there is a hierarchy of exception classes and it is convenient to only break on specific exception types. For instance if I see an exception caused by a ClassCastException I want to be able to set a breakpoint that will only trigger for ClassCastExceptions.

I think this would merely entail an input text box for typing the class to associate with a particular breakpoint, and this could be enabled only for debug adapters that report the capability to break on specific exception types.

@dbaeumer dbaeumer added the debug Debug viewlet, configurations, breakpoints, adapter issues label Sep 6, 2016
@isidorn isidorn added the feature-request Request for new features or functionality label Sep 6, 2016
@isidorn
Copy link
Contributor

isidorn commented Sep 6, 2016

Currently our debug protocl supports that the vscode frontend can send exception filters to the backend. However the SetExceptionBreakpointsResponse would have to somehow notify vscode if an exception breakpoint is accepted or not. For instance a user could try to add a ClassCastException while debugging node and the vscode frontend would need to notify the user that this is ilegal.

Assigning first to @weinand to assess on this feature request.

@isidorn isidorn assigned weinand and unassigned isidorn Sep 6, 2016
@nbransby
Copy link

nbransby commented Sep 6, 2016

+1

@weinand
Copy link
Contributor

weinand commented Nov 9, 2016

The corresponding protocol addition is microsoft/vscode-debugadapter-node/issues/64

@weinand weinand added this to the November 2016 milestone Nov 9, 2016
@weinand
Copy link
Contributor

weinand commented Nov 14, 2016

@indiejames so your proposal would be this:

  • the user would add an exception breakpoint via some action
  • a text input box shows up where the user can enter the name of an exception class
  • the exception breakpoint shows up in the BREAKPOINTS view (maybe under a new root node)
  • the user can disable/enable the breakpoint.

In microsoft/vscode-debugadapter-node#64 it was proposed to support the following configuration options for an exception breakpoint:

  • disabled: do not break when this exception is thrown,
  • unhandled: break if the exception is unhandled,
  • userUnhandled: break if the exception is not handled by user code,
  • thrown: break when the exception is thrown.

Do these options make sense for you? Which options could your debugger support?

@weinand
Copy link
Contributor

weinand commented Nov 22, 2016

@indiejames any comments to my last comment?

@weinand weinand modified the milestones: Backlog, November 2016 Dec 5, 2016
@weinand
Copy link
Contributor

weinand commented Dec 5, 2016

We've added support for exception configuration to the debug protocol (microsoft/vscode-debugadapter-node#64).
Now we'll have to decide whether/how to surface that in the generic VS Code debugger UI.

@indiejames
Copy link
Author

@weinand Sorry, I didn't see your comments earlier. I think those options look good. I think all of those options apply to me except "unhandled". The REPL I execute code in always traps exceptions at the top level, so there are no "unhandled" exceptions. I'm not sure if I can trigger an event when that happens or not. For now these look good to me.

@weinand
Copy link
Contributor

weinand commented Apr 5, 2017

@indiejames Please see what I was able to do in the mono-debug extension without touching anything in VS Code itself:

2017-04-04_15-17-17

The code is here

@indiejames
Copy link
Author

@weinand That looks pretty good. I like the search completion to find the desired exception class. What is displayed in the Breakpoints pane of the Debug viewlet?

@weinand
Copy link
Contributor

weinand commented Apr 6, 2017

@indiejames these exception configurations don't show up in the breakpoints pane (because the UI would would not scale if you have lots of exceptions and because there is no API for adding them to the breakpoints pane). The exception configurations are managed completely independent from VS Code breakpoints in "settings" (user or workspace).

@weinand weinand modified the milestones: March 2017, Backlog Apr 6, 2017
@weinand weinand closed this as completed Apr 6, 2017
@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
Projects
None yet
Development

No branches or pull requests

5 participants