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

@@ -48,8 +48,7 @@ export class QueryEditorService implements IQueryEditorService {
public async newSqlEditor(options: INewSqlEditorOptions = {}): Promise<IConnectableInput> {
options = mixin(options, defaults, false);
// Create file path and file URI
let filePath = await this.createUntitledSqlFilePath();
let docUri: URI = URI.from({ scheme: Schemas.untitled, path: filePath });
let docUri: URI = options.resource ?? URI.from({ scheme: Schemas.untitled, path: await this.createUntitledSqlFilePath() });
// Create a sql document pane with accoutrements
const fileInput = this._editorService.createEditorInput({ forceUntitled: true, resource: docUri, mode: 'sql' }) as UntitledTextEditorInput;