Fixed #5546. Add missing line for vscode merge and wait for untitledM… (#5567)

* Fixed #5546. Add missing line for vscode merge and wait for untitledModel.load
This commit is contained in:
Yurong He
2019-05-21 18:56:28 -07:00
committed by GitHub
parent e9ddf43c6c
commit ab3a64604a
2 changed files with 4 additions and 2 deletions

View File

@@ -403,7 +403,7 @@ export class MainThreadNotebookDocumentsAndEditors extends Disposable implements
input.connectionProfile = new ConnectionProfile(this._capabilitiesService, options.connectionProfile);
if (isUntitled) {
let untitledModel = await input.textInput.resolve();
untitledModel.load();
await untitledModel.load();
input.untitledEditorModel = untitledModel;
}
let editor = await this._editorService.openEditor(input, editorOptions, viewColumnToEditorGroup(this._editorGroupService, options.position));

View File

@@ -532,7 +532,9 @@ export class EditorService extends Disposable implements EditorServiceImpl {
const untitledInput = <IUntitledResourceInput>input;
if (untitledInput.forceUntitled || !untitledInput.resource || (untitledInput.resource && untitledInput.resource.scheme === Schemas.untitled)) {
// {{SQL CARBON EDIT}}
return convertEditorInput(this.untitledEditorService.createOrGet(untitledInput.resource, untitledInput.mode, untitledInput.contents, untitledInput.encoding), undefined, this.instantiationService);
// Need to get mode for QueryEditor and Notebook
let mode: string = untitledInput.mode ? untitledInput.mode : getFileMode(this.instantiationService, untitledInput.resource);
return convertEditorInput(this.untitledEditorService.createOrGet(untitledInput.resource, mode, untitledInput.contents, untitledInput.encoding), undefined, this.instantiationService);
}
// Resource Editor Support