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

Fixes #16860: Improving exception experience #20807

Merged
merged 12 commits into from
Feb 21, 2017
Merged

Fixes #16860: Improving exception experience #20807

merged 12 commits into from
Feb 21, 2017

Conversation

michelkaporin
Copy link
Contributor

@michelkaporin michelkaporin commented Feb 17, 2017

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

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

@msftclas
Copy link

Hi @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;

@isidorn isidorn self-assigned this Feb 17, 2017
@isidorn isidorn added this to the February 2017 milestone Feb 20, 2017
.monaco-editor.hc-black .marker-widget {
background-color: #0C141F;
}

.monaco-editor .marker-widget > .stale {
Copy link
Contributor Author

@michelkaporin michelkaporin Feb 20, 2017

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');
Copy link
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
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
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
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
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
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

@@ -296,6 +305,47 @@ export class DebugEditorContribution implements IDebugEditorContribution {
}
}

// exception widget
Copy link
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
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
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
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
Copy link
Contributor

isidorn commented Feb 21, 2017

@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
Contributor Author

@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 isidorn merged commit 8cc2b9a into microsoft:master Feb 21, 2017
@isidorn
Copy link
Contributor

isidorn commented Feb 21, 2017

@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