@codingame/monaco-vscode-notebook-service-override 25.1.2 → 26.0.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.
Files changed (94) hide show
  1. package/index.js +2 -2
  2. package/package.json +3 -3
  3. package/vscode/src/vs/workbench/contrib/codeEditor/browser/emptyTextEditorHint/emptyTextEditorHint.js +112 -94
  4. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellCommands/cellCommands.js +95 -96
  5. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellDiagnostics/cellDiagnosticEditorContrib.js +28 -19
  6. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellDiagnostics/cellDiagnosticsActions.js +15 -9
  7. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellDiagnostics/diagnosticCellStatusBarContrib.js +22 -17
  8. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/contributedStatusBarItemController.js +25 -10
  9. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/statusBarProviders.js +37 -44
  10. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/clipboard/notebookClipboard.js +211 -115
  11. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/debug/notebookBreakpoints.js +16 -18
  12. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/debug/notebookCellPausing.js +5 -8
  13. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/debug/notebookDebugDecorations.js +57 -49
  14. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/editorHint/emptyCellEditorHint.js +24 -11
  15. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/editorStatusBar/editorStatusBar.js +78 -76
  16. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/execute/executionEditorProgress.js +14 -15
  17. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFind.js +43 -28
  18. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/format/formatting.js +65 -34
  19. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/gettingStarted/notebookGettingStarted.js +19 -16
  20. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/kernelDetection/notebookKernelDetection.js +6 -10
  21. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/layout/layoutActions.js +15 -17
  22. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/marker/markerProvider.js +28 -16
  23. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/multicursor/notebookMulticursor.js +211 -170
  24. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/multicursor/notebookSelectionHighlight.js +11 -11
  25. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/navigation/arrow.js +158 -156
  26. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookInlineVariables.js +109 -105
  27. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariableContextKeys.js +1 -1
  28. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariables.js +28 -22
  29. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesDataSource.js +26 -17
  30. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesTree.js +23 -16
  31. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesView.js +72 -40
  32. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/outline/notebookOutline.js +233 -186
  33. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/profile/notebookProfile.js +22 -18
  34. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/saveParticipants/saveParticipants.js +239 -151
  35. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/troubleshoot/layout.js +85 -86
  36. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/undoRedo/notebookUndoRedo.js +25 -11
  37. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/viewportWarmup/viewportWarmup.js +13 -10
  38. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/apiActions.js +8 -5
  39. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/editActions.js +218 -196
  40. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/executeActions.js +258 -255
  41. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/layoutActions.js +106 -98
  42. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/notebookIndentationActions.js +63 -49
  43. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/sectionActions.js +55 -64
  44. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/variablesActions.js +21 -25
  45. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffActions.js +149 -129
  46. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookMultiDiffEditor.d.ts +57 -0
  47. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookMultiDiffEditor.js +286 -0
  48. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookMultiDiffEditorInput.d.ts +22 -0
  49. package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookMultiDiffEditorInput.js +82 -0
  50. package/vscode/src/vs/workbench/contrib/notebook/browser/notebook.contribution.js +452 -363
  51. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookAccessibilityHelp.js +44 -61
  52. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookAccessibleView.js +9 -11
  53. package/vscode/src/vs/workbench/contrib/notebook/browser/notebookExtensionPoint.js +203 -207
  54. package/vscode/src/vs/workbench/contrib/notebook/browser/outputEditor/notebookOutputEditor.js +148 -104
  55. package/vscode/src/vs/workbench/contrib/notebook/browser/outputEditor/notebookOutputEditorInput.js +19 -11
  56. package/vscode/src/vs/workbench/contrib/notebook/browser/replEditorAccessibleView.js +9 -11
  57. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookCellStatusBarServiceImpl.js +9 -6
  58. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookEditorServiceImpl.js +34 -22
  59. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookExecutionServiceImpl.js +29 -18
  60. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookExecutionStateServiceImpl.js +70 -52
  61. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKernelHistoryServiceImpl.js +31 -19
  62. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKernelServiceImpl.js +78 -41
  63. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKeymapServiceImpl.js +37 -27
  64. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookLoggingServiceImpl.js +9 -6
  65. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookRendererMessagingServiceImpl.js +8 -7
  66. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookServiceImpl.js +214 -119
  67. package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookWorkerServiceImpl.js +38 -36
  68. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookOutlineDataSource.js +24 -25
  69. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookOutlineDataSourceFactory.js +2 -6
  70. package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookOutlineEntryFactory.js +26 -15
  71. package/vscode/src/vs/workbench/contrib/notebook/common/model/cellEdit.js +35 -15
  72. package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookTextModel.js +468 -258
  73. package/vscode/src/vs/workbench/contrib/notebook/common/notebookDiffEditorInput.d.ts +33 -0
  74. package/vscode/src/vs/workbench/contrib/notebook/common/notebookDiffEditorInput.js +113 -0
  75. package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorModelResolverServiceImpl.js +74 -58
  76. package/vscode/src/vs/workbench/contrib/notebook/common/notebookOutputRenderer.d.ts +1 -1
  77. package/vscode/src/vs/workbench/contrib/notebook/common/notebookOutputRenderer.js +7 -10
  78. package/vscode/src/vs/workbench/contrib/notebook/common/services/notebookCellMatching.js +72 -16
  79. package/vscode/src/vs/workbench/contrib/notebook/common/services/notebookWebWorker.js +70 -51
  80. package/vscode/src/vs/workbench/contrib/replNotebook/browser/repl.contribution.js +195 -149
  81. package/vscode/src/vs/workbench/contrib/replNotebook/browser/replEditorAccessibilityHelp.js +60 -81
  82. package/vscode/src/vs/workbench/services/workingCopy/common/abstractFileWorkingCopyManager.js +7 -12
  83. package/vscode/src/vs/workbench/services/workingCopy/common/fileWorkingCopyManager.js +104 -66
  84. package/vscode/src/vs/workbench/services/workingCopy/common/storedFileWorkingCopyManager.js +115 -77
  85. package/vscode/src/vs/workbench/services/workingCopy/common/untitledFileWorkingCopy.js +42 -26
  86. package/vscode/src/vs/workbench/services/workingCopy/common/untitledFileWorkingCopyManager.js +19 -12
  87. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions.d.ts +0 -7
  88. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions.js +0 -198
  89. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebook.chat.contribution.d.ts +0 -8
  90. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebook.chat.contribution.js +0 -333
  91. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebookChatContext.d.ts +0 -2
  92. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebookChatContext.js +0 -7
  93. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/insertCellActions.d.ts +0 -13
  94. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/insertCellActions.js +0 -261
@@ -11,7 +11,14 @@ import { INotebookKernelService, INotebookKernelHistoryService } from '@codingam
11
11
  import { INotebookLoggingService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookLoggingService.service';
12
12
 
13
13
  let NotebookExecutionService = class NotebookExecutionService {
14
- constructor(_commandService, _notebookKernelService, _notebookKernelHistoryService, _workspaceTrustRequestService, _logService, _notebookExecutionStateService) {
14
+ constructor(
15
+ _commandService,
16
+ _notebookKernelService,
17
+ _notebookKernelHistoryService,
18
+ _workspaceTrustRequestService,
19
+ _logService,
20
+ _notebookExecutionStateService
21
+ ) {
15
22
  this._commandService = _commandService;
16
23
  this._notebookKernelService = _notebookKernelService;
17
24
  this._notebookKernelHistoryService = _notebookKernelHistoryService;
@@ -21,14 +28,15 @@ let NotebookExecutionService = class NotebookExecutionService {
21
28
  this.cellExecutionParticipants = ( new Set());
22
29
  }
23
30
  async executeNotebookCells(notebook, cells, contextKeyService) {
24
- const cellsArr = Array.from(cells)
25
- .filter(c => c.cellKind === CellKind.Code);
31
+ const cellsArr = Array.from(cells).filter(c => c.cellKind === CellKind.Code);
26
32
  if (!cellsArr.length) {
27
33
  return;
28
34
  }
29
35
  this._logService.debug(`Execution`, `${JSON.stringify(( cellsArr.map(c => c.handle)))}`);
30
- const message = ( localize(9685, "Executing a notebook cell will run code from this workspace."));
31
- const trust = await this._workspaceTrustRequestService.requestWorkspaceTrust({ message });
36
+ const message = ( localize(10005, "Executing a notebook cell will run code from this workspace."));
37
+ const trust = await this._workspaceTrustRequestService.requestWorkspaceTrust({
38
+ message
39
+ });
32
40
  if (!trust) {
33
41
  return;
34
42
  }
@@ -38,9 +46,17 @@ let NotebookExecutionService = class NotebookExecutionService {
38
46
  if (!!cellExe) {
39
47
  continue;
40
48
  }
41
- cellExecutions.push([cell, this._notebookExecutionStateService.createCellExecution(notebook.uri, cell.handle)]);
49
+ cellExecutions.push([
50
+ cell,
51
+ this._notebookExecutionStateService.createCellExecution(notebook.uri, cell.handle)
52
+ ]);
42
53
  }
43
- const kernel = await KernelPickerMRUStrategy.resolveKernel(notebook, this._notebookKernelService, this._notebookKernelHistoryService, this._commandService);
54
+ const kernel = await KernelPickerMRUStrategy.resolveKernel(
55
+ notebook,
56
+ this._notebookKernelService,
57
+ this._notebookKernelHistoryService,
58
+ this._commandService
59
+ );
44
60
  if (!kernel) {
45
61
  cellExecutions.forEach(cellExe => cellExe[1].complete({}));
46
62
  return;
@@ -50,8 +66,7 @@ let NotebookExecutionService = class NotebookExecutionService {
50
66
  for (const [cell, cellExecution] of cellExecutions) {
51
67
  if (!kernel.supportedLanguages.includes(cell.language)) {
52
68
  cellExecution.complete({});
53
- }
54
- else {
69
+ } else {
55
70
  validCellExecutions.push(cellExecution);
56
71
  }
57
72
  }
@@ -61,7 +76,10 @@ let NotebookExecutionService = class NotebookExecutionService {
61
76
  await kernel.executeNotebookCellsRequest(notebook.uri, ( validCellExecutions.map(c => c.cellHandle)));
62
77
  const unconfirmed = validCellExecutions.filter(exe => exe.state === NotebookCellExecutionState.Unconfirmed);
63
78
  if (unconfirmed.length) {
64
- this._logService.debug(`Execution`, `Completing unconfirmed executions ${JSON.stringify(( unconfirmed.map(exe => exe.cellHandle)))}`);
79
+ this._logService.debug(
80
+ `Execution`,
81
+ `Completing unconfirmed executions ${JSON.stringify(( unconfirmed.map(exe => exe.cellHandle)))}`
82
+ );
65
83
  unconfirmed.forEach(exe => exe.complete({}));
66
84
  }
67
85
  this._logService.debug(`Execution`, `Completed executions ${JSON.stringify(( validCellExecutions.map(exe => exe.cellHandle)))}`);
@@ -92,13 +110,6 @@ let NotebookExecutionService = class NotebookExecutionService {
92
110
  this._activeProxyKernelExecutionToken?.dispose(true);
93
111
  }
94
112
  };
95
- NotebookExecutionService = ( __decorate([
96
- ( __param(0, ICommandService)),
97
- ( __param(1, INotebookKernelService)),
98
- ( __param(2, INotebookKernelHistoryService)),
99
- ( __param(3, IWorkspaceTrustRequestService)),
100
- ( __param(4, INotebookLoggingService)),
101
- ( __param(5, INotebookExecutionStateService))
102
- ], NotebookExecutionService));
113
+ NotebookExecutionService = ( __decorate([( __param(0, ICommandService)), ( __param(1, INotebookKernelService)), ( __param(2, INotebookKernelHistoryService)), ( __param(3, IWorkspaceTrustRequestService)), ( __param(4, INotebookLoggingService)), ( __param(5, INotebookExecutionStateService))], NotebookExecutionService));
103
114
 
104
115
  export { NotebookExecutionService };
@@ -18,7 +18,12 @@ import { INotebookKernelService } from '@codingame/monaco-vscode-api/vscode/vs/w
18
18
  import { INotebookService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookService.service';
19
19
 
20
20
  let NotebookExecutionStateService = class NotebookExecutionStateService extends Disposable {
21
- constructor(_instantiationService, _logService, _notebookService, _accessibilitySignalService) {
21
+ constructor(
22
+ _instantiationService,
23
+ _logService,
24
+ _notebookService,
25
+ _accessibilitySignalService
26
+ ) {
22
27
  super();
23
28
  this._instantiationService = _instantiationService;
24
29
  this._logService = _logService;
@@ -81,7 +86,9 @@ let NotebookExecutionStateService = class NotebookExecutionStateService extends
81
86
  _onCellExecutionDidComplete(notebookUri, cellHandle, exe, lastRunSuccess) {
82
87
  const notebookExecutions = this._executions.get(notebookUri);
83
88
  if (!notebookExecutions) {
84
- this._logService.debug(`NotebookExecutionStateService#_onCellExecutionDidComplete - unknown notebook ${( notebookUri.toString())}`);
89
+ this._logService.debug(
90
+ `NotebookExecutionStateService#_onCellExecutionDidComplete - unknown notebook ${( notebookUri.toString())}`
91
+ );
85
92
  return;
86
93
  }
87
94
  exe.dispose();
@@ -100,8 +107,7 @@ let NotebookExecutionStateService = class NotebookExecutionStateService extends
100
107
  this._accessibilitySignalService.playSignal(AccessibilitySignal.notebookCellCompleted);
101
108
  }
102
109
  this._clearLastFailedCell(notebookUri);
103
- }
104
- else {
110
+ } else {
105
111
  this._accessibilitySignalService.playSignal(AccessibilitySignal.notebookCellFailed);
106
112
  this._setLastFailedCell(notebookUri, cellHandle);
107
113
  }
@@ -115,7 +121,9 @@ let NotebookExecutionStateService = class NotebookExecutionStateService extends
115
121
  _onExecutionDidComplete(notebookUri) {
116
122
  const disposables = this._notebookExecutions.get(notebookUri);
117
123
  if (!Array.isArray(disposables)) {
118
- this._logService.debug(`NotebookExecutionStateService#_onCellExecutionDidComplete - unknown notebook ${( notebookUri.toString())}`);
124
+ this._logService.debug(
125
+ `NotebookExecutionStateService#_onCellExecutionDidComplete - unknown notebook ${( notebookUri.toString())}`
126
+ );
119
127
  return;
120
128
  }
121
129
  this._notebookExecutions.delete(notebookUri);
@@ -163,14 +171,22 @@ let NotebookExecutionStateService = class NotebookExecutionStateService extends
163
171
  _createNotebookCellExecution(notebook, cellHandle) {
164
172
  const notebookUri = notebook.uri;
165
173
  const exe = this._instantiationService.createInstance(CellExecution, cellHandle, notebook);
166
- const disposable = combinedDisposable(exe.onDidUpdate(() => this._onCellExecutionDidChange(notebookUri, cellHandle, exe)), exe.onDidComplete(lastRunSuccess => this._onCellExecutionDidComplete(notebookUri, cellHandle, exe, lastRunSuccess)));
174
+ const disposable = combinedDisposable(
175
+ exe.onDidUpdate(() => this._onCellExecutionDidChange(notebookUri, cellHandle, exe)),
176
+ exe.onDidComplete(
177
+ lastRunSuccess => this._onCellExecutionDidComplete(notebookUri, cellHandle, exe, lastRunSuccess)
178
+ )
179
+ );
167
180
  this._cellListeners.set(CellUri.generate(notebookUri, cellHandle), disposable);
168
181
  return exe;
169
182
  }
170
183
  _createNotebookExecution(notebook) {
171
184
  const notebookUri = notebook.uri;
172
185
  const exe = this._instantiationService.createInstance(NotebookExecution, notebook);
173
- const disposable = combinedDisposable(exe.onDidUpdate(() => this._onExecutionDidChange(notebookUri, exe)), exe.onDidComplete(() => this._onExecutionDidComplete(notebookUri)));
186
+ const disposable = combinedDisposable(
187
+ exe.onDidUpdate(() => this._onExecutionDidChange(notebookUri, exe)),
188
+ exe.onDidComplete(() => this._onExecutionDidComplete(notebookUri))
189
+ );
174
190
  return [exe, disposable];
175
191
  }
176
192
  _setLastFailedCell(notebookURI, cellHandle) {
@@ -185,7 +201,10 @@ let NotebookExecutionStateService = class NotebookExecutionStateService extends
185
201
  visible: true
186
202
  };
187
203
  this._lastFailedCells.set(notebookURI, newLastFailedCellInfo);
188
- this._onDidChangeLastRunFailState.fire({ visible: true, notebook: notebookURI });
204
+ this._onDidChangeLastRunFailState.fire({
205
+ visible: true,
206
+ notebook: notebookURI
207
+ });
189
208
  }
190
209
  _setLastFailedCellVisibility(notebookURI, visible) {
191
210
  const lastFailedCellInfo = this._lastFailedCells.get(notebookURI);
@@ -193,10 +212,13 @@ let NotebookExecutionStateService = class NotebookExecutionStateService extends
193
212
  this._lastFailedCells.set(notebookURI, {
194
213
  cellHandle: lastFailedCellInfo.cellHandle,
195
214
  disposable: lastFailedCellInfo.disposable,
196
- visible: visible,
215
+ visible: visible
197
216
  });
198
217
  }
199
- this._onDidChangeLastRunFailState.fire({ visible: visible, notebook: notebookURI });
218
+ this._onDidChangeLastRunFailState.fire({
219
+ visible: visible,
220
+ notebook: notebookURI
221
+ });
200
222
  }
201
223
  _clearLastFailedCell(notebookURI) {
202
224
  const lastFailedCellInfo = this._lastFailedCells.get(notebookURI);
@@ -204,10 +226,13 @@ let NotebookExecutionStateService = class NotebookExecutionStateService extends
204
226
  lastFailedCellInfo.disposable?.dispose();
205
227
  this._lastFailedCells.delete(notebookURI);
206
228
  }
207
- this._onDidChangeLastRunFailState.fire({ visible: false, notebook: notebookURI });
229
+ this._onDidChangeLastRunFailState.fire({
230
+ visible: false,
231
+ notebook: notebookURI
232
+ });
208
233
  }
209
234
  _getFailedCellListener(notebook) {
210
- return notebook.onWillAddRemoveCells((e) => {
235
+ return notebook.onWillAddRemoveCells(e => {
211
236
  const lastFailedCell = this._lastFailedCells.get(notebook.uri)?.cellHandle;
212
237
  if (lastFailedCell !== undefined) {
213
238
  const lastFailedCellPos = notebook.cells.findIndex(c => c.handle === lastFailedCell);
@@ -240,12 +265,7 @@ let NotebookExecutionStateService = class NotebookExecutionStateService extends
240
265
  this._lastFailedCells.forEach(elem => elem.disposable.dispose());
241
266
  }
242
267
  };
243
- NotebookExecutionStateService = ( __decorate([
244
- ( __param(0, IInstantiationService)),
245
- ( __param(1, ILogService)),
246
- ( __param(2, INotebookService)),
247
- ( __param(3, IAccessibilitySignalService))
248
- ], NotebookExecutionStateService));
268
+ NotebookExecutionStateService = ( __decorate([( __param(0, IInstantiationService)), ( __param(1, ILogService)), ( __param(2, INotebookService)), ( __param(3, IAccessibilitySignalService))], NotebookExecutionStateService));
249
269
  class NotebookCellExecutionEvent {
250
270
  constructor(notebook, cellHandle, changed) {
251
271
  this.notebook = notebook;
@@ -272,7 +292,14 @@ class NotebookExecutionEvent {
272
292
  }
273
293
  }
274
294
  let NotebookExecutionListeners = class NotebookExecutionListeners extends Disposable {
275
- constructor(notebook, _notebookService, _notebookKernelService, _notebookExecutionService, _notebookExecutionStateService, _logService) {
295
+ constructor(
296
+ notebook,
297
+ _notebookService,
298
+ _notebookKernelService,
299
+ _notebookExecutionService,
300
+ _notebookExecutionStateService,
301
+ _logService
302
+ ) {
276
303
  super();
277
304
  this._notebookService = _notebookService;
278
305
  this._notebookKernelService = _notebookKernelService;
@@ -282,10 +309,12 @@ let NotebookExecutionListeners = class NotebookExecutionListeners extends Dispos
282
309
  this._logService.debug(`NotebookExecution#ctor ${( notebook.toString())}`);
283
310
  const notebookModel = this._notebookService.getNotebookTextModel(notebook);
284
311
  if (!notebookModel) {
285
- throw ( new Error('Notebook not found: ' + notebook));
312
+ throw ( new Error("Notebook not found: " + notebook));
286
313
  }
287
314
  this._notebookModel = notebookModel;
288
- this._register(this._notebookModel.onWillAddRemoveCells(e => this.onWillAddRemoveCells(e)));
315
+ this._register(
316
+ this._notebookModel.onWillAddRemoveCells(e => this.onWillAddRemoveCells(e))
317
+ );
289
318
  this._register(this._notebookModel.onWillDispose(() => this.onWillDisposeDocument()));
290
319
  }
291
320
  cancelAll() {
@@ -309,8 +338,7 @@ let NotebookExecutionListeners = class NotebookExecutionListeners extends Dispos
309
338
  const exe = notebookExes.get(h);
310
339
  if (exe?.state === NotebookCellExecutionState.Executing) {
311
340
  executingDeletedHandles.add(h);
312
- }
313
- else if (exe) {
341
+ } else if (exe) {
314
342
  pendingDeletedHandles.add(h);
315
343
  }
316
344
  });
@@ -322,7 +350,9 @@ let NotebookExecutionListeners = class NotebookExecutionListeners extends Dispos
322
350
  if (kernel) {
323
351
  const implementsInterrupt = kernel.implementsInterrupt;
324
352
  const handlesToCancel = implementsInterrupt ? [...executingDeletedHandles] : [...executingDeletedHandles, ...pendingDeletedHandles];
325
- this._logService.debug(`NotebookExecution#onWillAddRemoveCells, ${JSON.stringify([...handlesToCancel])}`);
353
+ this._logService.debug(
354
+ `NotebookExecution#onWillAddRemoveCells, ${JSON.stringify([...handlesToCancel])}`
355
+ );
326
356
  if (handlesToCancel.length) {
327
357
  kernel.cancelNotebookCellExecution(this._notebookModel.uri, handlesToCancel);
328
358
  }
@@ -330,36 +360,28 @@ let NotebookExecutionListeners = class NotebookExecutionListeners extends Dispos
330
360
  }
331
361
  }
332
362
  };
333
- NotebookExecutionListeners = ( __decorate([
334
- ( __param(1, INotebookService)),
335
- ( __param(2, INotebookKernelService)),
336
- ( __param(3, INotebookExecutionService)),
337
- ( __param(4, INotebookExecutionStateService)),
338
- ( __param(5, ILogService))
339
- ], NotebookExecutionListeners));
363
+ NotebookExecutionListeners = ( __decorate([( __param(1, INotebookService)), ( __param(2, INotebookKernelService)), ( __param(3, INotebookExecutionService)), ( __param(4, INotebookExecutionStateService)), ( __param(5, ILogService))], NotebookExecutionListeners));
340
364
  function updateToEdit(update, cellHandle) {
341
365
  if (update.editType === CellExecutionUpdateType.Output) {
342
366
  return {
343
367
  editType: CellEditType.Output,
344
368
  handle: update.cellHandle,
345
369
  append: update.append,
346
- outputs: update.outputs,
370
+ outputs: update.outputs
347
371
  };
348
- }
349
- else if (update.editType === CellExecutionUpdateType.OutputItems) {
372
+ } else if (update.editType === CellExecutionUpdateType.OutputItems) {
350
373
  return {
351
374
  editType: CellEditType.OutputItems,
352
375
  items: update.items,
353
376
  append: update.append,
354
377
  outputId: update.outputId
355
378
  };
356
- }
357
- else if (update.editType === CellExecutionUpdateType.ExecutionState) {
379
+ } else if (update.editType === CellExecutionUpdateType.ExecutionState) {
358
380
  const newInternalMetadata = {};
359
- if (typeof update.executionOrder !== 'undefined') {
381
+ if (typeof update.executionOrder !== "undefined") {
360
382
  newInternalMetadata.executionOrder = update.executionOrder;
361
383
  }
362
- if (typeof update.runStartTime !== 'undefined') {
384
+ if (typeof update.runStartTime !== "undefined") {
363
385
  newInternalMetadata.runStartTime = update.runStartTime;
364
386
  }
365
387
  return {
@@ -368,7 +390,7 @@ function updateToEdit(update, cellHandle) {
368
390
  internalMetadata: newInternalMetadata
369
391
  };
370
392
  }
371
- throw ( new Error('Unknown cell update type'));
393
+ throw ( new Error("Unknown cell update type"));
372
394
  }
373
395
  let CellExecution = class CellExecution extends Disposable {
374
396
  get state() {
@@ -407,7 +429,7 @@ let CellExecution = class CellExecution extends Disposable {
407
429
  runEndTime: null,
408
430
  lastRunSuccess: null,
409
431
  executionOrder: null,
410
- renderDuration: null,
432
+ renderDuration: null
411
433
  }
412
434
  };
413
435
  this._applyExecutionEdits([startExecuteEdit]);
@@ -416,7 +438,7 @@ let CellExecution = class CellExecution extends Disposable {
416
438
  return `${( this._notebookModel.uri.toString())}, ${this.cellHandle}`;
417
439
  }
418
440
  logUpdates(updates) {
419
- const updateTypes = ( updates.map(u => CellExecutionUpdateType[u.editType])).join(', ');
441
+ const updateTypes = ( updates.map(u => CellExecutionUpdateType[u.editType])).join(", ");
420
442
  this._logService.debug(`CellExecution#updateExecution ${this.getCellLog()}, [${updateTypes}]`);
421
443
  }
422
444
  confirm() {
@@ -432,15 +454,16 @@ let CellExecution = class CellExecution extends Disposable {
432
454
  if (!this._didPause && ( updates.some(u => u.editType === CellExecutionUpdateType.ExecutionState && u.didPause))) {
433
455
  this._didPause = true;
434
456
  }
435
- const lastIsPausedUpdate = [...updates].reverse().find(u => u.editType === CellExecutionUpdateType.ExecutionState && typeof u.isPaused === 'boolean');
457
+ const lastIsPausedUpdate = [...updates].reverse().find(
458
+ u => u.editType === CellExecutionUpdateType.ExecutionState && typeof u.isPaused === "boolean"
459
+ );
436
460
  if (lastIsPausedUpdate) {
437
461
  this._isPaused = lastIsPausedUpdate.isPaused;
438
462
  }
439
463
  const cellModel = this._notebookModel.cells.find(c => c.handle === this.cellHandle);
440
464
  if (!cellModel) {
441
465
  this._logService.debug(`CellExecution#update, updating cell not in notebook: ${( this._notebookModel.uri.toString())}, ${this.cellHandle}`);
442
- }
443
- else {
466
+ } else {
444
467
  const edits = ( updates.map(update => updateToEdit(update, this.cellHandle)));
445
468
  this._applyExecutionEdits(edits);
446
469
  }
@@ -452,8 +475,7 @@ let CellExecution = class CellExecution extends Disposable {
452
475
  const cellModel = this._notebookModel.cells.find(c => c.handle === this.cellHandle);
453
476
  if (!cellModel) {
454
477
  this._logService.debug(`CellExecution#complete, completing cell not in notebook: ${( this._notebookModel.uri.toString())}, ${this.cellHandle}`);
455
- }
456
- else {
478
+ } else {
457
479
  const edit = {
458
480
  editType: CellEditType.PartialInternalMetadata,
459
481
  handle: this.cellHandle,
@@ -472,9 +494,7 @@ let CellExecution = class CellExecution extends Disposable {
472
494
  this._notebookModel.applyEdits(edits, true, undefined, () => undefined, undefined, false);
473
495
  }
474
496
  };
475
- CellExecution = ( __decorate([
476
- ( __param(2, ILogService))
477
- ], CellExecution));
497
+ CellExecution = ( __decorate([( __param(2, ILogService))], CellExecution));
478
498
  let NotebookExecution = class NotebookExecution extends Disposable {
479
499
  get state() {
480
500
  return this._state;
@@ -512,8 +532,6 @@ let NotebookExecution = class NotebookExecution extends Disposable {
512
532
  this._onDidComplete.fire();
513
533
  }
514
534
  };
515
- NotebookExecution = ( __decorate([
516
- ( __param(1, ILogService))
517
- ], NotebookExecution));
535
+ NotebookExecution = ( __decorate([( __param(1, ILogService))], NotebookExecution));
518
536
 
519
537
  export { NotebookExecutionStateService };
@@ -13,8 +13,12 @@ import { INotebookLoggingService } from '@codingame/monaco-vscode-api/vscode/vs/
13
13
  var NotebookKernelHistoryService_1;
14
14
  const MAX_KERNELS_IN_HISTORY = 5;
15
15
  let NotebookKernelHistoryService = class NotebookKernelHistoryService extends Disposable {
16
- static { NotebookKernelHistoryService_1 = this; }
17
- static { this.STORAGE_KEY = 'notebook.kernelHistory'; }
16
+ static {
17
+ NotebookKernelHistoryService_1 = this;
18
+ }
19
+ static {
20
+ this.STORAGE_KEY = "notebook.kernelHistory";
21
+ }
18
22
  constructor(_storageService, _notebookKernelService, _notebookLoggingService) {
19
23
  super();
20
24
  this._storageService = _storageService;
@@ -23,7 +27,11 @@ let NotebookKernelHistoryService = class NotebookKernelHistoryService extends Di
23
27
  this._mostRecentKernelsMap = {};
24
28
  this._loadState();
25
29
  this._register(this._storageService.onWillSaveState(() => this._saveState()));
26
- this._register(this._storageService.onDidChangeValue(StorageScope.WORKSPACE, NotebookKernelHistoryService_1.STORAGE_KEY, this._store)(() => {
30
+ this._register(this._storageService.onDidChangeValue(
31
+ StorageScope.WORKSPACE,
32
+ NotebookKernelHistoryService_1.STORAGE_KEY,
33
+ this._store
34
+ )(() => {
27
35
  this._loadState();
28
36
  }));
29
37
  }
@@ -32,10 +40,16 @@ let NotebookKernelHistoryService = class NotebookKernelHistoryService extends Di
32
40
  const allKernels = allAvailableKernels.all;
33
41
  const selectedKernel = allAvailableKernels.selected;
34
42
  const suggested = allAvailableKernels.all.length === 1 ? allAvailableKernels.all[0] : undefined;
35
- this._notebookLoggingService.debug('History', `getMatchingKernels: ${allAvailableKernels.all.length} kernels available for ${notebook.uri.path}. Selected: ${allAvailableKernels.selected?.label}. Suggested: ${suggested?.label}`);
43
+ this._notebookLoggingService.debug(
44
+ "History",
45
+ `getMatchingKernels: ${allAvailableKernels.all.length} kernels available for ${notebook.uri.path}. Selected: ${allAvailableKernels.selected?.label}. Suggested: ${suggested?.label}`
46
+ );
36
47
  const mostRecentKernelIds = this._mostRecentKernelsMap[notebook.notebookType] ? [...( this._mostRecentKernelsMap[notebook.notebookType].values())] : [];
37
48
  const all = ( mostRecentKernelIds.map(kernelId => allKernels.find(kernel => kernel.id === kernelId))).filter(kernel => !!kernel);
38
- this._notebookLoggingService.debug('History', `mru: ${mostRecentKernelIds.length} kernels in history, ${all.length} registered already.`);
49
+ this._notebookLoggingService.debug(
50
+ "History",
51
+ `mru: ${mostRecentKernelIds.length} kernels in history, ${all.length} registered already.`
52
+ );
39
53
  return {
40
54
  selected: selectedKernel ?? suggested,
41
55
  all
@@ -59,9 +73,13 @@ let NotebookKernelHistoryService = class NotebookKernelHistoryService extends Di
59
73
  }
60
74
  if (notEmpty) {
61
75
  const serialized = this._serialize();
62
- this._storageService.store(NotebookKernelHistoryService_1.STORAGE_KEY, JSON.stringify(serialized), StorageScope.WORKSPACE, StorageTarget.USER);
63
- }
64
- else {
76
+ this._storageService.store(
77
+ NotebookKernelHistoryService_1.STORAGE_KEY,
78
+ JSON.stringify(serialized),
79
+ StorageScope.WORKSPACE,
80
+ StorageTarget.USER
81
+ );
82
+ } else {
65
83
  this._storageService.remove(NotebookKernelHistoryService_1.STORAGE_KEY, StorageScope.WORKSPACE);
66
84
  }
67
85
  }
@@ -70,12 +88,10 @@ let NotebookKernelHistoryService = class NotebookKernelHistoryService extends Di
70
88
  if (serialized) {
71
89
  try {
72
90
  this._deserialize(JSON.parse(serialized));
73
- }
74
- catch (e) {
91
+ } catch (e) {
75
92
  this._mostRecentKernelsMap = {};
76
93
  }
77
- }
78
- else {
94
+ } else {
79
95
  this._mostRecentKernelsMap = {};
80
96
  }
81
97
  }
@@ -105,16 +121,12 @@ let NotebookKernelHistoryService = class NotebookKernelHistoryService extends Di
105
121
  this._saveState();
106
122
  }
107
123
  };
108
- NotebookKernelHistoryService = NotebookKernelHistoryService_1 = ( __decorate([
109
- ( __param(0, IStorageService)),
110
- ( __param(1, INotebookKernelService)),
111
- ( __param(2, INotebookLoggingService))
112
- ], NotebookKernelHistoryService));
124
+ NotebookKernelHistoryService = NotebookKernelHistoryService_1 = ( __decorate([( __param(0, IStorageService)), ( __param(1, INotebookKernelService)), ( __param(2, INotebookLoggingService))], NotebookKernelHistoryService));
113
125
  registerAction2(class extends Action2 {
114
126
  constructor() {
115
127
  super({
116
- id: 'notebook.clearNotebookKernelsMRUCache',
117
- title: ( localize2(9686, "Clear Notebook Kernels MRU Cache")),
128
+ id: "notebook.clearNotebookKernelsMRUCache",
129
+ title: ( localize2(10006, "Clear Notebook Kernels MRU Cache")),
118
130
  category: Categories.Developer,
119
131
  f1: true
120
132
  });