untitled - merge createOrGet and loadOrCreate into one

This commit is contained in:
Benjamin Pasero
2020-01-09 10:25:59 +01:00
parent 4845bbbdda
commit 4f6af32f43
6 changed files with 22 additions and 28 deletions

View File

@@ -227,12 +227,12 @@ export class MainThreadDocuments implements MainThreadDocumentsShape {
}
private _doCreateUntitled(resource?: URI, mode?: string, initialValue?: string): Promise<URI> {
return this._untitledTextEditorService.loadOrCreate({
return this._untitledTextEditorService.createOrGet({
resource,
mode,
initialValue,
useResourcePath: Boolean(resource && resource.path)
}).then(model => {
}).resolve().then(model => {
const resource = model.resource;
if (!this._modelIsSynced.has(resource.toString())) {