@codingame/monaco-vscode-notebook-service-override 3.2.3 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/notebook.js +13 -13
- package/package.json +2 -2
- package/external/rollup-plugin-styles/dist/runtime/inject-css.js +0 -3
- package/external/tslib/tslib.es6.js +0 -11
- package/override/vs/platform/dialogs/common/dialogs.js +0 -8
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/emptyTextEditorHint/emptyTextEditorHint.css.js +0 -6
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/emptyTextEditorHint/emptyTextEditorHint.js +0 -389
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellCommands/cellCommands.js +0 -608
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/contributedStatusBarItemController.js +0 -109
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/statusBarProviders.js +0 -173
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/clipboard/notebookClipboard.js +0 -488
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/debug/notebookBreakpoints.js +0 -106
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/debug/notebookCellPausing.js +0 -67
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/debug/notebookDebugDecorations.js +0 -165
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/editorHint/emptyCellEditorHint.js +0 -67
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/editorStatusBar/editorStatusBar.js +0 -320
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/execute/executionEditorProgress.js +0 -72
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/media/notebookFind.css.js +0 -6
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFind.js +0 -168
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/format/formatting.js +0 -209
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/gettingStarted/notebookGettingStarted.js +0 -84
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/kernelDetection/notebookKernelDetection.js +0 -82
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/layout/layoutActions.js +0 -67
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/marker/markerProvider.js +0 -91
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/navigation/arrow.js +0 -393
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariableContextKeys.js +0 -5
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariables.js +0 -97
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesDataSource.js +0 -118
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesTree.js +0 -59
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesView.js +0 -148
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/outline/notebookOutline.js +0 -383
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/profile/notebookProfile.js +0 -77
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/saveParticipants/saveParticipants.js +0 -511
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/troubleshoot/layout.js +0 -159
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/undoRedo/notebookUndoRedo.js +0 -56
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/viewportWarmup/viewportWarmup.js +0 -94
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/apiActions.js +0 -51
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions.js +0 -565
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebookChatContext.js +0 -31
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebookChatController.js +0 -744
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/executeActions.js +0 -707
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/insertCellActions.js +0 -351
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/layoutActions.js +0 -267
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffCellEditorOptions.js +0 -45
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffComponents.js +0 -1297
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementOutputs.js +0 -284
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementViewModel.js +0 -563
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffNestedCellViewModel.js +0 -108
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/eventDispatcher.js +0 -39
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiff.css.js +0 -6
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffActions.js +0 -313
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditor.js +0 -890
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditorBrowser.js +0 -13
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffList.js +0 -393
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffOverviewRuler.js +0 -175
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebook.contribution.js +0 -1174
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookAccessibility.js +0 -159
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookExtensionPoint.js +0 -451
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookEditorServiceImpl.js +0 -192
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookExecutionServiceImpl.js +0 -106
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookExecutionStateServiceImpl.js +0 -509
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKernelHistoryServiceImpl.js +0 -130
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKernelServiceImpl.js +0 -341
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKeymapServiceImpl.js +0 -111
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookLoggingServiceImpl.js +0 -28
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookRendererMessagingServiceImpl.js +0 -65
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookServiceImpl.js +0 -641
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookWorkerServiceImpl.js +0 -200
- package/vscode/src/vs/workbench/contrib/notebook/common/model/cellEdit.js +0 -80
- package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookTextModel.js +0 -1003
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookDiffEditorInput.js +0 -103
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorModelResolverServiceImpl.js +0 -202
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookOutputRenderer.js +0 -80
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookProvider.js +0 -98
- package/vscode/src/vs/workbench/contrib/search/browser/notebookSearch/notebookSearchService.js +0 -237
- package/vscode/src/vs/workbench/services/workingCopy/common/abstractFileWorkingCopyManager.js +0 -89
- package/vscode/src/vs/workbench/services/workingCopy/common/fileWorkingCopyManager.js +0 -376
- package/vscode/src/vs/workbench/services/workingCopy/common/storedFileWorkingCopyManager.js +0 -408
- package/vscode/src/vs/workbench/services/workingCopy/common/untitledFileWorkingCopy.js +0 -144
- package/vscode/src/vs/workbench/services/workingCopy/common/untitledFileWorkingCopyManager.js +0 -129
package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookEditorServiceImpl.js
DELETED
|
@@ -1,192 +0,0 @@
|
|
|
1
|
-
import { __decorate, __param } from '../../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
-
import { ResourceMap } from 'vscode/vscode/vs/base/common/map';
|
|
3
|
-
import { getDefaultNotebookCreationOptions, NotebookEditorWidget } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/notebookEditorWidget';
|
|
4
|
-
import { DisposableStore } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
5
|
-
import { IEditorGroupsService } from 'vscode/vscode/vs/workbench/services/editor/common/editorGroupsService';
|
|
6
|
-
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
7
|
-
import { NotebookEditorInput, isCompositeNotebookEditorInput } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookEditorInput';
|
|
8
|
-
import { Emitter } from 'vscode/vscode/vs/base/common/event';
|
|
9
|
-
import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService';
|
|
10
|
-
import { IContextKeyService } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
|
|
11
|
-
import { InteractiveWindowOpen } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookContextKeys';
|
|
12
|
-
|
|
13
|
-
let NotebookEditorWidgetService = class NotebookEditorWidgetService {
|
|
14
|
-
constructor(editorGroupService, editorService, contextKeyService) {
|
|
15
|
-
this.editorGroupService = editorGroupService;
|
|
16
|
-
this._tokenPool = 1;
|
|
17
|
-
this._disposables = ( new DisposableStore());
|
|
18
|
-
this._notebookEditors = ( new Map());
|
|
19
|
-
this._onNotebookEditorAdd = ( new Emitter());
|
|
20
|
-
this._onNotebookEditorsRemove = ( new Emitter());
|
|
21
|
-
this.onDidAddNotebookEditor = this._onNotebookEditorAdd.event;
|
|
22
|
-
this.onDidRemoveNotebookEditor = this._onNotebookEditorsRemove.event;
|
|
23
|
-
this._borrowableEditors = ( new Map());
|
|
24
|
-
const groupListener = ( new Map());
|
|
25
|
-
const onNewGroup = (group) => {
|
|
26
|
-
const { id } = group;
|
|
27
|
-
const listeners = [];
|
|
28
|
-
listeners.push(group.onDidCloseEditor(e => {
|
|
29
|
-
const widgets = this._borrowableEditors.get(group.id);
|
|
30
|
-
if (!widgets) {
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
const inputs = e.editor instanceof NotebookEditorInput ? [e.editor] : (isCompositeNotebookEditorInput(e.editor) ? e.editor.editorInputs : []);
|
|
34
|
-
inputs.forEach(input => {
|
|
35
|
-
const value = widgets.get(input.resource);
|
|
36
|
-
if (!value) {
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
value.token = undefined;
|
|
40
|
-
this._disposeWidget(value.widget);
|
|
41
|
-
widgets.delete(input.resource);
|
|
42
|
-
value.widget = undefined;
|
|
43
|
-
});
|
|
44
|
-
}));
|
|
45
|
-
listeners.push(group.onWillMoveEditor(e => {
|
|
46
|
-
if (e.editor instanceof NotebookEditorInput) {
|
|
47
|
-
this._allowWidgetMove(e.editor, e.groupId, e.target);
|
|
48
|
-
}
|
|
49
|
-
if (isCompositeNotebookEditorInput(e.editor)) {
|
|
50
|
-
e.editor.editorInputs.forEach(input => {
|
|
51
|
-
this._allowWidgetMove(input, e.groupId, e.target);
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
}));
|
|
55
|
-
groupListener.set(id, listeners);
|
|
56
|
-
};
|
|
57
|
-
this._disposables.add(editorGroupService.onDidAddGroup(onNewGroup));
|
|
58
|
-
editorGroupService.whenReady.then(() => editorGroupService.groups.forEach(onNewGroup));
|
|
59
|
-
this._disposables.add(editorGroupService.onDidRemoveGroup(group => {
|
|
60
|
-
const listeners = groupListener.get(group.id);
|
|
61
|
-
if (listeners) {
|
|
62
|
-
listeners.forEach(listener => listener.dispose());
|
|
63
|
-
groupListener.delete(group.id);
|
|
64
|
-
}
|
|
65
|
-
const widgets = this._borrowableEditors.get(group.id);
|
|
66
|
-
this._borrowableEditors.delete(group.id);
|
|
67
|
-
if (widgets) {
|
|
68
|
-
for (const value of ( widgets.values())) {
|
|
69
|
-
value.token = undefined;
|
|
70
|
-
this._disposeWidget(value.widget);
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
}));
|
|
74
|
-
const interactiveWindowOpen = InteractiveWindowOpen.bindTo(contextKeyService);
|
|
75
|
-
this._disposables.add(editorService.onDidEditorsChange(e => {
|
|
76
|
-
if (e.event.kind === 4 && !interactiveWindowOpen.get()) {
|
|
77
|
-
if (editorService.editors.find(editor => editor.editorId === 'interactive')) {
|
|
78
|
-
interactiveWindowOpen.set(true);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
else if (e.event.kind === 5 && interactiveWindowOpen.get()) {
|
|
82
|
-
if (!editorService.editors.find(editor => editor.editorId === 'interactive')) {
|
|
83
|
-
interactiveWindowOpen.set(false);
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
}));
|
|
87
|
-
}
|
|
88
|
-
dispose() {
|
|
89
|
-
this._disposables.dispose();
|
|
90
|
-
this._onNotebookEditorAdd.dispose();
|
|
91
|
-
this._onNotebookEditorsRemove.dispose();
|
|
92
|
-
}
|
|
93
|
-
_disposeWidget(widget) {
|
|
94
|
-
widget.onWillHide();
|
|
95
|
-
const domNode = widget.getDomNode();
|
|
96
|
-
widget.dispose();
|
|
97
|
-
domNode.remove();
|
|
98
|
-
}
|
|
99
|
-
_allowWidgetMove(input, sourceID, targetID) {
|
|
100
|
-
const sourcePart = this.editorGroupService.getPart(sourceID);
|
|
101
|
-
const targetPart = this.editorGroupService.getPart(targetID);
|
|
102
|
-
if (sourcePart.windowId !== targetPart.windowId) {
|
|
103
|
-
return;
|
|
104
|
-
}
|
|
105
|
-
const targetWidget = this._borrowableEditors.get(targetID)?.get(input.resource);
|
|
106
|
-
if (targetWidget) {
|
|
107
|
-
return;
|
|
108
|
-
}
|
|
109
|
-
const widget = this._borrowableEditors.get(sourceID)?.get(input.resource);
|
|
110
|
-
if (!widget) {
|
|
111
|
-
throw new Error('no widget at source group');
|
|
112
|
-
}
|
|
113
|
-
this._borrowableEditors.get(sourceID)?.delete(input.resource);
|
|
114
|
-
let targetMap = this._borrowableEditors.get(targetID);
|
|
115
|
-
if (!targetMap) {
|
|
116
|
-
targetMap = ( new ResourceMap());
|
|
117
|
-
this._borrowableEditors.set(targetID, targetMap);
|
|
118
|
-
}
|
|
119
|
-
targetMap.set(input.resource, widget);
|
|
120
|
-
}
|
|
121
|
-
retrieveExistingWidgetFromURI(resource) {
|
|
122
|
-
for (const widgetInfo of ( this._borrowableEditors.values())) {
|
|
123
|
-
const widget = widgetInfo.get(resource);
|
|
124
|
-
if (widget) {
|
|
125
|
-
return this._createBorrowValue(widget.token, widget);
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
return undefined;
|
|
129
|
-
}
|
|
130
|
-
retrieveAllExistingWidgets() {
|
|
131
|
-
const ret = [];
|
|
132
|
-
for (const widgetInfo of ( this._borrowableEditors.values())) {
|
|
133
|
-
for (const widget of ( widgetInfo.values())) {
|
|
134
|
-
ret.push(this._createBorrowValue(widget.token, widget));
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
return ret;
|
|
138
|
-
}
|
|
139
|
-
retrieveWidget(accessor, group, input, creationOptions, initialDimension, codeWindow) {
|
|
140
|
-
let value = this._borrowableEditors.get(group.id)?.get(input.resource);
|
|
141
|
-
if (!value) {
|
|
142
|
-
const instantiationService = accessor.get(IInstantiationService);
|
|
143
|
-
const ctorOptions = creationOptions ?? getDefaultNotebookCreationOptions();
|
|
144
|
-
const widget = instantiationService.createInstance(NotebookEditorWidget, {
|
|
145
|
-
...ctorOptions,
|
|
146
|
-
codeWindow: codeWindow ?? ctorOptions.codeWindow,
|
|
147
|
-
}, initialDimension);
|
|
148
|
-
const token = this._tokenPool++;
|
|
149
|
-
value = { widget, token };
|
|
150
|
-
let map = this._borrowableEditors.get(group.id);
|
|
151
|
-
if (!map) {
|
|
152
|
-
map = ( new ResourceMap());
|
|
153
|
-
this._borrowableEditors.set(group.id, map);
|
|
154
|
-
}
|
|
155
|
-
map.set(input.resource, value);
|
|
156
|
-
}
|
|
157
|
-
else {
|
|
158
|
-
value.token = this._tokenPool++;
|
|
159
|
-
}
|
|
160
|
-
return this._createBorrowValue(value.token, value);
|
|
161
|
-
}
|
|
162
|
-
_createBorrowValue(myToken, widget) {
|
|
163
|
-
return {
|
|
164
|
-
get value() {
|
|
165
|
-
return widget.token === myToken ? widget.widget : undefined;
|
|
166
|
-
}
|
|
167
|
-
};
|
|
168
|
-
}
|
|
169
|
-
addNotebookEditor(editor) {
|
|
170
|
-
this._notebookEditors.set(editor.getId(), editor);
|
|
171
|
-
this._onNotebookEditorAdd.fire(editor);
|
|
172
|
-
}
|
|
173
|
-
removeNotebookEditor(editor) {
|
|
174
|
-
if (( this._notebookEditors.has(editor.getId()))) {
|
|
175
|
-
this._notebookEditors.delete(editor.getId());
|
|
176
|
-
this._onNotebookEditorsRemove.fire(editor);
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
getNotebookEditor(editorId) {
|
|
180
|
-
return this._notebookEditors.get(editorId);
|
|
181
|
-
}
|
|
182
|
-
listNotebookEditors() {
|
|
183
|
-
return ( [...this._notebookEditors].map(e => e[1]));
|
|
184
|
-
}
|
|
185
|
-
};
|
|
186
|
-
NotebookEditorWidgetService = ( __decorate([
|
|
187
|
-
( __param(0, IEditorGroupsService)),
|
|
188
|
-
( __param(1, IEditorService)),
|
|
189
|
-
( __param(2, IContextKeyService))
|
|
190
|
-
], NotebookEditorWidgetService));
|
|
191
|
-
|
|
192
|
-
export { NotebookEditorWidgetService };
|
package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookExecutionServiceImpl.js
DELETED
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
import { __decorate, __param } from '../../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
-
import { toDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
3
|
-
import { localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
4
|
-
import { ICommandService } from 'vscode/vscode/vs/platform/commands/common/commands';
|
|
5
|
-
import { ILogService } from 'vscode/vscode/vs/platform/log/common/log';
|
|
6
|
-
import { IWorkspaceTrustRequestService } from 'vscode/vscode/vs/platform/workspace/common/workspaceTrust';
|
|
7
|
-
import { KernelPickerMRUStrategy } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/viewParts/notebookKernelQuickPickStrategy';
|
|
8
|
-
import { CellKind, NotebookCellExecutionState } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
|
|
9
|
-
import { INotebookExecutionStateService } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookExecutionStateService';
|
|
10
|
-
import { INotebookKernelService, INotebookKernelHistoryService } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookKernelService';
|
|
11
|
-
|
|
12
|
-
let NotebookExecutionService = class NotebookExecutionService {
|
|
13
|
-
constructor(_commandService, _notebookKernelService, _notebookKernelHistoryService, _workspaceTrustRequestService, _logService, _notebookExecutionStateService) {
|
|
14
|
-
this._commandService = _commandService;
|
|
15
|
-
this._notebookKernelService = _notebookKernelService;
|
|
16
|
-
this._notebookKernelHistoryService = _notebookKernelHistoryService;
|
|
17
|
-
this._workspaceTrustRequestService = _workspaceTrustRequestService;
|
|
18
|
-
this._logService = _logService;
|
|
19
|
-
this._notebookExecutionStateService = _notebookExecutionStateService;
|
|
20
|
-
this.cellExecutionParticipants = ( new Set());
|
|
21
|
-
}
|
|
22
|
-
async executeNotebookCells(notebook, cells, contextKeyService) {
|
|
23
|
-
const cellsArr = Array.from(cells)
|
|
24
|
-
.filter(c => c.cellKind === CellKind.Code);
|
|
25
|
-
if (!cellsArr.length) {
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
this._logService.debug(`NotebookExecutionService#executeNotebookCells ${JSON.stringify(( cellsArr.map(c => c.handle)))}`);
|
|
29
|
-
const message = ( localizeWithPath(
|
|
30
|
-
'vs/workbench/contrib/notebook/browser/services/notebookExecutionServiceImpl',
|
|
31
|
-
'notebookRunTrust',
|
|
32
|
-
"Executing a notebook cell will run code from this workspace."
|
|
33
|
-
));
|
|
34
|
-
const trust = await this._workspaceTrustRequestService.requestWorkspaceTrust({ message });
|
|
35
|
-
if (!trust) {
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
|
-
const cellExecutions = [];
|
|
39
|
-
for (const cell of cellsArr) {
|
|
40
|
-
const cellExe = this._notebookExecutionStateService.getCellExecution(cell.uri);
|
|
41
|
-
if (!!cellExe) {
|
|
42
|
-
continue;
|
|
43
|
-
}
|
|
44
|
-
cellExecutions.push([cell, this._notebookExecutionStateService.createCellExecution(notebook.uri, cell.handle)]);
|
|
45
|
-
}
|
|
46
|
-
const kernel = await KernelPickerMRUStrategy.resolveKernel(notebook, this._notebookKernelService, this._notebookKernelHistoryService, this._commandService);
|
|
47
|
-
if (!kernel) {
|
|
48
|
-
cellExecutions.forEach(cellExe => cellExe[1].complete({}));
|
|
49
|
-
return;
|
|
50
|
-
}
|
|
51
|
-
this._notebookKernelHistoryService.addMostRecentKernel(kernel);
|
|
52
|
-
const validCellExecutions = [];
|
|
53
|
-
for (const [cell, cellExecution] of cellExecutions) {
|
|
54
|
-
if (!kernel.supportedLanguages.includes(cell.language)) {
|
|
55
|
-
cellExecution.complete({});
|
|
56
|
-
}
|
|
57
|
-
else {
|
|
58
|
-
validCellExecutions.push(cellExecution);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
if (validCellExecutions.length > 0) {
|
|
62
|
-
await this.runExecutionParticipants(validCellExecutions);
|
|
63
|
-
this._notebookKernelService.selectKernelForNotebook(kernel, notebook);
|
|
64
|
-
await kernel.executeNotebookCellsRequest(notebook.uri, ( validCellExecutions.map(c => c.cellHandle)));
|
|
65
|
-
const unconfirmed = validCellExecutions.filter(exe => exe.state === NotebookCellExecutionState.Unconfirmed);
|
|
66
|
-
if (unconfirmed.length) {
|
|
67
|
-
this._logService.debug(`NotebookExecutionService#executeNotebookCells completing unconfirmed executions ${JSON.stringify(( unconfirmed.map(exe => exe.cellHandle)))}`);
|
|
68
|
-
unconfirmed.forEach(exe => exe.complete({}));
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
async cancelNotebookCellHandles(notebook, cells) {
|
|
73
|
-
const cellsArr = Array.from(cells);
|
|
74
|
-
this._logService.debug(`NotebookExecutionService#cancelNotebookCellHandles ${JSON.stringify(cellsArr)}`);
|
|
75
|
-
const kernel = this._notebookKernelService.getSelectedOrSuggestedKernel(notebook);
|
|
76
|
-
if (kernel) {
|
|
77
|
-
await kernel.cancelNotebookCellExecution(notebook.uri, cellsArr);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
async cancelNotebookCells(notebook, cells) {
|
|
81
|
-
this.cancelNotebookCellHandles(notebook, Array.from(cells, cell => cell.handle));
|
|
82
|
-
}
|
|
83
|
-
registerExecutionParticipant(participant) {
|
|
84
|
-
this.cellExecutionParticipants.add(participant);
|
|
85
|
-
return toDisposable(() => this.cellExecutionParticipants.delete(participant));
|
|
86
|
-
}
|
|
87
|
-
async runExecutionParticipants(executions) {
|
|
88
|
-
for (const participant of this.cellExecutionParticipants) {
|
|
89
|
-
await participant.onWillExecuteCell(executions);
|
|
90
|
-
}
|
|
91
|
-
return;
|
|
92
|
-
}
|
|
93
|
-
dispose() {
|
|
94
|
-
this._activeProxyKernelExecutionToken?.dispose(true);
|
|
95
|
-
}
|
|
96
|
-
};
|
|
97
|
-
NotebookExecutionService = ( __decorate([
|
|
98
|
-
( __param(0, ICommandService)),
|
|
99
|
-
( __param(1, INotebookKernelService)),
|
|
100
|
-
( __param(2, INotebookKernelHistoryService)),
|
|
101
|
-
( __param(3, IWorkspaceTrustRequestService)),
|
|
102
|
-
( __param(4, ILogService)),
|
|
103
|
-
( __param(5, INotebookExecutionStateService))
|
|
104
|
-
], NotebookExecutionService));
|
|
105
|
-
|
|
106
|
-
export { NotebookExecutionService };
|