Skip to content

Commit 200da72

Browse files
author
Benjamin Pasero
committed
add more logging for crash (microsoft#93224)
1 parent 0b32b3c commit 200da72

2 files changed

Lines changed: 10 additions & 5 deletions

File tree

src/vs/workbench/browser/contextkeys.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,12 @@ export class WorkbenchContextKeysHandler extends Disposable {
206206

207207
if (activeEditorPane) {
208208
this.activeEditorContext.set(activeEditorPane.getId());
209-
this.activeEditorIsReadonly.set(activeEditorPane.input.isReadonly());
209+
try {
210+
this.activeEditorIsReadonly.set(activeEditorPane.input.isReadonly());
211+
} catch (error) {
212+
// TODO@ben for https://github.com/microsoft/vscode/issues/93224
213+
throw new Error(`${error.message}: editor id ${activeEditorPane.getId()}`);
214+
}
210215
} else {
211216
this.activeEditorContext.reset();
212217
this.activeEditorIsReadonly.reset();

src/vs/workbench/browser/parts/editor/editorControl.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ export interface IOpenEditorResult {
2323

2424
export class EditorControl extends Disposable {
2525

26-
get minimumWidth() { return this._activeEditorPane ? this._activeEditorPane.minimumWidth : DEFAULT_EDITOR_MIN_DIMENSIONS.width; }
27-
get minimumHeight() { return this._activeEditorPane ? this._activeEditorPane.minimumHeight : DEFAULT_EDITOR_MIN_DIMENSIONS.height; }
28-
get maximumWidth() { return this._activeEditorPane ? this._activeEditorPane.maximumWidth : DEFAULT_EDITOR_MAX_DIMENSIONS.width; }
29-
get maximumHeight() { return this._activeEditorPane ? this._activeEditorPane.maximumHeight : DEFAULT_EDITOR_MAX_DIMENSIONS.height; }
26+
get minimumWidth() { return this._activeEditorPane?.minimumWidth ?? DEFAULT_EDITOR_MIN_DIMENSIONS.width; }
27+
get minimumHeight() { return this._activeEditorPane?.minimumHeight ?? DEFAULT_EDITOR_MIN_DIMENSIONS.height; }
28+
get maximumWidth() { return this._activeEditorPane?.maximumWidth ?? DEFAULT_EDITOR_MAX_DIMENSIONS.width; }
29+
get maximumHeight() { return this._activeEditorPane?.maximumHeight ?? DEFAULT_EDITOR_MAX_DIMENSIONS.height; }
3030

3131
private readonly _onDidFocus = this._register(new Emitter<void>());
3232
readonly onDidFocus = this._onDidFocus.event;

0 commit comments

Comments
 (0)