@kkdev92/vscode-ext-kit - v4.1.1
    Preparing search index...

    Interface OperationProgress

    Progress sessions scoped to one operation.

    The task's signal is the Operation signal and the user's cancel button linked into one: aborting either aborts the task. Without a progress capability (a headless test host, or a plan run outside VS Code) the task still runs — reports go nowhere and the signal is the operation's own.

    interface OperationProgress {
        run<T>(
            options: OperationProgressOptions,
            task: (
                progress: ProgressReporterLike,
                signal: AbortSignal,
            ) => T | Promise<T>,
        ): Promise<T>;
        steps<T extends readonly ProgressStep<unknown>[]>(
            options: OperationProgressOptions,
            ...steps: T,
        ): Promise<StepsOutcome<T>>;
    }
    Index
    • Runs steps in order, advancing the bar by each one's weight.

      Cancellation comes back as a value — { cancelled: true } with the results gathered so far — rather than as a thrown error, whether the signal aborted between steps or a running step rejected because of it. A caller therefore branches on cancelled alone instead of on cancelled and a try/catch. Any error thrown after the combined signal has aborted is treated as that cancellation; otherwise it propagates and no further step runs.

      Steps are rest arguments so the result tuple infers per step from an inline call, with no as const.

      Type Parameters

      Parameters

      Returns Promise<StepsOutcome<T>>

      const outcome = await context.progress.steps(
      { title: 'Deploying', cancellable: true },
      { label: 'Building', run: (signal) => build(signal), weight: 3 },
      { label: 'Publishing', run: (signal) => publish(signal) }
      );
      if (outcome.cancelled) return;
      const [built, published] = outcome.results;