Fix break opening SQL files (#2449)

This commit is contained in:
Karl Burtram
2018-09-06 15:46:50 -07:00
committed by GitHub
parent 7cf9217158
commit dc5408f874

View File

@@ -295,7 +295,7 @@ export class QueryEditor extends BaseEditor {
let input = <QueryInput>this.input; let input = <QueryInput>this.input;
this._createResultsEditorContainer(); this._createResultsEditorContainer();
this._createEditor(<QueryResultsInput>input.results, this._resultsEditorContainer) this._createEditor(<QueryResultsInput>input.results, this._resultsEditorContainer, this.group)
.then(result => { .then(result => {
this._onResultsEditorCreated(<any>result, input.results, this.options); this._onResultsEditorCreated(<any>result, input.results, this.options);
this.resultsEditorVisibility = true; this.resultsEditorVisibility = true;
@@ -556,8 +556,8 @@ export class QueryEditor extends BaseEditor {
if (this._isResultsEditorVisible()) { if (this._isResultsEditorVisible()) {
createEditors = () => { createEditors = () => {
return TPromise.join([ return TPromise.join([
this._createEditor(<QueryResultsInput>newInput.results, this._resultsEditorContainer), this._createEditor(<QueryResultsInput>newInput.results, this._resultsEditorContainer, this.group),
this._createEditor(<UntitledEditorInput>newInput.sql, this._sqlEditorContainer) this._createEditor(<UntitledEditorInput>newInput.sql, this._sqlEditorContainer, this.group)
]); ]);
}; };
onEditorsCreated = (result: IEditor[]) => { onEditorsCreated = (result: IEditor[]) => {
@@ -570,7 +570,7 @@ export class QueryEditor extends BaseEditor {
// If only the sql editor exists, create a promise and wait for the sql editor to be created // If only the sql editor exists, create a promise and wait for the sql editor to be created
} else { } else {
createEditors = () => { createEditors = () => {
return this._createEditor(<UntitledEditorInput>newInput.sql, this._sqlEditorContainer); return this._createEditor(<UntitledEditorInput>newInput.sql, this._sqlEditorContainer, this.group);
}; };
onEditorsCreated = (result: TextResourceEditor) => { onEditorsCreated = (result: TextResourceEditor) => {
return TPromise.join([ return TPromise.join([
@@ -602,7 +602,7 @@ export class QueryEditor extends BaseEditor {
/** /**
* Create a single editor based on the type of the given EditorInput. * Create a single editor based on the type of the given EditorInput.
*/ */
private _createEditor(editorInput: EditorInput, container: HTMLElement): TPromise<BaseEditor> { private _createEditor(editorInput: EditorInput, container: HTMLElement, group: IEditorGroup): TPromise<BaseEditor> {
const descriptor = this._editorDescriptorService.getEditor(editorInput); const descriptor = this._editorDescriptorService.getEditor(editorInput);
if (!descriptor) { if (!descriptor) {
return TPromise.wrapError(new Error(strings.format('Can not find a registered editor for the input {0}', editorInput))); return TPromise.wrapError(new Error(strings.format('Can not find a registered editor for the input {0}', editorInput)));
@@ -610,7 +610,7 @@ export class QueryEditor extends BaseEditor {
let editor = descriptor.instantiate(this._instantiationService); let editor = descriptor.instantiate(this._instantiationService);
editor.create(container); editor.create(container);
editor.setVisible(this.isVisible(), editor.group); editor.setVisible(this.isVisible(), group);
return TPromise.as(editor); return TPromise.as(editor);
} }