-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Fix exception widget covering code lines #8344
Conversation
Signed-off-by: Doron Nahari <doron.nahari@sap.com>
7fbb54f
to
a783624
Compare
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.
Tested behavior and it seems good to me. Same as vs code.
@akosyakov can you review also the code changes? I believe most of it is yours.
I will have a look tomorrow morning. |
@@ -375,6 +375,7 @@ | |||
/** Breakpoint Widget */ | |||
.theia-debug-breakpoint-widget { | |||
display: flex; | |||
height: calc(100% - 4px); |
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.
what for is 4px? we should avoid using hardcoded numbers, is it padding then it should be derived from var(--theia-ui-padding)
@@ -411,6 +412,7 @@ | |||
white-space: pre-wrap; | |||
user-select: text; | |||
overflow: hidden; | |||
height: auto; |
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.
if there are other widgets based on zone widgets do they need to do the same now? Or it is only relevant for the exception widget?
It would be good if PR does not require adding height property. It seems to be a breaking change for all downstreams using the zone widget. Is it feasible to avoid changing styles? |
<div className='title'>{info.id ? `Exception has occurred: ${info.id}` : 'Exception has occurred.'}</div> | ||
{info.description && <div className='description'>{info.description}</div>} | ||
{stackTrace && <div className='stack-trace'>{stackTrace}</div>} | ||
</React.Fragment>, |
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.
I assume it was to resize on each rendering? Why do we need to remove it?
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.
That callback was actually did nothing (as far as i saw).
While this component is rendering the containerNode.offsetHeight
is 0
(i assume because it is not rendered yet in the zoneNode) and therefore heightInLines is 0
.
Getting the containerNode.offsetHeight
on onComputedHeight
after the viewZone has rendered, worked for me.
https://github.com/eclipse-theia/theia/pull/8344/files#diff-e36030c15530769fcd2fe88693fd3cedR139
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.
ok, it seems react semantic has changed and it is matter of rendering exception after zone
@@ -41,9 +41,12 @@ export class MonacoEditorZoneWidget implements Disposable { | |||
this.toHide | |||
); | |||
|
|||
readonly editorLineHeight: number; |
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.
i don't think it should be like that, we already capture height in zone object and options are always available from preferences.
not invasive PR is here: #8382 |
superseded by #8382 |
Signed-off-by: Doron Nahari doron.nahari@sap.com
What it does
Fix exception widget overrides code lines
Fixes one issue in #8225
How to test
Create a.js script:
Create node launcher:
From debug pane set "Uncought Exceptions" breakpoint.
Launch "Launch Program"
Before this pr the exception widget was covering the code
After, the code pushed down:
Review checklist
Reminder for reviewers