Skip to content

Fixes #16860: Improving exception experience - #20807

Merged
Isidor Nikolic (isidorn) merged 12 commits into
microsoft:masterfrom
michelkaporin:exception-widget
Feb 21, 2017
Merged

Isidor Nikolic (isidorn) merged 12 commits into
microsoft:masterfrom
michelkaporin:exception-widget

Conversation

@michelkaporin

@michelkaporin Michel Kaporin (michelkaporin) commented Feb 17, 2017 •

Copy link
Copy Markdown
Contributor

I have added an exception widget that shows a thrown exception message in a debug mode when such occurs.

image

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.

@mention-bot

Copy link
Copy Markdown

Michel Kaporin (@michelkaporin), thanks for your PR! By analyzing the history of the files in this pull request, we identified Erich Gamma (@egamma) and Johannes Rieken (@jrieken) to be potential reviewers.

@msftclas

Hi Michel Kaporin (@michelkaporin), I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution!

In order for us to evaluate and accept your PR, we ask that you sign a contribution license agreement. It's all electronic and will take just minutes. I promise there's no faxing. https://cla.microsoft.com.

TTYL, MSBOT;

background-color: #0C141F;
}

.monaco-editor .marker-widget > .stale {

@michelkaporin Michel Kaporin (michelkaporin) Feb 20, 2017 •

Copy link
Copy Markdown
Contributor Author

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

switch (marker.severity) {
case Severity.Error:
this.options.frameColor = '#ff5a5a';
this._container.parentElement.classList.add('marker-error-widget');

Copy link
Copy Markdown
Contributor Author

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 @@
}

Copy link
Copy Markdown
Contributor Author

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;

Copy link
Copy Markdown
Contributor Author

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.

Copy link
Copy Markdown
Contributor Author

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;

Copy link
Copy Markdown
Contributor Author

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
{

Copy link
Copy Markdown
Contributor Author

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

}
}

// exception widget

Copy link
Copy Markdown
Contributor Author

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() {

Copy link
Copy Markdown
Contributor Author

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 {

Copy link
Copy Markdown
Contributor Author

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

Copy link
Copy Markdown
Contributor Author

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

@isidorn

Isidor Nikolic (isidorn) commented Feb 21, 2017 •

Copy link
Copy Markdown

Michel Kaporin (@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
Once that is done we can merge this PR in - thanks!

@michelkaporin

Copy link
Copy Markdown
Contributor Author

Isidor Nikolic (@isidorn) done. I've also noticed the background colour was applied to the arrow because it was inherited from zone-widget.css due to CSS refactoring. Please see 706773b for this.

@isidorn
Isidor Nikolic (isidorn) merged commit 8cc2b9a into microsoft:master Feb 21, 2017
@isidorn

Copy link
Copy Markdown

Michel Kaporin (@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.

@github-actions github-actions Bot locked and limited conversation to collaborators Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve exception experience

4 participants