expose a withScmViewletProgress-API

This commit is contained in:
Johannes Rieken
2017-01-16 18:11:12 +01:00
parent 1f102d1c37
commit 0c46df976e
4 changed files with 27 additions and 9 deletions

View File

@@ -17,9 +17,17 @@ export class ExtHostProgress {
}
withWindowProgress<R>(task: (progress: Progress<string>, token: CancellationToken) => Thenable<R>): Thenable<R> {
return this._withProgress('window', task);
}
withScmViewletProgress<R>(task: (progress: Progress<number>) => Thenable<R>): Thenable<R> {
return this._withProgress('scm', task);
}
private _withProgress<R>(type: string, task: (progress: Progress<any>, token: CancellationToken) => Thenable<R>): Thenable<R> {
const handle = this._handles++;
this._proxy.$progressStart(handle);
this._proxy.$progressStart(handle, type);
const progress = {
report: (message: string) => {
this._proxy.$progressReport(handle, message);