提交 65a420e3 编写于 作者: J Joao Moreno

remove TPromise

related to #64596
上级 093bb84d
......@@ -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<URI> {
async getOriginalResource(uri: URI): Promise<URI> {
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<IInputValidation | undefined> => {
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<IInputValidation | undefined> => {
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;
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册