diff --git a/src/vs/workbench/api/electron-browser/mainThreadSCM.ts b/src/vs/workbench/api/electron-browser/mainThreadSCM.ts index eb4898a7ace119f0cbaf74735428b1ad2055fd08..a0cbfcbc0fbbebb54a09f8a633273f123e3db0e9 100644 --- a/src/vs/workbench/api/electron-browser/mainThreadSCM.ts +++ b/src/vs/workbench/api/electron-browser/mainThreadSCM.ts @@ -3,7 +3,6 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { TPromise } from 'vs/base/common/winjs.base'; import { URI, UriComponents } from 'vs/base/common/uri'; import { Event, Emitter, debounceEvent } from 'vs/base/common/event'; import { assign } from 'vs/base/common/objects'; @@ -242,13 +241,13 @@ class MainThreadSCMProvider implements ISCMProvider { this.groups.splice(this.groups.elements.indexOf(group), 1); } - getOriginalResource(uri: URI): TPromise { + async getOriginalResource(uri: URI): Promise { if (!this.features.hasQuickDiffProvider) { - return TPromise.as(null); + return null; } - return TPromise.wrap(this.proxy.$provideOriginalResource(this.handle, uri, CancellationToken.None)) - .then(result => result && URI.revive(result)); + const result = await this.proxy.$provideOriginalResource(this.handle, uri, CancellationToken.None); + return result && URI.revive(result); } toJSON(): any { @@ -420,20 +419,12 @@ export class MainThreadSCM implements MainThreadSCMShape { } if (enabled) { - repository.input.validateInput = (value, pos): TPromise => { - return TPromise.wrap(this._proxy.$validateInput(sourceControlHandle, value, pos).then(result => { - if (!result) { - return undefined; - } - - return { - message: result[0], - type: result[1] - }; - })); + repository.input.validateInput = async (value, pos): Promise => { + const result = await this._proxy.$validateInput(sourceControlHandle, value, pos); + return result && { message: result[0], type: result[1] }; }; } else { - repository.input.validateInput = () => TPromise.as(undefined); + repository.input.validateInput = async () => undefined; } }