VS Code API
    Preparing search index...

    Interface NotebookCellExecution

    A NotebookCellExecution is how notebook controller modify a notebook cell as it is executing.

    When a cell execution object is created, the cell enters the NotebookCellExecutionState.Pending Pending state. When start(...) is called on the execution task, it enters the NotebookCellExecutionState.Executing Executing state. When end(...) is called, it enters the NotebookCellExecutionState.Idle Idle state.

    interface NotebookCellExecution {
        cell: NotebookCell;
        executionOrder: number | undefined;
        token: CancellationToken;
        appendOutput(
            out: NotebookCellOutput | readonly NotebookCellOutput[],
            cell?: NotebookCell,
        ): Thenable<void>;
        appendOutputItems(
            items: NotebookCellOutputItem | readonly NotebookCellOutputItem[],
            output: NotebookCellOutput,
        ): Thenable<void>;
        clearOutput(cell?: NotebookCell): Thenable<void>;
        end(success: boolean | undefined, endTime?: number): void;
        replaceOutput(
            out: NotebookCellOutput | readonly NotebookCellOutput[],
            cell?: NotebookCell,
        ): Thenable<void>;
        replaceOutputItems(
            items: NotebookCellOutputItem | readonly NotebookCellOutputItem[],
            output: NotebookCellOutput,
        ): Thenable<void>;
        start(startTime?: number): void;
    }
    Index

    Properties

    The cell for which this execution has been created.

    executionOrder: number | undefined

    Set and unset the order of this cell execution.

    A cancellation token which will be triggered when the cell execution is canceled from the UI.

    Note that the cancellation token will not be triggered when the controller that created this execution uses an interrupt-handler.

    Methods

    • Clears the output of the cell that is executing or of another cell that is affected by this execution.

      Parameters

      • Optionalcell: NotebookCell

        Cell for which output is cleared. Defaults to the cell of this execution.

      Returns Thenable<void>

      A thenable that resolves when the operation finished.

    • Signal that execution has ended.

      Parameters

      • success: boolean | undefined

        If true, a green check is shown on the cell status bar. If false, a red X is shown. If undefined, no check or X icon is shown.

      • OptionalendTime: number

        The time that execution finished, in milliseconds in the Unix epoch.

      Returns void

    • Signal that the execution has begun.

      Parameters

      • OptionalstartTime: number

        The time that execution began, in milliseconds in the Unix epoch. Used to drive the clock that shows for how long a cell has been running. If not given, the clock won't be shown.

      Returns void