-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
Surface new Exception DAP in UI #22078
Comments
I've implemented a first cut of the new exception info request in node-debug. If the capability object returned from the InitializeRequest has a value true for the The The additional information (for now) is the |
This has been done by @michelkaporin in #22948 |
Tried it out and it looks good to me. |
@isidorn The stack trace is surrounded by quotes because it is a "string" value (and we always do the value formatting in the backend so that VS Code does not have to second guess). So I will remove the quotes in this case. @michelkaporin I suggest to introduce some space between the exception description ("Unhandled exception has occurred....") and the stack trace (e.g. 1/2 a line). Without this the UI looks a bit crammed. |
I'm removing the quotes from the stacktrace now: |
Btw I just took a PR to apply sourcemaps to stacktraces. I think it will look very nice with this widget. |
But this requires the ExceptionInfo request for node2... |
I have an issue to implement it for node2 |
@weinand You've mentioned:
Sometimes
My proposal would be to fall back to the UI case when DA does not support Would be good to hear @isidorn opinion also. This decision is needed as part of fixing #23388. |
If details (and hence the stacktrace) is missing we should still continue to use the new layout and not fallback to the old layout. The rational behind this is as follows: |
I agree with @weinand |
the latest DA will always return an exceptionID (as spec'ed). So this will result in:
|
Currently we don't surface exceptionID, so I would be glad to hear how do we do it in a better way, because node DA description already contains exceptionID in its current implementation. Printing it twice would make the information redundant. |
In the original protocol change request 'Exception ID' got this example usage:
In VS it is shown prominently as the title: So my proposal would be:
|
Since the description is optional, I'm planning to omit the description if it already appears in the stack trace. @michelkaporin Please make sure that there are not two empty lines in that case. |
@roblourens VS Code now uses the following layout for the exception peek UI:
To avoid duplication of the description ("Error: heello" from above), I'm now omitting the description from the response if it already appears at the beginning of the stack trace (I prefer this approach over removing the first line from the stacktrace because it leaves the stacktrace intact). |
I have not pushed my changes yet to make this layout, waiting for our UI master @isidorn's feedback and then will update the widget accordingly. Hence, @roblourens you started seeing 'undefined' because of @weinand change above, which is not yet in sync with current widget UI implementation. |
Oh ok. I'll make the same change in node2. |
In the last milestone we've added new debug adapter protocol to retrieve information about a thrown exception and we've introduced a peek UI to show this information to the user.
Now we have to bring both things together.
The text was updated successfully, but these errors were encountered: