Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/src/vs/workbench/contrib/notebook/common/notebookExecutionService.ts
3296 views
1
/*---------------------------------------------------------------------------------------------
2
* Copyright (c) Microsoft Corporation. All rights reserved.
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
*--------------------------------------------------------------------------------------------*/
5
6
import { IDisposable } from '../../../../base/common/lifecycle.js';
7
import { IContextKeyService } from '../../../../platform/contextkey/common/contextkey.js';
8
import { createDecorator } from '../../../../platform/instantiation/common/instantiation.js';
9
import { NotebookCellTextModel } from './model/notebookCellTextModel.js';
10
import { INotebookTextModel, IOutputDto, IOutputItemDto } from './notebookCommon.js';
11
import { INotebookCellExecution } from './notebookExecutionStateService.js';
12
13
export enum CellExecutionUpdateType {
14
Output = 1,
15
OutputItems = 2,
16
ExecutionState = 3,
17
}
18
19
export interface ICellExecuteOutputEdit {
20
editType: CellExecutionUpdateType.Output;
21
cellHandle: number;
22
append?: boolean;
23
outputs: IOutputDto[];
24
}
25
26
export interface ICellExecuteOutputItemEdit {
27
editType: CellExecutionUpdateType.OutputItems;
28
append?: boolean;
29
outputId: string;
30
items: IOutputItemDto[];
31
}
32
33
export const INotebookExecutionService = createDecorator<INotebookExecutionService>('INotebookExecutionService');
34
35
export interface INotebookExecutionService {
36
_serviceBrand: undefined;
37
38
executeNotebookCells(notebook: INotebookTextModel, cells: Iterable<NotebookCellTextModel>, contextKeyService: IContextKeyService): Promise<void>;
39
cancelNotebookCells(notebook: INotebookTextModel, cells: Iterable<NotebookCellTextModel>): Promise<void>;
40
cancelNotebookCellHandles(notebook: INotebookTextModel, cells: Iterable<number>): Promise<void>;
41
registerExecutionParticipant(participant: ICellExecutionParticipant): IDisposable;
42
}
43
44
export interface ICellExecutionParticipant {
45
onWillExecuteCell(executions: INotebookCellExecution[]): Promise<void>;
46
}
47
48