Use existing resource for untitled if it is already open (#11536)

* use existing resource for untitled if it is already open

* remove unnecessary call
This commit is contained in:
Anthony Dresser
2020-07-28 13:09:51 -07:00
committed by GitHub
parent ada8cb2f08
commit d244a14468
4 changed files with 30 additions and 4 deletions

View File

@@ -43,7 +43,7 @@ export class QueryEditorLanguageAssociation implements ILanguageAssociation {
queryEditorInput = this.instantiationService.createInstance(FileQueryEditorInput, '', activeEditor, queryResultsInput);
} else if (activeEditor instanceof UntitledTextEditorInput) {
const content = (await activeEditor.resolve()).textEditorModel.getValue();
queryEditorInput = await this.queryEditorService.newSqlEditor({ open: false, initalContent: content }) as UntitledQueryEditorInput;
queryEditorInput = await this.queryEditorService.newSqlEditor({ resource: this.editorService.isOpen(activeEditor) ? activeEditor.resource : undefined, open: false, initalContent: content }) as UntitledQueryEditorInput;
} else {
return undefined;
}