-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
Fixes #16860: Improving exception experience #20807
Conversation
@michelkaporin, thanks for your PR! By analyzing the history of the files in this pull request, we identified @egamma and @jrieken to be potential reviewers. |
Hi @michelkaporin, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution! TTYL, MSBOT; |
.monaco-editor.hc-black .marker-widget { | ||
background-color: #0C141F; | ||
} | ||
|
||
.monaco-editor .marker-widget > .stale { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not change unnecessary lines
@@ -269,11 +269,11 @@ class MarkerNavigationWidget extends ZoneWidget { | |||
// update frame color (only applied on 'show') | |||
switch (marker.severity) { | |||
case Severity.Error: | |||
this.options.frameColor = '#ff5a5a'; | |||
this._container.parentElement.classList.add('marker-error-widget'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make sure to remove the warning class in this case, same as when you add a warning class remove the error class
@@ -16,15 +16,15 @@ | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
@@ -18,7 +18,6 @@ import { ICodeEditor, IOverlayWidget, IOverlayWidgetPosition, IViewZone, IViewZo | |||
export interface IOptions { | |||
showFrame?: boolean; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make sure that references widget, peek view widget, error list widget and breakpoint widget are rendered the same as before.
@@ -2,6 +2,7 @@ | |||
* Copyright (c) Microsoft Corporation. All rights reserved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
@@ -6,6 +6,8 @@ | |||
.monaco-editor .zone-widget .zone-widget-container.breakpoint-widget { | |||
height: 30px !important; | |||
display: flex; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try to put it in one rule together
.monaco-editor .debug-top-stack-frame-line { | ||
.monaco-editor .debug-top-stack-frame-line, | ||
.monaco-editor .debug-top-stack-frame-exception-line | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Put the bracket on the previous line
@@ -296,6 +305,47 @@ export class DebugEditorContribution implements IDebugEditorContribution { | |||
} | |||
} | |||
|
|||
// exception widget |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this public?
this.exceptionWidget.show({ lineNumber, column: 1 }, 3); | ||
} | ||
|
||
private hideExceptionWidget() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Get rid fo this method
this.exceptionWidget.hide(); | ||
} | ||
|
||
private closeExceptionWidget(): void { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to make difference between hide and close. Always destroy and recreate the widget as needed
return; | ||
} | ||
|
||
// First call stack frame is the frame where exception has been thrown |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Callstack can be an empty array in some corner cases
…g/error class application.
@michelkaporin looks good! Let's just do one more thing before we merge it in. The exception widget needs to respect the column of the top stack frame. Namely it shoudl have an arrow just like the find references widget pointing to the exact column location. Currently you use column:1 |
@michelkaporin looks good, merging in. I will still test it on my machine a bit and will drop by your machine so we polish it more. |
I have added an exception widget that shows a thrown exception message in a debug mode when such occurs.
Fixes #16860.
Also removed border colours from widget options and moved it to CSS. Pointer arrow for widget colour moved also to CSS from the code.