From 34ca0e86711037b0a30aad7911d31fd797baa917 Mon Sep 17 00:00:00 2001 From: Anthony Dresser Date: Thu, 23 May 2019 14:08:37 -0700 Subject: [PATCH] fix editors being disposed multiple times (#5594) --- .../parts/query/browser/queryEditor.ts | 26 +------------------ 1 file changed, 1 insertion(+), 25 deletions(-) diff --git a/src/sql/workbench/parts/query/browser/queryEditor.ts b/src/sql/workbench/parts/query/browser/queryEditor.ts index 5f6aff27f3..2079665794 100644 --- a/src/sql/workbench/parts/query/browser/queryEditor.ts +++ b/src/sql/workbench/parts/query/browser/queryEditor.ts @@ -100,8 +100,7 @@ export class QueryEditor extends BaseEditor { parent.appendChild(splitviewContainer); - this.splitview = new SplitView(splitviewContainer, { orientation: Orientation.VERTICAL }); - this._register(this.splitview); + this.splitview = this._register(new SplitView(splitviewContainer, { orientation: Orientation.VERTICAL })); this._register(this.splitview.onDidSashReset(() => this.splitview.distributeViewSizes())); this.textEditorContainer = DOM.$('.text-editor-container'); @@ -345,13 +344,6 @@ export class QueryEditor extends BaseEditor { } } - public dispose(): void { - this.textEditor.dispose(); - this.resultsEditor.dispose(); - this.splitview.dispose(); - super.dispose(); - } - public close(): void { let queryInput: QueryInput = this.input; queryInput.sql.close(); @@ -490,20 +482,4 @@ export class QueryEditor extends BaseEditor { public chart(dataId: { batchId: number, resultId: number }) { this.resultsEditor.chart(dataId); } - - /** - * Sets the text selection for the SQL editor based on the given ISelectionData. - */ - private _setSelection(selection: ISelectionData): void { - let rangeConversion: IRange = { - startLineNumber: selection.startLine + 1, - startColumn: selection.startColumn + 1, - endLineNumber: selection.endLine + 1, - endColumn: selection.endColumn + 1 - }; - let editor = this.textEditor.getControl(); - editor.revealRange(rangeConversion); - editor.setSelection(rangeConversion); - editor.focus(); - } }