@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
@@ -16,7 +16,7 @@ let NotebookEditorWorkerServiceImpl = class NotebookEditorWorkerServiceImpl exte
16
16
  this._workerManager = this._register(( new WorkerManager(notebookService, modelService, webWorkerService)));
17
17
  }
18
18
  canComputeDiff(original, modified) {
19
- throw ( new Error('Method not implemented.'));
19
+ throw ( new Error("Method not implemented."));
20
20
  }
21
21
  computeDiff(original, modified) {
22
22
  return this._workerManager.withWorker().then(client => {
@@ -29,11 +29,7 @@ let NotebookEditorWorkerServiceImpl = class NotebookEditorWorkerServiceImpl exte
29
29
  });
30
30
  }
31
31
  };
32
- NotebookEditorWorkerServiceImpl = ( __decorate([
33
- ( __param(0, INotebookService)),
34
- ( __param(1, IModelService)),
35
- ( __param(2, IWebWorkerService))
36
- ], NotebookEditorWorkerServiceImpl));
32
+ NotebookEditorWorkerServiceImpl = ( __decorate([( __param(0, INotebookService)), ( __param(1, IModelService)), ( __param(2, IWebWorkerService))], NotebookEditorWorkerServiceImpl));
37
33
  class WorkerManager extends Disposable {
38
34
  constructor(_notebookService, _modelService, _webWorkerService) {
39
35
  super();
@@ -66,7 +62,7 @@ class NotebookEditorModelManager extends Disposable {
66
62
  this._beginModelSync(resource);
67
63
  }
68
64
  if (this._syncedModels[resourceStr]) {
69
- this._syncedModelsLastUsedTime[resourceStr] = (( new Date())).getTime();
65
+ this._syncedModelsLastUsedTime[resourceStr] = ( new Date()).getTime();
70
66
  }
71
67
  }
72
68
  }
@@ -85,12 +81,15 @@ class NotebookEditorModelManager extends Disposable {
85
81
  language: cell.language,
86
82
  mime: cell.mime,
87
83
  cellKind: cell.cellKind,
88
- outputs: ( cell.outputs.map(op => ({ outputId: op.outputId, outputs: op.outputs }))),
84
+ outputs: ( cell.outputs.map(op => ({
85
+ outputId: op.outputId,
86
+ outputs: op.outputs
87
+ }))),
89
88
  metadata: cell.metadata,
90
- internalMetadata: cell.internalMetadata,
89
+ internalMetadata: cell.internalMetadata
91
90
  }))));
92
91
  const toDispose = ( new DisposableStore());
93
- const cellToDto = (cell) => {
92
+ const cellToDto = cell => {
94
93
  return {
95
94
  handle: cell.handle,
96
95
  url: ( cell.uri.toString()),
@@ -99,23 +98,26 @@ class NotebookEditorModelManager extends Disposable {
99
98
  versionId: 0,
100
99
  language: cell.language,
101
100
  cellKind: cell.cellKind,
102
- outputs: ( cell.outputs.map(op => ({ outputId: op.outputId, outputs: op.outputs }))),
101
+ outputs: ( cell.outputs.map(op => ({
102
+ outputId: op.outputId,
103
+ outputs: op.outputs
104
+ }))),
103
105
  metadata: cell.metadata,
104
- internalMetadata: cell.internalMetadata,
106
+ internalMetadata: cell.internalMetadata
105
107
  };
106
108
  };
107
109
  const cellHandlers = ( new Set());
108
- const addCellContentChangeHandler = (cell) => {
110
+ const addCellContentChangeHandler = cell => {
109
111
  cellHandlers.add(cell);
110
- toDispose.add(cell.onDidChangeContent((e) => {
111
- if (typeof e === 'object' && e.type === 'model') {
112
+ toDispose.add(cell.onDidChangeContent(e => {
113
+ if (typeof e === "object" && e.type === "model") {
112
114
  this._proxy.$acceptCellModelChanged(modelUrl, cell.handle, e.event);
113
115
  }
114
116
  }));
115
117
  };
116
118
  model.cells.forEach(cell => addCellContentChangeHandler(cell));
117
119
  if (model.cells.length !== cellHandlers.size) {
118
- toDispose.add(this._modelService.onModelAdded((textModel) => {
120
+ toDispose.add(this._modelService.onModelAdded(textModel => {
119
121
  if (textModel.uri.scheme !== Schemas.vscodeNotebookCell || !(textModel instanceof TextModel)) {
120
122
  return;
121
123
  }
@@ -129,13 +131,13 @@ class NotebookEditorModelManager extends Disposable {
129
131
  }
130
132
  }));
131
133
  }
132
- toDispose.add(model.onDidChangeContent((event) => {
134
+ toDispose.add(model.onDidChangeContent(event => {
133
135
  const dto = [];
134
- event.rawEvents
135
- .forEach(e => {
136
+ event.rawEvents.forEach(e => {
136
137
  switch (e.kind) {
137
- case NotebookCellsChangeType.ModelChange:
138
- case NotebookCellsChangeType.Initialize: {
138
+ case NotebookCellsChangeType.ModelChange:
139
+ case NotebookCellsChangeType.Initialize:
140
+ {
139
141
  dto.push({
140
142
  kind: e.kind,
141
143
  changes: ( e.changes.map(diff => [diff[0], diff[1], ( diff[2].map(cell => cellToDto(cell)))]))
@@ -147,7 +149,8 @@ class NotebookEditorModelManager extends Disposable {
147
149
  }
148
150
  break;
149
151
  }
150
- case NotebookCellsChangeType.Move: {
152
+ case NotebookCellsChangeType.Move:
153
+ {
151
154
  dto.push({
152
155
  kind: NotebookCellsChangeType.Move,
153
156
  index: e.index,
@@ -157,15 +160,15 @@ class NotebookEditorModelManager extends Disposable {
157
160
  });
158
161
  break;
159
162
  }
160
- case NotebookCellsChangeType.ChangeCellContent:
161
- break;
162
- case NotebookCellsChangeType.ChangeDocumentMetadata:
163
- dto.push({
164
- kind: e.kind,
165
- metadata: e.metadata
166
- });
167
- default:
168
- dto.push(e);
163
+ case NotebookCellsChangeType.ChangeCellContent:
164
+ break;
165
+ case NotebookCellsChangeType.ChangeDocumentMetadata:
166
+ dto.push({
167
+ kind: e.kind,
168
+ metadata: e.metadata
169
+ });
170
+ default:
171
+ dto.push(e);
169
172
  }
170
173
  });
171
174
  this._proxy.$acceptModelChanged(( modelUrl.toString()), {
@@ -220,12 +223,11 @@ class NotebookWorkerClient extends Disposable {
220
223
  if (!this._worker) {
221
224
  try {
222
225
  this._worker = this._register(this._webWorkerService.createWorkerClient(( new WebWorkerDescriptor({
223
- esmModuleLocation: ( FileAccess.asBrowserUri('vs/workbench/contrib/notebook/common/services/notebookWebWorkerMain.js')),
224
- label: 'NotebookEditorWorker'
226
+ esmModuleLocation: ( FileAccess.asBrowserUri("vs/workbench/contrib/notebook/common/services/notebookWebWorkerMain.js")),
227
+ label: "NotebookEditorWorker"
225
228
  }))));
226
- }
227
- catch (err) {
228
- throw (err);
229
+ } catch (err) {
230
+ throw err;
229
231
  }
230
232
  }
231
233
  return this._worker;
@@ -36,7 +36,7 @@ let NotebookCellOutlineDataSource = class NotebookCellOutlineDataSource {
36
36
  async computeFullSymbols(cancelToken) {
37
37
  try {
38
38
  const notebookEditorWidget = this._editor;
39
- const notebookCells = notebookEditorWidget?.getViewModel()?.viewCells.filter((cell) => cell.cellKind === CellKind.Code);
39
+ const notebookCells = notebookEditorWidget?.getViewModel()?.viewCells.filter(cell => cell.cellKind === CellKind.Code);
40
40
  if (notebookCells) {
41
41
  const promises = [];
42
42
  for (const cell of notebookCells.slice(0, 50)) {
@@ -45,9 +45,8 @@ let NotebookCellOutlineDataSource = class NotebookCellOutlineDataSource {
45
45
  await Promise.allSettled(promises);
46
46
  }
47
47
  this.recomputeState();
48
- }
49
- catch (err) {
50
- console.error('Failed to compute notebook outline symbols:', err);
48
+ } catch (err) {
49
+ console.error("Failed to compute notebook outline symbols:", err);
51
50
  this.recomputeState();
52
51
  }
53
52
  }
@@ -79,15 +78,13 @@ let NotebookCellOutlineDataSource = class NotebookCellOutlineDataSource {
79
78
  result.push(entry);
80
79
  parentStack.push(entry);
81
80
  break;
82
- }
83
- else {
81
+ } else {
84
82
  const parentCandidate = parentStack[len - 1];
85
83
  if (parentCandidate.level < entry.level) {
86
84
  parentCandidate.addChild(entry);
87
85
  parentStack.push(entry);
88
86
  break;
89
- }
90
- else {
87
+ } else {
91
88
  parentStack.pop();
92
89
  }
93
90
  }
@@ -101,17 +98,16 @@ let NotebookCellOutlineDataSource = class NotebookCellOutlineDataSource {
101
98
  if (notebookEditorWidget.isDisposed) {
102
99
  return;
103
100
  }
104
- const doUpdateMarker = (clear) => {
101
+ const doUpdateMarker = clear => {
105
102
  for (const entry of this._entries) {
106
103
  if (clear) {
107
104
  entry.clearMarkers();
108
- }
109
- else {
105
+ } else {
110
106
  entry.updateMarkers(this._markerService);
111
107
  }
112
108
  }
113
109
  };
114
- const problem = this._configurationService.getValue('problems.visibility');
110
+ const problem = this._configurationService.getValue("problems.visibility");
115
111
  if (problem === undefined) {
116
112
  return;
117
113
  }
@@ -119,7 +115,7 @@ let NotebookCellOutlineDataSource = class NotebookCellOutlineDataSource {
119
115
  if (problem && config) {
120
116
  markerServiceListener.value = this._markerService.onMarkerChanged(e => {
121
117
  if (notebookEditorWidget.isDisposed) {
122
- console.error('notebook editor is disposed');
118
+ console.error("notebook editor is disposed");
123
119
  return;
124
120
  }
125
121
  if (( e.some(uri => ( notebookEditorWidget.getCellsInRange().some(cell => isEqual(cell.uri, uri)))))) {
@@ -128,20 +124,21 @@ let NotebookCellOutlineDataSource = class NotebookCellOutlineDataSource {
128
124
  }
129
125
  });
130
126
  doUpdateMarker(false);
131
- }
132
- else {
127
+ } else {
133
128
  markerServiceListener.clear();
134
129
  doUpdateMarker(true);
135
130
  }
136
131
  };
137
132
  updateMarkerUpdater();
138
133
  this._disposables.add(this._configurationService.onDidChangeConfiguration(e => {
139
- if (e.affectsConfiguration('problems.visibility') || e.affectsConfiguration(OutlineConfigKeys.problemsEnabled)) {
134
+ if (e.affectsConfiguration("problems.visibility") || e.affectsConfiguration(OutlineConfigKeys.problemsEnabled)) {
140
135
  updateMarkerUpdater();
141
136
  this._onDidChange.fire({});
142
137
  }
143
138
  }));
144
- const { changeEventTriggered } = this.recomputeActive();
139
+ const {
140
+ changeEventTriggered
141
+ } = this.recomputeActive();
145
142
  if (!changeEventTriggered) {
146
143
  this._onDidChange.fire({});
147
144
  }
@@ -164,10 +161,16 @@ let NotebookCellOutlineDataSource = class NotebookCellOutlineDataSource {
164
161
  }
165
162
  if (newActive !== this._activeEntry) {
166
163
  this._activeEntry = newActive;
167
- this._onDidChange.fire({ affectOnlyActiveElement: true });
168
- return { changeEventTriggered: true };
164
+ this._onDidChange.fire({
165
+ affectOnlyActiveElement: true
166
+ });
167
+ return {
168
+ changeEventTriggered: true
169
+ };
169
170
  }
170
- return { changeEventTriggered: false };
171
+ return {
172
+ changeEventTriggered: false
173
+ };
171
174
  }
172
175
  dispose() {
173
176
  this._entries.length = 0;
@@ -175,10 +178,6 @@ let NotebookCellOutlineDataSource = class NotebookCellOutlineDataSource {
175
178
  this._disposables.dispose();
176
179
  }
177
180
  };
178
- NotebookCellOutlineDataSource = ( __decorate([
179
- ( __param(1, IMarkerService)),
180
- ( __param(2, IConfigurationService)),
181
- ( __param(3, INotebookOutlineEntryFactory))
182
- ], NotebookCellOutlineDataSource));
181
+ NotebookCellOutlineDataSource = ( __decorate([( __param(1, IMarkerService)), ( __param(2, IConfigurationService)), ( __param(3, INotebookOutlineEntryFactory))], NotebookCellOutlineDataSource));
183
182
 
184
183
  export { NotebookCellOutlineDataSource };
@@ -16,9 +16,7 @@ let NotebookCellOutlineDataSourceReferenceCollection = class NotebookCellOutline
16
16
  object.dispose();
17
17
  }
18
18
  };
19
- NotebookCellOutlineDataSourceReferenceCollection = ( __decorate([
20
- ( __param(0, IInstantiationService))
21
- ], NotebookCellOutlineDataSourceReferenceCollection));
19
+ NotebookCellOutlineDataSourceReferenceCollection = ( __decorate([( __param(0, IInstantiationService))], NotebookCellOutlineDataSourceReferenceCollection));
22
20
  let NotebookCellOutlineDataSourceFactory = class NotebookCellOutlineDataSourceFactory {
23
21
  constructor(instantiationService) {
24
22
  this._data = instantiationService.createInstance(NotebookCellOutlineDataSourceReferenceCollection);
@@ -27,8 +25,6 @@ let NotebookCellOutlineDataSourceFactory = class NotebookCellOutlineDataSourceFa
27
25
  return this._data.acquire(editor.getId(), editor);
28
26
  }
29
27
  };
30
- NotebookCellOutlineDataSourceFactory = ( __decorate([
31
- ( __param(0, IInstantiationService))
32
- ], NotebookCellOutlineDataSourceFactory));
28
+ NotebookCellOutlineDataSourceFactory = ( __decorate([( __param(0, IInstantiationService))], NotebookCellOutlineDataSourceFactory));
33
29
 
34
30
  export { NotebookCellOutlineDataSourceFactory };
@@ -10,7 +10,7 @@ import { INotebookExecutionStateService } from '@codingame/monaco-vscode-api/vsc
10
10
  import { ITextModelService } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/services/resolverService.service';
11
11
 
12
12
  var NotebookOutlineConstants;
13
- (function (NotebookOutlineConstants) {
13
+ (function(NotebookOutlineConstants) {
14
14
  NotebookOutlineConstants[NotebookOutlineConstants["NonHeaderOutlineLevel"] = 7] = "NonHeaderOutlineLevel";
15
15
  })(NotebookOutlineConstants || (NotebookOutlineConstants = {}));
16
16
  function getMarkdownHeadersInCellFallbackToHtmlTags(fullContent) {
@@ -22,7 +22,10 @@ function getMarkdownHeadersInCellFallbackToHtmlTags(fullContent) {
22
22
  if (match) {
23
23
  const level = parseInt(match[1]);
24
24
  const text = match[2].trim();
25
- headers.push({ depth: level, text });
25
+ headers.push({
26
+ depth: level,
27
+ text
28
+ });
26
29
  }
27
30
  return headers;
28
31
  }
@@ -43,13 +46,21 @@ let NotebookOutlineEntryFactory = class NotebookOutlineEntryFactory {
43
46
  const fullContent = cell.getText().substring(0, 10000);
44
47
  const cache = this.cachedMarkdownOutlineEntries.get(cell);
45
48
  const headers = cache?.alternativeId === cell.getAlternativeId() ? cache.headers : Array.from(getMarkdownHeadersInCellFallbackToHtmlTags(fullContent));
46
- this.cachedMarkdownOutlineEntries.set(cell, { alternativeId: cell.getAlternativeId(), headers });
47
- for (const { depth, text } of headers) {
49
+ this.cachedMarkdownOutlineEntries.set(cell, {
50
+ alternativeId: cell.getAlternativeId(),
51
+ headers
52
+ });
53
+ for (const {
54
+ depth,
55
+ text
56
+ } of headers) {
48
57
  hasHeader = true;
49
58
  entries.push(( new OutlineEntry(index++, depth, cell, text, false, false)));
50
59
  }
51
60
  if (!hasHeader) {
52
- content = renderAsPlaintext({ value: content });
61
+ content = renderAsPlaintext({
62
+ value: content
63
+ });
53
64
  }
54
65
  }
55
66
  if (!hasHeader) {
@@ -66,7 +77,7 @@ let NotebookOutlineEntryFactory = class NotebookOutlineEntryFactory {
66
77
  !!exeState,
67
78
  exeState ? exeState.isPaused : false
68
79
  )));
69
- cached.forEach((entry) => {
80
+ cached.forEach(entry => {
70
81
  entries.push(( new OutlineEntry(
71
82
  index++,
72
83
  entry.level,
@@ -82,7 +93,7 @@ let NotebookOutlineEntryFactory = class NotebookOutlineEntryFactory {
82
93
  }
83
94
  if (entries.length === 0) {
84
95
  if (preview.length === 0) {
85
- preview = ( localize(9724, "empty cell"));
96
+ preview = ( localize(10044, "empty cell"));
86
97
  }
87
98
  entries.push(( new OutlineEntry(
88
99
  index++,
@@ -106,21 +117,21 @@ let NotebookOutlineEntryFactory = class NotebookOutlineEntryFactory {
106
117
  const outlineModel = await this.outlineModelService.getOrCreate(textModel, cancelToken);
107
118
  const entries = createOutlineEntries(outlineModel.getTopLevelSymbols(), 8);
108
119
  this.cellOutlineEntryCache[cell.id] = entries;
109
- }
110
- finally {
120
+ } finally {
111
121
  ref.dispose();
112
122
  }
113
123
  }
114
124
  };
115
- NotebookOutlineEntryFactory = ( __decorate([
116
- ( __param(0, INotebookExecutionStateService)),
117
- ( __param(1, IOutlineModelService)),
118
- ( __param(2, ITextModelService))
119
- ], NotebookOutlineEntryFactory));
125
+ NotebookOutlineEntryFactory = ( __decorate([( __param(0, INotebookExecutionStateService)), ( __param(1, IOutlineModelService)), ( __param(2, ITextModelService))], NotebookOutlineEntryFactory));
120
126
  function createOutlineEntries(symbols, level) {
121
127
  const entries = [];
122
128
  symbols.forEach(symbol => {
123
- entries.push({ name: symbol.name, range: symbol.range, level, kind: symbol.kind });
129
+ entries.push({
130
+ name: symbol.name,
131
+ range: symbol.range,
132
+ level,
133
+ kind: symbol.kind
134
+ });
124
135
  if (symbol.children) {
125
136
  entries.push(...createOutlineEntries(symbol.children, level + 1));
126
137
  }
@@ -3,9 +3,17 @@ import { UndoRedoElementType } from '@codingame/monaco-vscode-api/vscode/vs/plat
3
3
 
4
4
  class MoveCellEdit {
5
5
  get label() {
6
- return this.length === 1 ? 'Move Cell' : 'Move Cells';
6
+ return this.length === 1 ? "Move Cell" : "Move Cells";
7
7
  }
8
- constructor(resource, fromIndex, length, toIndex, editingDelegate, beforedSelections, endSelections) {
8
+ constructor(
9
+ resource,
10
+ fromIndex,
11
+ length,
12
+ toIndex,
13
+ editingDelegate,
14
+ beforedSelections,
15
+ endSelections
16
+ ) {
9
17
  this.resource = resource;
10
18
  this.fromIndex = fromIndex;
11
19
  this.length = length;
@@ -14,30 +22,42 @@ class MoveCellEdit {
14
22
  this.beforedSelections = beforedSelections;
15
23
  this.endSelections = endSelections;
16
24
  this.type = UndoRedoElementType.Resource;
17
- this.code = 'undoredo.textBufferEdit';
25
+ this.code = "undoredo.textBufferEdit";
18
26
  }
19
27
  undo() {
20
28
  if (!this.editingDelegate.moveCell) {
21
- throw ( new Error('Notebook Move Cell not implemented for Undo/Redo'));
29
+ throw ( new Error("Notebook Move Cell not implemented for Undo/Redo"));
22
30
  }
23
- this.editingDelegate.moveCell(this.toIndex, this.length, this.fromIndex, this.endSelections, this.beforedSelections);
31
+ this.editingDelegate.moveCell(
32
+ this.toIndex,
33
+ this.length,
34
+ this.fromIndex,
35
+ this.endSelections,
36
+ this.beforedSelections
37
+ );
24
38
  }
25
39
  redo() {
26
40
  if (!this.editingDelegate.moveCell) {
27
- throw ( new Error('Notebook Move Cell not implemented for Undo/Redo'));
41
+ throw ( new Error("Notebook Move Cell not implemented for Undo/Redo"));
28
42
  }
29
- this.editingDelegate.moveCell(this.fromIndex, this.length, this.toIndex, this.beforedSelections, this.endSelections);
43
+ this.editingDelegate.moveCell(
44
+ this.fromIndex,
45
+ this.length,
46
+ this.toIndex,
47
+ this.beforedSelections,
48
+ this.endSelections
49
+ );
30
50
  }
31
51
  }
32
52
  class SpliceCellsEdit {
33
53
  get label() {
34
54
  if (this.diffs.length === 1 && this.diffs[0][1].length === 0) {
35
- return this.diffs[0][2].length > 1 ? 'Insert Cells' : 'Insert Cell';
55
+ return this.diffs[0][2].length > 1 ? "Insert Cells" : "Insert Cell";
36
56
  }
37
57
  if (this.diffs.length === 1 && this.diffs[0][2].length === 0) {
38
- return this.diffs[0][1].length > 1 ? 'Delete Cells' : 'Delete Cell';
58
+ return this.diffs[0][1].length > 1 ? "Delete Cells" : "Delete Cell";
39
59
  }
40
- return 'Insert Cell';
60
+ return "Insert Cell";
41
61
  }
42
62
  constructor(resource, diffs, editingDelegate, beforeHandles, endHandles) {
43
63
  this.resource = resource;
@@ -46,11 +66,11 @@ class SpliceCellsEdit {
46
66
  this.beforeHandles = beforeHandles;
47
67
  this.endHandles = endHandles;
48
68
  this.type = UndoRedoElementType.Resource;
49
- this.code = 'undoredo.textBufferEdit';
69
+ this.code = "undoredo.textBufferEdit";
50
70
  }
51
71
  undo() {
52
72
  if (!this.editingDelegate.replaceCell) {
53
- throw ( new Error('Notebook Replace Cell not implemented for Undo/Redo'));
73
+ throw ( new Error("Notebook Replace Cell not implemented for Undo/Redo"));
54
74
  }
55
75
  this.diffs.forEach(diff => {
56
76
  this.editingDelegate.replaceCell(diff[0], diff[2].length, diff[1], this.beforeHandles);
@@ -58,7 +78,7 @@ class SpliceCellsEdit {
58
78
  }
59
79
  redo() {
60
80
  if (!this.editingDelegate.replaceCell) {
61
- throw ( new Error('Notebook Replace Cell not implemented for Undo/Redo'));
81
+ throw ( new Error("Notebook Replace Cell not implemented for Undo/Redo"));
62
82
  }
63
83
  this.diffs.reverse().forEach(diff => {
64
84
  this.editingDelegate.replaceCell(diff[0], diff[1].length, diff[2], this.endHandles);
@@ -73,8 +93,8 @@ class CellMetadataEdit {
73
93
  this.newMetadata = newMetadata;
74
94
  this.editingDelegate = editingDelegate;
75
95
  this.type = UndoRedoElementType.Resource;
76
- this.label = 'Update Cell Metadata';
77
- this.code = 'undoredo.textBufferEdit';
96
+ this.label = "Update Cell Metadata";
97
+ this.code = "undoredo.textBufferEdit";
78
98
  }
79
99
  undo() {
80
100
  if (!this.editingDelegate.updateCellMetadata) {