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

    Interface OperationContext

    Execution context for one bounded unit of Application work.

    Identity, cancellation, a scope, a logger, timing — and the handful of services a handler body almost always reaches for. Those last are resolved lazily on first access, so an application that never notifies never builds a notifier, and one running without a quick-input capability only finds out if it asks.

    The standard service properties are shorthand, not a second service graph: context.notify, for example, resolves the exact Notifications token that an explicit inject would. context.logger is different by design: it is a child logger enriched with this Operation's fields, whereas resolving Log outside an Operation gives the Application logger. Declare token dependencies with inject where there is no context to read — a service factory, hosted service or tree-view provider.

    module.commands.handle(Clear, async (context) => {
    if (await context.notify.confirm(context.l10n.t('Clear everything?'))) {
    context.logger.info('cleared');
    }
    });
    interface OperationContext {
        ask: QuickInputService;
        commands: CommandsService;
        editors: EditorService;
        id: string;
        kind: OperationKind;
        l10n: LocalizationService;
        logger: Logger;
        name: string;
        notify: NotificationService;
        progress: OperationProgress;
        resources: ResourceScope;
        services: ServiceResolver;
        signal: AbortSignal;
        startedAt: number;
        status: StatusBarService;
    }
    Index

    Quick picks, input boxes and the wizard. Resolved on first access.

    commands: CommandsService

    Invoking commands, this application's and the platform's. Resolved on first access.

    editors: EditorService

    Reading and editing text. Resolved on first access.

    id: string

    Unique within the application run.

    What kind of work this is.

    The display language, and formatting for it. Resolved on first access.

    logger: Logger

    Logger pre-populated with the operation's fields.

    name: string

    Descriptor name, for example the command id.

    Messages and confirmations. Resolved on first access.

    Progress sessions for this operation. Headless (no UI, operation signal passthrough) when the application has no progress capability.

    resources: ResourceScope

    Disposed after the Operation settles and owns disposable transients resolved through services. Its own ResourceScope.signal is inherited unchanged from the parent scope; use context.signal for the combined Application, caller and timeout cancellation sources.

    services: ServiceResolver

    Resolves services, owning disposable transients in this operation's scope.

    signal: AbortSignal

    Aborts on application stop, caller cancellation or timeout.

    startedAt: number

    Milliseconds since the epoch when the operation started.

    Short-lived status bar messages. Resolved on first access.