@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
@@ -39,22 +39,31 @@ function getFocusedEditor(accessor) {
39
39
  const editorService = accessor.get(IEditorService);
40
40
  const editor = getNotebookEditorFromEditorPane(editorService.activeEditorPane);
41
41
  if (!editor) {
42
- _log(loggerService, '[Revive Webview] No notebook editor found for active editor pane, bypass');
42
+ _log(
43
+ loggerService,
44
+ "[Revive Webview] No notebook editor found for active editor pane, bypass"
45
+ );
43
46
  return;
44
47
  }
45
48
  if (!editor.hasEditorFocus()) {
46
- _log(loggerService, '[Revive Webview] Notebook editor is not focused, bypass');
49
+ _log(loggerService, "[Revive Webview] Notebook editor is not focused, bypass");
47
50
  return;
48
51
  }
49
52
  if (!editor.hasWebviewFocus()) {
50
- _log(loggerService, '[Revive Webview] Notebook editor backlayer webview is not focused, bypass');
53
+ _log(
54
+ loggerService,
55
+ "[Revive Webview] Notebook editor backlayer webview is not focused, bypass"
56
+ );
51
57
  return;
52
58
  }
53
59
  const view = editor.getViewModel();
54
60
  if (view && view.viewCells.every(cell => !cell.outputIsFocused && !cell.outputIsHovered)) {
55
61
  return;
56
62
  }
57
- return { editor, loggerService };
63
+ return {
64
+ editor,
65
+ loggerService
66
+ };
58
67
  }
59
68
  function getFocusedWebviewDelegate(accessor) {
60
69
  const result = getFocusedEditor(accessor);
@@ -62,7 +71,10 @@ function getFocusedWebviewDelegate(accessor) {
62
71
  return;
63
72
  }
64
73
  const webview = result.editor.getInnerWebview();
65
- _log(result.loggerService, '[Revive Webview] Notebook editor backlayer webview is focused');
74
+ _log(
75
+ result.loggerService,
76
+ "[Revive Webview] Notebook editor backlayer webview is focused"
77
+ );
66
78
  return webview;
67
79
  }
68
80
  function withWebview(accessor, f) {
@@ -78,19 +90,19 @@ function withEditor(accessor, f) {
78
90
  return result ? f(result.editor) : false;
79
91
  }
80
92
  const PRIORITY = 105;
81
- UndoCommand.addImplementation(PRIORITY, 'notebook-webview', accessor => {
93
+ UndoCommand.addImplementation(PRIORITY, "notebook-webview", accessor => {
82
94
  return withWebview(accessor, webview => webview.undo());
83
95
  });
84
- RedoCommand.addImplementation(PRIORITY, 'notebook-webview', accessor => {
96
+ RedoCommand.addImplementation(PRIORITY, "notebook-webview", accessor => {
85
97
  return withWebview(accessor, webview => webview.redo());
86
98
  });
87
- CopyAction?.addImplementation(PRIORITY, 'notebook-webview', accessor => {
99
+ CopyAction?.addImplementation(PRIORITY, "notebook-webview", accessor => {
88
100
  return withWebview(accessor, webview => webview.copy());
89
101
  });
90
- PasteAction?.addImplementation(PRIORITY, 'notebook-webview', accessor => {
102
+ PasteAction?.addImplementation(PRIORITY, "notebook-webview", accessor => {
91
103
  return withWebview(accessor, webview => webview.paste());
92
104
  });
93
- CutAction?.addImplementation(PRIORITY, 'notebook-webview', accessor => {
105
+ CutAction?.addImplementation(PRIORITY, "notebook-webview", accessor => {
94
106
  return withWebview(accessor, webview => webview.cut());
95
107
  });
96
108
  function runPasteCells(editor, activeCell, pasteCells) {
@@ -108,35 +120,42 @@ function runPasteCells(editor, activeCell, pasteCells) {
108
120
  };
109
121
  if (activeCell) {
110
122
  const currCellIndex = editor.getCellIndex(activeCell);
111
- const newFocusIndex = typeof currCellIndex === 'number' ? currCellIndex + 1 : 0;
112
- textModel.applyEdits([
113
- {
114
- editType: CellEditType.Replace,
115
- index: newFocusIndex,
116
- count: 0,
117
- cells: ( pasteCells.items.map(cell => cloneNotebookCellTextModel(cell)))
118
- }
119
- ], true, originalState, () => ({
123
+ const newFocusIndex = typeof currCellIndex === "number" ? currCellIndex + 1 : 0;
124
+ textModel.applyEdits([{
125
+ editType: CellEditType.Replace,
126
+ index: newFocusIndex,
127
+ count: 0,
128
+ cells: ( pasteCells.items.map(cell => cloneNotebookCellTextModel(cell)))
129
+ }], true, originalState, () => ({
120
130
  kind: SelectionStateType.Index,
121
- focus: { start: newFocusIndex, end: newFocusIndex + 1 },
122
- selections: [{ start: newFocusIndex, end: newFocusIndex + pasteCells.items.length }]
131
+ focus: {
132
+ start: newFocusIndex,
133
+ end: newFocusIndex + 1
134
+ },
135
+ selections: [{
136
+ start: newFocusIndex,
137
+ end: newFocusIndex + pasteCells.items.length
138
+ }]
123
139
  }), undefined, true);
124
- }
125
- else {
140
+ } else {
126
141
  if (editor.getLength() !== 0) {
127
142
  return false;
128
143
  }
129
- textModel.applyEdits([
130
- {
131
- editType: CellEditType.Replace,
132
- index: 0,
133
- count: 0,
134
- cells: ( pasteCells.items.map(cell => cloneNotebookCellTextModel(cell)))
135
- }
136
- ], true, originalState, () => ({
144
+ textModel.applyEdits([{
145
+ editType: CellEditType.Replace,
146
+ index: 0,
147
+ count: 0,
148
+ cells: ( pasteCells.items.map(cell => cloneNotebookCellTextModel(cell)))
149
+ }], true, originalState, () => ({
137
150
  kind: SelectionStateType.Index,
138
- focus: { start: 0, end: 1 },
139
- selections: [{ start: 1, end: pasteCells.items.length + 1 }]
151
+ focus: {
152
+ start: 0,
153
+ end: 1
154
+ },
155
+ selections: [{
156
+ start: 1,
157
+ end: pasteCells.items.length + 1
158
+ }]
140
159
  }), undefined, true);
141
160
  }
142
161
  return true;
@@ -146,7 +165,7 @@ function runCopyCells(accessor, editor, targetCell) {
146
165
  return false;
147
166
  }
148
167
  if (editor.hasOutputTextSelection()) {
149
- getWindow(editor.getDomNode()).document.execCommand('copy');
168
+ getWindow(editor.getDomNode()).document.execCommand("copy");
150
169
  return true;
151
170
  }
152
171
  const clipboardService = accessor.get(IClipboardService);
@@ -154,7 +173,9 @@ function runCopyCells(accessor, editor, targetCell) {
154
173
  const selections = editor.getSelections();
155
174
  if (targetCell) {
156
175
  const targetCellIndex = editor.getCellIndex(targetCell);
157
- const containingSelection = selections.find(selection => selection.start <= targetCellIndex && targetCellIndex < selection.end);
176
+ const containingSelection = selections.find(
177
+ selection => selection.start <= targetCellIndex && targetCellIndex < selection.end
178
+ );
158
179
  if (!containingSelection) {
159
180
  clipboardService.writeText(targetCell.getText());
160
181
  notebookService.setToCopy([targetCell.model], true);
@@ -166,7 +187,7 @@ function runCopyCells(accessor, editor, targetCell) {
166
187
  if (!selectedCells.length) {
167
188
  return false;
168
189
  }
169
- clipboardService.writeText(( selectedCells.map(cell => cell.getText())).join('\n'));
190
+ clipboardService.writeText(( selectedCells.map(cell => cell.getText())).join("\n"));
170
191
  notebookService.setToCopy(( selectedCells.map(cell => cell.model)), true);
171
192
  return true;
172
193
  }
@@ -180,17 +201,34 @@ function runCutCells(accessor, editor, targetCell) {
180
201
  const selections = editor.getSelections();
181
202
  if (targetCell) {
182
203
  const targetCellIndex = editor.getCellIndex(targetCell);
183
- const containingSelection = selections.find(selection => selection.start <= targetCellIndex && targetCellIndex < selection.end);
204
+ const containingSelection = selections.find(
205
+ selection => selection.start <= targetCellIndex && targetCellIndex < selection.end
206
+ );
184
207
  if (!containingSelection) {
185
208
  clipboardService.writeText(targetCell.getText());
186
209
  const focus = editor.getFocus();
187
- const newFocus = focus.end <= targetCellIndex ? focus : { start: focus.start - 1, end: focus.end - 1 };
188
- const newSelections = ( selections.map(
189
- selection => (selection.end <= targetCellIndex ? selection : { start: selection.start - 1, end: selection.end - 1 })
190
- ));
191
- textModel.applyEdits([
192
- { editType: CellEditType.Replace, index: targetCellIndex, count: 1, cells: [] }
193
- ], true, { kind: SelectionStateType.Index, focus: editor.getFocus(), selections: selections }, () => ({ kind: SelectionStateType.Index, focus: newFocus, selections: newSelections }), undefined, true);
210
+ const newFocus = focus.end <= targetCellIndex ? focus : {
211
+ start: focus.start - 1,
212
+ end: focus.end - 1
213
+ };
214
+ const newSelections = ( selections.map(selection => (selection.end <= targetCellIndex ? selection : {
215
+ start: selection.start - 1,
216
+ end: selection.end - 1
217
+ })));
218
+ textModel.applyEdits([{
219
+ editType: CellEditType.Replace,
220
+ index: targetCellIndex,
221
+ count: 1,
222
+ cells: []
223
+ }], true, {
224
+ kind: SelectionStateType.Index,
225
+ focus: editor.getFocus(),
226
+ selections: selections
227
+ }, () => ({
228
+ kind: SelectionStateType.Index,
229
+ focus: newFocus,
230
+ selections: newSelections
231
+ }), undefined, true);
194
232
  notebookService.setToCopy([targetCell.model], false);
195
233
  return true;
196
234
  }
@@ -200,13 +238,28 @@ function runCutCells(accessor, editor, targetCell) {
200
238
  if (!containingSelection) {
201
239
  const targetCell = editor.cellAt(focus.start);
202
240
  clipboardService.writeText(targetCell.getText());
203
- const newFocus = focus.end === editor.getLength() ? { start: focus.start - 1, end: focus.end - 1 } : focus;
204
- const newSelections = ( selections.map(
205
- selection => (selection.end <= focus.start ? selection : { start: selection.start - 1, end: selection.end - 1 })
206
- ));
207
- textModel.applyEdits([
208
- { editType: CellEditType.Replace, index: focus.start, count: 1, cells: [] }
209
- ], true, { kind: SelectionStateType.Index, focus: editor.getFocus(), selections: selections }, () => ({ kind: SelectionStateType.Index, focus: newFocus, selections: newSelections }), undefined, true);
241
+ const newFocus = focus.end === editor.getLength() ? {
242
+ start: focus.start - 1,
243
+ end: focus.end - 1
244
+ } : focus;
245
+ const newSelections = ( selections.map(selection => (selection.end <= focus.start ? selection : {
246
+ start: selection.start - 1,
247
+ end: selection.end - 1
248
+ })));
249
+ textModel.applyEdits([{
250
+ editType: CellEditType.Replace,
251
+ index: focus.start,
252
+ count: 1,
253
+ cells: []
254
+ }], true, {
255
+ kind: SelectionStateType.Index,
256
+ focus: editor.getFocus(),
257
+ selections: selections
258
+ }, () => ({
259
+ kind: SelectionStateType.Index,
260
+ focus: newFocus,
261
+ selections: newSelections
262
+ }), undefined, true);
210
263
  notebookService.setToCopy([targetCell.model], false);
211
264
  return true;
212
265
  }
@@ -215,42 +268,57 @@ function runCutCells(accessor, editor, targetCell) {
215
268
  if (!selectedCells.length) {
216
269
  return false;
217
270
  }
218
- clipboardService.writeText(( selectedCells.map(cell => cell.getText())).join('\n'));
219
- const edits = ( selectionRanges.map(
220
- range => ({ editType: CellEditType.Replace, index: range.start, count: range.end - range.start, cells: [] })
221
- ));
271
+ clipboardService.writeText(( selectedCells.map(cell => cell.getText())).join("\n"));
272
+ const edits = ( selectionRanges.map(range => ({
273
+ editType: CellEditType.Replace,
274
+ index: range.start,
275
+ count: range.end - range.start,
276
+ cells: []
277
+ })));
222
278
  const firstSelectIndex = selectionRanges[0].start;
223
- const newFocusedCellIndex = firstSelectIndex < textModel.cells.length - 1
224
- ? firstSelectIndex
225
- : Math.max(textModel.cells.length - 2, 0);
226
- textModel.applyEdits(edits, true, { kind: SelectionStateType.Index, focus: editor.getFocus(), selections: selectionRanges }, () => {
279
+ const newFocusedCellIndex = firstSelectIndex < textModel.cells.length - 1 ? firstSelectIndex : Math.max(textModel.cells.length - 2, 0);
280
+ textModel.applyEdits(edits, true, {
281
+ kind: SelectionStateType.Index,
282
+ focus: editor.getFocus(),
283
+ selections: selectionRanges
284
+ }, () => {
227
285
  return {
228
286
  kind: SelectionStateType.Index,
229
- focus: { start: newFocusedCellIndex, end: newFocusedCellIndex + 1 },
230
- selections: [{ start: newFocusedCellIndex, end: newFocusedCellIndex + 1 }]
287
+ focus: {
288
+ start: newFocusedCellIndex,
289
+ end: newFocusedCellIndex + 1
290
+ },
291
+ selections: [{
292
+ start: newFocusedCellIndex,
293
+ end: newFocusedCellIndex + 1
294
+ }]
231
295
  };
232
296
  }, undefined, true);
233
297
  notebookService.setToCopy(( selectedCells.map(cell => cell.model)), false);
234
298
  return true;
235
299
  }
236
300
  let NotebookClipboardContribution = class NotebookClipboardContribution extends Disposable {
237
- static { this.ID = 'workbench.contrib.notebookClipboard'; }
301
+ static {
302
+ this.ID = "workbench.contrib.notebookClipboard";
303
+ }
238
304
  constructor(_editorService) {
239
305
  super();
240
306
  this._editorService = _editorService;
241
307
  const PRIORITY = 105;
242
308
  if (CopyAction) {
243
- this._register(CopyAction.addImplementation(PRIORITY, 'notebook-clipboard', accessor => {
309
+ this._register(CopyAction.addImplementation(PRIORITY, "notebook-clipboard", accessor => {
244
310
  return this.runCopyAction(accessor);
245
311
  }));
246
312
  }
247
313
  if (PasteAction) {
248
- this._register(PasteAction.addImplementation(PRIORITY, 'notebook-clipboard', accessor => {
249
- return this.runPasteAction(accessor);
250
- }));
314
+ this._register(
315
+ PasteAction.addImplementation(PRIORITY, "notebook-clipboard", accessor => {
316
+ return this.runPasteAction(accessor);
317
+ })
318
+ );
251
319
  }
252
320
  if (CutAction) {
253
- this._register(CutAction.addImplementation(PRIORITY, 'notebook-clipboard', accessor => {
321
+ this._register(CutAction.addImplementation(PRIORITY, "notebook-clipboard", accessor => {
254
322
  return this.runCutAction(accessor);
255
323
  }));
256
324
  }
@@ -277,10 +345,8 @@ let NotebookClipboardContribution = class NotebookClipboardContribution extends
277
345
  if (!body.contains(container)) {
278
346
  return false;
279
347
  }
280
- while (container
281
- &&
282
- container !== body) {
283
- if (container.classList && container.classList.contains('monaco-editor')) {
348
+ while (container && container !== body) {
349
+ if (container.classList && container.classList.contains("monaco-editor")) {
284
350
  return true;
285
351
  }
286
352
  container = container.parentNode;
@@ -291,23 +357,31 @@ let NotebookClipboardContribution = class NotebookClipboardContribution extends
291
357
  const loggerService = accessor.get(ILogService);
292
358
  const activeElement = getActiveElement();
293
359
  if (isHTMLElement(activeElement) && isEditableElement(activeElement)) {
294
- _log(loggerService, '[NotebookEditor] focus is on input or textarea element, bypass');
360
+ _log(
361
+ loggerService,
362
+ "[NotebookEditor] focus is on input or textarea element, bypass"
363
+ );
295
364
  return false;
296
365
  }
297
- const { editor } = this._getContext();
366
+ const {
367
+ editor
368
+ } = this._getContext();
298
369
  if (!editor) {
299
- _log(loggerService, '[NotebookEditor] no active notebook editor, bypass');
370
+ _log(loggerService, "[NotebookEditor] no active notebook editor, bypass");
300
371
  return false;
301
372
  }
302
373
  if (!editor.hasEditorFocus()) {
303
- _log(loggerService, '[NotebookEditor] focus is outside of the notebook editor, bypass');
374
+ _log(
375
+ loggerService,
376
+ "[NotebookEditor] focus is outside of the notebook editor, bypass"
377
+ );
304
378
  return false;
305
379
  }
306
380
  if (this._focusInsideEmebedMonaco(editor)) {
307
- _log(loggerService, '[NotebookEditor] focus is on embed monaco editor, bypass');
381
+ _log(loggerService, "[NotebookEditor] focus is on embed monaco editor, bypass");
308
382
  return false;
309
383
  }
310
- _log(loggerService, '[NotebookEditor] run copy actions on notebook model');
384
+ _log(loggerService, "[NotebookEditor] run copy actions on notebook model");
311
385
  return runCopyCells(accessor, editor, undefined);
312
386
  }
313
387
  runPasteAction(accessor) {
@@ -315,7 +389,10 @@ let NotebookClipboardContribution = class NotebookClipboardContribution extends
315
389
  if (activeElement && isEditableElement(activeElement)) {
316
390
  return false;
317
391
  }
318
- const { editor, activeCell } = this._getContext();
392
+ const {
393
+ editor,
394
+ activeCell
395
+ } = this._getContext();
319
396
  if (!editor || !editor.hasEditorFocus() || this._focusInsideEmebedMonaco(editor)) {
320
397
  return false;
321
398
  }
@@ -331,35 +408,42 @@ let NotebookClipboardContribution = class NotebookClipboardContribution extends
331
408
  if (activeElement && isEditableElement(activeElement)) {
332
409
  return false;
333
410
  }
334
- const { editor } = this._getContext();
411
+ const {
412
+ editor
413
+ } = this._getContext();
335
414
  if (!editor || !editor.hasEditorFocus() || this._focusInsideEmebedMonaco(editor)) {
336
415
  return false;
337
416
  }
338
417
  return runCutCells(accessor, editor, undefined);
339
418
  }
340
419
  };
341
- NotebookClipboardContribution = ( __decorate([
342
- ( __param(0, IEditorService))
343
- ], NotebookClipboardContribution));
344
- registerWorkbenchContribution2(NotebookClipboardContribution.ID, NotebookClipboardContribution, WorkbenchPhase.BlockRestore);
345
- const COPY_CELL_COMMAND_ID = 'notebook.cell.copy';
346
- const CUT_CELL_COMMAND_ID = 'notebook.cell.cut';
347
- const PASTE_CELL_COMMAND_ID = 'notebook.cell.paste';
348
- const PASTE_CELL_ABOVE_COMMAND_ID = 'notebook.cell.pasteAbove';
420
+ NotebookClipboardContribution = ( __decorate([( __param(0, IEditorService))], NotebookClipboardContribution));
421
+ registerWorkbenchContribution2(
422
+ NotebookClipboardContribution.ID,
423
+ NotebookClipboardContribution,
424
+ WorkbenchPhase.BlockRestore
425
+ );
426
+ const COPY_CELL_COMMAND_ID = "notebook.cell.copy";
427
+ const CUT_CELL_COMMAND_ID = "notebook.cell.cut";
428
+ const PASTE_CELL_COMMAND_ID = "notebook.cell.paste";
429
+ const PASTE_CELL_ABOVE_COMMAND_ID = "notebook.cell.pasteAbove";
349
430
  registerAction2(class extends NotebookCellAction {
350
431
  constructor() {
351
432
  super({
352
433
  id: COPY_CELL_COMMAND_ID,
353
- title: ( localize(9254, "Copy Cell")),
434
+ title: ( localize(9574, "Copy Cell")),
354
435
  menu: {
355
436
  id: MenuId.NotebookCellTitle,
356
437
  when: NOTEBOOK_EDITOR_FOCUSED,
357
438
  group: CellOverflowToolbarGroups.Copy,
358
- order: 2,
439
+ order: 2
359
440
  },
360
441
  keybinding: isNative ? undefined : {
361
442
  primary: KeyMod.CtrlCmd | KeyCode.KeyC,
362
- win: { primary: KeyMod.CtrlCmd | KeyCode.KeyC, secondary: [KeyMod.CtrlCmd | KeyCode.Insert] },
443
+ win: {
444
+ primary: KeyMod.CtrlCmd | KeyCode.KeyC,
445
+ secondary: [KeyMod.CtrlCmd | KeyCode.Insert]
446
+ },
363
447
  when: ( ContextKeyExpr.and(NOTEBOOK_EDITOR_FOCUSED, ContextKeyExpr.not(InputFocusedContextKey))),
364
448
  weight: KeybindingWeight.WorkbenchContrib
365
449
  }
@@ -373,17 +457,20 @@ registerAction2(class extends NotebookCellAction {
373
457
  constructor() {
374
458
  super({
375
459
  id: CUT_CELL_COMMAND_ID,
376
- title: ( localize(9255, "Cut Cell")),
460
+ title: ( localize(9575, "Cut Cell")),
377
461
  menu: {
378
462
  id: MenuId.NotebookCellTitle,
379
463
  when: ( ContextKeyExpr.and(NOTEBOOK_EDITOR_FOCUSED, NOTEBOOK_EDITOR_EDITABLE, NOTEBOOK_CELL_EDITABLE)),
380
464
  group: CellOverflowToolbarGroups.Copy,
381
- order: 1,
465
+ order: 1
382
466
  },
383
467
  keybinding: isNative ? undefined : {
384
468
  when: ( ContextKeyExpr.and(NOTEBOOK_EDITOR_FOCUSED, ContextKeyExpr.not(InputFocusedContextKey))),
385
469
  primary: KeyMod.CtrlCmd | KeyCode.KeyX,
386
- win: { primary: KeyMod.CtrlCmd | KeyCode.KeyX, secondary: [KeyMod.Shift | KeyCode.Delete] },
470
+ win: {
471
+ primary: KeyMod.CtrlCmd | KeyCode.KeyX,
472
+ secondary: [KeyMod.Shift | KeyCode.Delete]
473
+ },
387
474
  weight: KeybindingWeight.WorkbenchContrib
388
475
  }
389
476
  });
@@ -396,18 +483,24 @@ registerAction2(class extends NotebookAction {
396
483
  constructor() {
397
484
  super({
398
485
  id: PASTE_CELL_COMMAND_ID,
399
- title: ( localize(9256, "Paste Cell")),
486
+ title: ( localize(9576, "Paste Cell")),
400
487
  menu: {
401
488
  id: MenuId.NotebookCellTitle,
402
489
  when: ( ContextKeyExpr.and(NOTEBOOK_EDITOR_FOCUSED, NOTEBOOK_EDITOR_EDITABLE)),
403
490
  group: CellOverflowToolbarGroups.Copy,
404
- order: 3,
491
+ order: 3
405
492
  },
406
493
  keybinding: isNative ? undefined : {
407
494
  when: ( ContextKeyExpr.and(NOTEBOOK_EDITOR_FOCUSED, ContextKeyExpr.not(InputFocusedContextKey))),
408
495
  primary: KeyMod.CtrlCmd | KeyCode.KeyV,
409
- win: { primary: KeyMod.CtrlCmd | KeyCode.KeyV, secondary: [KeyMod.Shift | KeyCode.Insert] },
410
- linux: { primary: KeyMod.CtrlCmd | KeyCode.KeyV, secondary: [KeyMod.Shift | KeyCode.Insert] },
496
+ win: {
497
+ primary: KeyMod.CtrlCmd | KeyCode.KeyV,
498
+ secondary: [KeyMod.Shift | KeyCode.Insert]
499
+ },
500
+ linux: {
501
+ primary: KeyMod.CtrlCmd | KeyCode.KeyV,
502
+ secondary: [KeyMod.Shift | KeyCode.Insert]
503
+ },
411
504
  weight: KeybindingWeight.EditorContrib
412
505
  }
413
506
  });
@@ -428,12 +521,12 @@ registerAction2(class extends NotebookCellAction {
428
521
  constructor() {
429
522
  super({
430
523
  id: PASTE_CELL_ABOVE_COMMAND_ID,
431
- title: ( localize(9257, "Paste Cell Above")),
524
+ title: ( localize(9577, "Paste Cell Above")),
432
525
  keybinding: {
433
526
  when: ( ContextKeyExpr.and(NOTEBOOK_EDITOR_FOCUSED, ContextKeyExpr.not(InputFocusedContextKey))),
434
527
  primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KeyV,
435
528
  weight: NOTEBOOK_EDITOR_WIDGET_ACTION_WEIGHT
436
- },
529
+ }
437
530
  });
438
531
  }
439
532
  async runWithContext(accessor, context) {
@@ -454,25 +547,29 @@ registerAction2(class extends NotebookCellAction {
454
547
  };
455
548
  const currCellIndex = context.notebookEditor.getCellIndex(context.cell);
456
549
  const newFocusIndex = currCellIndex;
457
- textModel.applyEdits([
458
- {
459
- editType: CellEditType.Replace,
460
- index: currCellIndex,
461
- count: 0,
462
- cells: ( pasteCells.items.map(cell => cloneNotebookCellTextModel(cell)))
463
- }
464
- ], true, originalState, () => ({
550
+ textModel.applyEdits([{
551
+ editType: CellEditType.Replace,
552
+ index: currCellIndex,
553
+ count: 0,
554
+ cells: ( pasteCells.items.map(cell => cloneNotebookCellTextModel(cell)))
555
+ }], true, originalState, () => ({
465
556
  kind: SelectionStateType.Index,
466
- focus: { start: newFocusIndex, end: newFocusIndex + 1 },
467
- selections: [{ start: newFocusIndex, end: newFocusIndex + pasteCells.items.length }]
557
+ focus: {
558
+ start: newFocusIndex,
559
+ end: newFocusIndex + 1
560
+ },
561
+ selections: [{
562
+ start: newFocusIndex,
563
+ end: newFocusIndex + pasteCells.items.length
564
+ }]
468
565
  }), undefined, true);
469
566
  }
470
567
  });
471
568
  registerAction2(class extends Action2 {
472
569
  constructor() {
473
570
  super({
474
- id: 'workbench.action.toggleNotebookClipboardLog',
475
- title: ( localize2(9258, 'Toggle Notebook Clipboard Troubleshooting')),
571
+ id: "workbench.action.toggleNotebookClipboardLog",
572
+ title: ( localize2(9578, "Toggle Notebook Clipboard Troubleshooting")),
476
573
  category: Categories.Developer,
477
574
  f1: true
478
575
  });
@@ -488,8 +585,8 @@ registerAction2(class extends Action2 {
488
585
  registerAction2(class extends NotebookCellAction {
489
586
  constructor() {
490
587
  super({
491
- id: 'notebook.cell.output.selectAll',
492
- title: ( localize(9259, "Select All")),
588
+ id: "notebook.cell.output.selectAll",
589
+ title: ( localize(9579, "Select All")),
493
590
  keybinding: {
494
591
  primary: KeyMod.CtrlCmd | KeyCode.KeyA,
495
592
  when: ( ContextKeyExpr.and(NOTEBOOK_EDITOR_FOCUSED, NOTEBOOK_OUTPUT_FOCUSED)),
@@ -511,8 +608,7 @@ registerAction2(class extends NotebookCellAction {
511
608
  }
512
609
  if (cell.inputInOutputIsFocused) {
513
610
  editor.selectInputContents(cell);
514
- }
515
- else {
611
+ } else {
516
612
  editor.selectOutputContent(cell);
517
613
  }
518
614
  return true;
@@ -34,7 +34,9 @@ let NotebookBreakpoints = class NotebookBreakpoints extends Disposable {
34
34
  if (deleteCount > 0) {
35
35
  const deleted = model.cells.slice(start, start + deleteCount);
36
36
  for (const deletedCell of deleted) {
37
- const cellBps = debugModel.getBreakpoints({ uri: deletedCell.uri });
37
+ const cellBps = debugModel.getBreakpoints({
38
+ uri: deletedCell.uri
39
+ });
38
40
  cellBps.forEach(cellBp => this._debugService.removeBreakpoints(cellBp.getId()));
39
41
  }
40
42
  }
@@ -47,7 +49,9 @@ let NotebookBreakpoints = class NotebookBreakpoints extends Disposable {
47
49
  listeners.delete(model.uri);
48
50
  }));
49
51
  this._register(this._debugService.getModel().onDidChangeBreakpoints(e => {
50
- const newCellBp = e?.added?.find(bp => hasKey(bp, { uri: true }) && bp.uri.scheme === Schemas.vscodeNotebookCell);
52
+ const newCellBp = e?.added?.find(bp => hasKey(bp, {
53
+ uri: true
54
+ }) && bp.uri.scheme === Schemas.vscodeNotebookCell);
51
55
  if (newCellBp) {
52
56
  const parsed = CellUri.parse(newCellBp.uri);
53
57
  if (!parsed) {
@@ -76,7 +80,7 @@ let NotebookBreakpoints = class NotebookBreakpoints extends Disposable {
76
80
  });
77
81
  bps.forEach(bp => {
78
82
  const idx = idxMap.get(bp.uri);
79
- if (typeof idx !== 'number') {
83
+ if (typeof idx !== "number") {
80
84
  return;
81
85
  }
82
86
  const notebook = CellUri.parse(bp.uri)?.notebook;
@@ -88,22 +92,16 @@ let NotebookBreakpoints = class NotebookBreakpoints extends Disposable {
88
92
  return;
89
93
  }
90
94
  this._debugService.removeBreakpoints(bp.getId());
91
- this._debugService.addBreakpoints(newUri, [
92
- {
93
- column: bp.column,
94
- condition: bp.condition,
95
- enabled: bp.enabled,
96
- hitCondition: bp.hitCondition,
97
- logMessage: bp.logMessage,
98
- lineNumber: bp.lineNumber
99
- }
100
- ]);
95
+ this._debugService.addBreakpoints(newUri, [{
96
+ column: bp.column,
97
+ condition: bp.condition,
98
+ enabled: bp.enabled,
99
+ hitCondition: bp.hitCondition,
100
+ logMessage: bp.logMessage,
101
+ lineNumber: bp.lineNumber
102
+ }]);
101
103
  });
102
104
  }
103
105
  };
104
- NotebookBreakpoints = ( __decorate([
105
- ( __param(0, IDebugService)),
106
- ( __param(1, INotebookService)),
107
- ( __param(2, IEditorService))
108
- ], NotebookBreakpoints));
106
+ NotebookBreakpoints = ( __decorate([( __param(0, IDebugService)), ( __param(1, INotebookService)), ( __param(2, IEditorService))], NotebookBreakpoints));
109
107
  ( Registry.as(Extensions.Workbench)).registerWorkbenchContribution(NotebookBreakpoints, LifecyclePhase.Restored);
@@ -54,16 +54,13 @@ let NotebookCellPausing = class NotebookCellPausing extends Disposable {
54
54
  const exeState = this._notebookExecutionStateService.getCellExecution(cellUri);
55
55
  if (exeState && (exeState.isPaused !== isPaused || !exeState.didPause)) {
56
56
  exeState.update([{
57
- editType: CellExecutionUpdateType.ExecutionState,
58
- didPause: true,
59
- isPaused
60
- }]);
57
+ editType: CellExecutionUpdateType.ExecutionState,
58
+ didPause: true,
59
+ isPaused
60
+ }]);
61
61
  }
62
62
  }
63
63
  }
64
64
  };
65
- NotebookCellPausing = ( __decorate([
66
- ( __param(0, IDebugService)),
67
- ( __param(1, INotebookExecutionStateService))
68
- ], NotebookCellPausing));
65
+ NotebookCellPausing = ( __decorate([( __param(0, IDebugService)), ( __param(1, INotebookExecutionStateService))], NotebookCellPausing));
69
66
  ( Registry.as(Extensions.Workbench)).registerWorkbenchContribution(NotebookCellPausing, LifecyclePhase.Restored);