diff options
Diffstat (limited to 'src/vs/workbench/browser/web.factory.ts')
-rw-r--r-- | src/vs/workbench/browser/web.factory.ts | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/src/vs/workbench/browser/web.factory.ts b/src/vs/workbench/browser/web.factory.ts index 4b271e566d4..49c7eb489e9 100644 --- a/src/vs/workbench/browser/web.factory.ts +++ b/src/vs/workbench/browser/web.factory.ts @@ -12,6 +12,9 @@ import { mark, PerformanceMark } from 'vs/base/common/performance'; import { MenuId, MenuRegistry } from 'vs/platform/actions/common/actions'; import { DeferredPromise } from 'vs/base/common/async'; import { asArray } from 'vs/base/common/arrays'; +import { IProgress, IProgressCompositeOptions, IProgressDialogOptions, IProgressNotificationOptions, IProgressOptions, IProgressStep, IProgressWindowOptions } from 'vs/platform/progress/common/progress'; +import { IObservableValue } from 'vs/base/common/observableValue'; +import { TelemetryLevel } from 'vs/platform/telemetry/common/telemetry'; let created = false; const workbenchPromise = new DeferredPromise<IWorkbench>(); @@ -108,7 +111,7 @@ export namespace env { export async function getUriScheme(): Promise<string> { const workbench = await workbenchPromise.p; - return workbench.env.uriScheme; + return workbench.env.getUriScheme(); } /** @@ -119,4 +122,22 @@ export namespace env { return workbench.env.openUri(target); } + + export const telemetryLevel: Promise<IObservableValue<TelemetryLevel>> = + workbenchPromise.p.then(workbench => workbench.env.telemetryLevel); +} + +export namespace window { + + /** + * {@linkcode IWorkbench.window IWorkbench.window.withProgress} + */ + export async function withProgress<R>( + options: IProgressOptions | IProgressDialogOptions | IProgressNotificationOptions | IProgressWindowOptions | IProgressCompositeOptions, + task: (progress: IProgress<IProgressStep>) => Promise<R> + ): Promise<R> { + const workbench = await workbenchPromise.p; + + return workbench.window.withProgress(options, task); + } } |