Skip to content

Commit 7fcc44c

Browse files
author
Eric Amodio
committed
Updates view progress proposal - microsoft#92421
1 parent 83c5b1c commit 7fcc44c

7 files changed

Lines changed: 11 additions & 29 deletions

File tree

src/vs/platform/progress/common/progress.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,7 @@ export const enum ProgressLocation {
4545
Extensions = 5,
4646
Window = 10,
4747
Notification = 15,
48-
Dialog = 20,
49-
View = 25
48+
Dialog = 20
5049
}
5150

5251
export interface IProgressOptions {

src/vs/vscode.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7932,7 +7932,7 @@ declare module 'vscode' {
79327932
/**
79337933
* The location at which progress should show.
79347934
*/
7935-
location: ProgressLocation;
7935+
location: ProgressLocation | { viewId: string };
79367936

79377937
/**
79387938
* A human-readable string which will be used to describe the

src/vs/vscode.proposed.d.ts

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1891,23 +1891,4 @@ declare module 'vscode' {
18911891

18921892
//#endregion
18931893

1894-
//#region https://github.com/microsoft/vscode/issues/92421
1895-
1896-
export enum ProgressLocation {
1897-
/**
1898-
* Show progress for a view, as progress bar inside the view (when visible),
1899-
* and as an overlay on the activity bar icon. Doesn't support cancellation or discrete progress.
1900-
*/
1901-
View = 25,
1902-
}
1903-
1904-
export interface ProgressOptions {
1905-
/**
1906-
* The target view identifier for showing progress when using [ProgressLocation.View](#ProgressLocation.View).
1907-
*/
1908-
viewId?: string
1909-
}
1910-
1911-
//#endregion
1912-
19131894
}

src/vs/workbench/api/common/extHost.api.impl.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
540540
return extHostProgress.withProgress(extension, { location: extHostTypes.ProgressLocation.SourceControl }, (progress, token) => task({ report(n: number) { /*noop*/ } }));
541541
},
542542
withProgress<R>(options: vscode.ProgressOptions, task: (progress: vscode.Progress<{ message?: string; worked?: number }>, token: vscode.CancellationToken) => Thenable<R>) {
543-
if (options.location === extHostTypes.ProgressLocation.View) {
543+
if (typeof options.location !== 'number') {
544544
checkProposedApiEnabled(extension);
545545
}
546546
return extHostProgress.withProgress(extension, options, task);

src/vs/workbench/api/common/extHostProgress.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ export class ExtHostProgress implements ExtHostProgressShape {
2424

2525
withProgress<R>(extension: IExtensionDescription, options: ProgressOptions, task: (progress: Progress<IProgressStep>, token: CancellationToken) => Thenable<R>): Thenable<R> {
2626
const handle = this._handles++;
27-
const { title, location, cancellable, viewId } = options;
27+
const { title, location, cancellable } = options;
2828
const source = localize('extensionSource', "{0} (Extension)", extension.displayName || extension.name);
2929

30-
this._proxy.$startProgress(handle, { location: ProgressLocation.from(location, viewId), title, source, cancellable }, extension);
30+
this._proxy.$startProgress(handle, { location: ProgressLocation.from(location), title, source, cancellable }, extension);
3131
return this._withProgress(handle, task, !!cancellable);
3232
}
3333

src/vs/workbench/api/common/extHostTypeConverters.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1093,12 +1093,15 @@ export namespace EndOfLine {
10931093
}
10941094

10951095
export namespace ProgressLocation {
1096-
export function from(loc: vscode.ProgressLocation, viewId?: string): MainProgressLocation | string {
1096+
export function from(loc: vscode.ProgressLocation | { viewId: string }): MainProgressLocation | string {
1097+
if (typeof loc === 'string') {
1098+
return loc;
1099+
}
1100+
10971101
switch (loc) {
10981102
case types.ProgressLocation.SourceControl: return MainProgressLocation.Scm;
10991103
case types.ProgressLocation.Window: return MainProgressLocation.Window;
11001104
case types.ProgressLocation.Notification: return MainProgressLocation.Notification;
1101-
case types.ProgressLocation.View: return viewId ?? '';
11021105
}
11031106
throw new Error(`Unknown 'ProgressLocation'`);
11041107
}

src/vs/workbench/api/common/extHostTypes.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2082,8 +2082,7 @@ export class Task implements vscode.Task2 {
20822082
export enum ProgressLocation {
20832083
SourceControl = 1,
20842084
Window = 10,
2085-
Notification = 15,
2086-
View = 25
2085+
Notification = 15
20872086
}
20882087

20892088
@es5ClassCompat

0 commit comments

Comments
 (0)