@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
@@ -22,168 +22,171 @@ import { IPreferencesService } from '@codingame/monaco-vscode-api/vscode/vs/work
22
22
  registerAction2(class NotebookConfigureLayoutAction extends Action2 {
23
23
  constructor() {
24
24
  super({
25
- id: 'workbench.notebook.layout.select',
26
- title: ( localize2(9431, "Select between Notebook Layouts")),
25
+ id: "workbench.notebook.layout.select",
26
+ title: ( localize2(9751, "Select between Notebook Layouts")),
27
27
  f1: true,
28
28
  precondition: ( ContextKeyExpr.equals(`config.${NotebookSetting.openGettingStarted}`, true)),
29
29
  category: NOTEBOOK_ACTIONS_CATEGORY,
30
- menu: [
31
- {
32
- id: MenuId.EditorTitle,
33
- group: 'notebookLayout',
34
- when: ( ContextKeyExpr.and(NOTEBOOK_IS_ACTIVE_EDITOR, ( ContextKeyExpr.notEquals('config.notebook.globalToolbar', true)), ( ContextKeyExpr.equals(`config.${NotebookSetting.openGettingStarted}`, true)))),
35
- order: 0
36
- },
37
- {
38
- id: MenuId.NotebookToolbar,
39
- group: 'notebookLayout',
40
- when: ( ContextKeyExpr.and(( ContextKeyExpr.equals('config.notebook.globalToolbar', true)), ( ContextKeyExpr.equals(`config.${NotebookSetting.openGettingStarted}`, true)))),
41
- order: 0
42
- }
43
- ]
30
+ menu: [{
31
+ id: MenuId.EditorTitle,
32
+ group: "notebookLayout",
33
+ when: ( ContextKeyExpr.and(NOTEBOOK_IS_ACTIVE_EDITOR, ( ContextKeyExpr.notEquals("config.notebook.globalToolbar", true)), ( ContextKeyExpr.equals(`config.${NotebookSetting.openGettingStarted}`, true)))),
34
+ order: 0
35
+ }, {
36
+ id: MenuId.NotebookToolbar,
37
+ group: "notebookLayout",
38
+ when: ( ContextKeyExpr.and(( ContextKeyExpr.equals("config.notebook.globalToolbar", true)), ( ContextKeyExpr.equals(`config.${NotebookSetting.openGettingStarted}`, true)))),
39
+ order: 0
40
+ }]
44
41
  });
45
42
  }
46
43
  run(accessor) {
47
- accessor.get(ICommandService).executeCommand('workbench.action.openWalkthrough', { category: 'notebooks', step: 'notebookProfile' }, true);
44
+ accessor.get(ICommandService).executeCommand("workbench.action.openWalkthrough", {
45
+ category: "notebooks",
46
+ step: "notebookProfile"
47
+ }, true);
48
48
  }
49
49
  });
50
50
  registerAction2(class NotebookConfigureLayoutAction extends Action2 {
51
51
  constructor() {
52
52
  super({
53
- id: 'workbench.notebook.layout.configure',
54
- title: ( localize2(9432, "Customize Notebook Layout")),
53
+ id: "workbench.notebook.layout.configure",
54
+ title: ( localize2(9752, "Customize Notebook Layout")),
55
55
  f1: true,
56
56
  category: NOTEBOOK_ACTIONS_CATEGORY,
57
- menu: [
58
- {
59
- id: MenuId.NotebookToolbar,
60
- group: 'notebookLayout',
61
- when: ( ContextKeyExpr.equals('config.notebook.globalToolbar', true)),
62
- order: 1
63
- }
64
- ]
57
+ menu: [{
58
+ id: MenuId.NotebookToolbar,
59
+ group: "notebookLayout",
60
+ when: ( ContextKeyExpr.equals("config.notebook.globalToolbar", true)),
61
+ order: 1
62
+ }]
65
63
  });
66
64
  }
67
65
  run(accessor) {
68
- accessor.get(IPreferencesService).openSettings({ jsonEditor: false, query: '@tag:notebookLayout' });
66
+ accessor.get(IPreferencesService).openSettings({
67
+ jsonEditor: false,
68
+ query: "@tag:notebookLayout"
69
+ });
69
70
  }
70
71
  });
71
72
  registerAction2(class NotebookConfigureLayoutFromEditorTitle extends Action2 {
72
73
  constructor() {
73
74
  super({
74
- id: 'workbench.notebook.layout.configure.editorTitle',
75
- title: ( localize2(9432, "Customize Notebook Layout")),
75
+ id: "workbench.notebook.layout.configure.editorTitle",
76
+ title: ( localize2(9752, "Customize Notebook Layout")),
76
77
  f1: false,
77
78
  category: NOTEBOOK_ACTIONS_CATEGORY,
78
- menu: [
79
- {
80
- id: MenuId.NotebookEditorLayoutConfigure,
81
- group: 'notebookLayout',
82
- when: NOTEBOOK_IS_ACTIVE_EDITOR,
83
- order: 1
84
- }
85
- ]
79
+ menu: [{
80
+ id: MenuId.NotebookEditorLayoutConfigure,
81
+ group: "notebookLayout",
82
+ when: NOTEBOOK_IS_ACTIVE_EDITOR,
83
+ order: 1
84
+ }]
86
85
  });
87
86
  }
88
87
  run(accessor) {
89
- accessor.get(IPreferencesService).openSettings({ jsonEditor: false, query: '@tag:notebookLayout' });
88
+ accessor.get(IPreferencesService).openSettings({
89
+ jsonEditor: false,
90
+ query: "@tag:notebookLayout"
91
+ });
90
92
  }
91
93
  });
92
94
  MenuRegistry.appendMenuItem(MenuId.EditorTitle, {
93
95
  submenu: MenuId.NotebookEditorLayoutConfigure,
94
- title: ( localize2(9433, "Customize Notebook...")),
96
+ title: ( localize2(9753, "Customize Notebook...")),
95
97
  icon: Codicon.gear,
96
- group: 'navigation',
98
+ group: "navigation",
97
99
  order: -1,
98
100
  when: NOTEBOOK_IS_ACTIVE_EDITOR
99
101
  });
100
102
  registerAction2(class ToggleLineNumberFromEditorTitle extends Action2 {
101
103
  constructor() {
102
104
  super({
103
- id: 'notebook.toggleLineNumbersFromEditorTitle',
104
- title: ( localize2(9434, 'Toggle Notebook Line Numbers')),
105
- shortTitle: ( localize2(9435, 'Line Numbers')),
105
+ id: "notebook.toggleLineNumbersFromEditorTitle",
106
+ title: ( localize2(9754, "Toggle Notebook Line Numbers")),
107
+ shortTitle: ( localize2(9755, "Line Numbers")),
106
108
  precondition: NOTEBOOK_EDITOR_FOCUSED,
107
- menu: [
108
- {
109
- id: MenuId.NotebookEditorLayoutConfigure,
110
- group: 'notebookLayoutDetails',
111
- order: 1,
112
- when: NOTEBOOK_IS_ACTIVE_EDITOR
113
- }
114
- ],
109
+ menu: [{
110
+ id: MenuId.NotebookEditorLayoutConfigure,
111
+ group: "notebookLayoutDetails",
112
+ order: 1,
113
+ when: NOTEBOOK_IS_ACTIVE_EDITOR
114
+ }],
115
115
  category: NOTEBOOK_ACTIONS_CATEGORY,
116
116
  f1: true,
117
117
  toggled: {
118
- condition: ( ContextKeyExpr.notEquals('config.notebook.lineNumbers', 'off')),
119
- title: ( localize(9436, "Line Numbers")),
118
+ condition: ( ContextKeyExpr.notEquals("config.notebook.lineNumbers", "off")),
119
+ title: ( localize(9756, "Line Numbers"))
120
120
  }
121
121
  });
122
122
  }
123
123
  async run(accessor) {
124
- return accessor.get(ICommandService).executeCommand('notebook.toggleLineNumbers');
124
+ return accessor.get(ICommandService).executeCommand("notebook.toggleLineNumbers");
125
125
  }
126
126
  });
127
127
  registerAction2(class ToggleCellToolbarPositionFromEditorTitle extends Action2 {
128
128
  constructor() {
129
129
  super({
130
- id: 'notebook.toggleCellToolbarPositionFromEditorTitle',
131
- title: ( localize2(9437, 'Toggle Cell Toolbar Position')),
130
+ id: "notebook.toggleCellToolbarPositionFromEditorTitle",
131
+ title: ( localize2(9757, "Toggle Cell Toolbar Position")),
132
132
  menu: [{
133
- id: MenuId.NotebookEditorLayoutConfigure,
134
- group: 'notebookLayoutDetails',
135
- order: 3
136
- }],
133
+ id: MenuId.NotebookEditorLayoutConfigure,
134
+ group: "notebookLayoutDetails",
135
+ order: 3
136
+ }],
137
137
  category: NOTEBOOK_ACTIONS_CATEGORY,
138
138
  f1: false
139
139
  });
140
140
  }
141
141
  async run(accessor, ...args) {
142
- return accessor.get(ICommandService).executeCommand('notebook.toggleCellToolbarPosition', ...args);
142
+ return accessor.get(ICommandService).executeCommand("notebook.toggleCellToolbarPosition", ...args);
143
143
  }
144
144
  });
145
145
  registerAction2(class ToggleBreadcrumbFromEditorTitle extends Action2 {
146
146
  constructor() {
147
147
  super({
148
- id: 'breadcrumbs.toggleFromEditorTitle',
149
- title: ( localize2(9438, 'Toggle Breadcrumbs')),
150
- shortTitle: ( localize2(9439, 'Breadcrumbs')),
148
+ id: "breadcrumbs.toggleFromEditorTitle",
149
+ title: ( localize2(9758, "Toggle Breadcrumbs")),
150
+ shortTitle: ( localize2(9759, "Breadcrumbs")),
151
151
  toggled: {
152
- condition: ( ContextKeyExpr.equals('config.breadcrumbs.enabled', true)),
153
- title: ( localize(9440, "Breadcrumbs"))
152
+ condition: ( ContextKeyExpr.equals("config.breadcrumbs.enabled", true)),
153
+ title: ( localize(9760, "Breadcrumbs"))
154
154
  },
155
155
  menu: [{
156
- id: MenuId.NotebookEditorLayoutConfigure,
157
- group: 'notebookLayoutDetails',
158
- order: 2
159
- }],
156
+ id: MenuId.NotebookEditorLayoutConfigure,
157
+ group: "notebookLayoutDetails",
158
+ order: 2
159
+ }],
160
160
  category: NOTEBOOK_ACTIONS_CATEGORY,
161
161
  f1: false
162
162
  });
163
163
  }
164
164
  async run(accessor) {
165
- return accessor.get(ICommandService).executeCommand('breadcrumbs.toggle');
165
+ return accessor.get(ICommandService).executeCommand("breadcrumbs.toggle");
166
166
  }
167
167
  });
168
168
  registerAction2(class SaveMimeTypeDisplayOrder extends Action2 {
169
169
  constructor() {
170
170
  super({
171
- id: 'notebook.saveMimeTypeOrder',
172
- title: ( localize2(9441, "Save Mimetype Display Order")),
171
+ id: "notebook.saveMimeTypeOrder",
172
+ title: ( localize2(9761, "Save Mimetype Display Order")),
173
173
  f1: true,
174
174
  category: NOTEBOOK_ACTIONS_CATEGORY,
175
- precondition: NOTEBOOK_IS_ACTIVE_EDITOR,
175
+ precondition: NOTEBOOK_IS_ACTIVE_EDITOR
176
176
  });
177
177
  }
178
178
  run(accessor) {
179
179
  const service = accessor.get(INotebookService);
180
180
  const disposables = ( new DisposableStore());
181
181
  const qp = disposables.add(accessor.get(IQuickInputService).createQuickPick());
182
- qp.placeholder = ( localize(9442, 'Settings file to save in'));
183
- qp.items = [
184
- { target: ConfigurationTarget.USER, label: ( localize(9443, 'User Settings')) },
185
- { target: ConfigurationTarget.WORKSPACE, label: ( localize(9444, 'Workspace Settings')) },
186
- ];
182
+ qp.placeholder = ( localize(9762, "Settings file to save in"));
183
+ qp.items = [{
184
+ target: ConfigurationTarget.USER,
185
+ label: ( localize(9763, "User Settings"))
186
+ }, {
187
+ target: ConfigurationTarget.WORKSPACE,
188
+ label: ( localize(9764, "Workspace Settings"))
189
+ }];
187
190
  disposables.add(qp.onDidAccept(() => {
188
191
  const target = qp.selectedItems[0]?.target;
189
192
  if (target !== undefined) {
@@ -198,8 +201,8 @@ registerAction2(class SaveMimeTypeDisplayOrder extends Action2 {
198
201
  registerAction2(class NotebookWebviewResetAction extends Action2 {
199
202
  constructor() {
200
203
  super({
201
- id: 'workbench.notebook.layout.webview.reset',
202
- title: ( localize2(9445, "Reset Notebook Webview")),
204
+ id: "workbench.notebook.layout.webview.reset",
205
+ title: ( localize2(9765, "Reset Notebook Webview")),
203
206
  f1: false,
204
207
  category: NOTEBOOK_ACTIONS_CATEGORY
205
208
  });
@@ -215,8 +218,7 @@ registerAction2(class NotebookWebviewResetAction extends Action2 {
215
218
  widget.getInnerWebview()?.reload();
216
219
  }
217
220
  }
218
- }
219
- else {
221
+ } else {
220
222
  const editor = getNotebookEditorFromEditorPane(editorService.activeEditorPane);
221
223
  if (!editor) {
222
224
  return;
@@ -228,28 +230,34 @@ registerAction2(class NotebookWebviewResetAction extends Action2 {
228
230
  registerAction2(class ToggleNotebookStickyScroll extends Action2 {
229
231
  constructor() {
230
232
  super({
231
- id: 'notebook.action.toggleNotebookStickyScroll',
233
+ id: "notebook.action.toggleNotebookStickyScroll",
232
234
  title: {
233
- ...( localize2(9446, "Toggle Notebook Sticky Scroll")),
234
- mnemonicTitle: ( localize(9447, "&&Sticky Scroll")),
235
+ ...( localize2(9766, "Toggle Notebook Sticky Scroll")),
236
+ mnemonicTitle: ( localize(9767, "&&Sticky Scroll"))
235
237
  },
236
- shortTitle: ( localize2(9448, "Sticky Scroll")),
238
+ shortTitle: ( localize2(9768, "Sticky Scroll")),
237
239
  category: Categories.View,
238
240
  toggled: {
239
- condition: ( ContextKeyExpr.equals('config.notebook.stickyScroll.enabled', true)),
240
- title: ( localize(9449, "Sticky Scroll")),
241
- mnemonicTitle: ( localize(9447, "&&Sticky Scroll")),
241
+ condition: ( ContextKeyExpr.equals("config.notebook.stickyScroll.enabled", true)),
242
+ title: ( localize(9769, "Sticky Scroll")),
243
+ mnemonicTitle: ( localize(9767, "&&Sticky Scroll"))
242
244
  },
243
- menu: [
244
- { id: MenuId.CommandPalette },
245
- { id: MenuId.NotebookStickyScrollContext, group: 'notebookView', order: 2 },
246
- { id: MenuId.NotebookToolbarContext, group: 'notebookView', order: 2 }
247
- ]
245
+ menu: [{
246
+ id: MenuId.CommandPalette
247
+ }, {
248
+ id: MenuId.NotebookStickyScrollContext,
249
+ group: "notebookView",
250
+ order: 2
251
+ }, {
252
+ id: MenuId.NotebookToolbarContext,
253
+ group: "notebookView",
254
+ order: 2
255
+ }]
248
256
  });
249
257
  }
250
258
  async run(accessor) {
251
259
  const configurationService = accessor.get(IConfigurationService);
252
- const newValue = !configurationService.getValue('notebook.stickyScroll.enabled');
253
- return configurationService.updateValue('notebook.stickyScroll.enabled', newValue);
260
+ const newValue = !configurationService.getValue("notebook.stickyScroll.enabled");
261
+ return configurationService.updateValue("notebook.stickyScroll.enabled", newValue);
254
262
  }
255
263
  });
@@ -15,12 +15,14 @@ import { isNotebookEditorInput } from '@codingame/monaco-vscode-api/vscode/vs/wo
15
15
  import { IEditorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service';
16
16
 
17
17
  class NotebookIndentUsingTabs extends Action2 {
18
- static { this.ID = 'notebook.action.indentUsingTabs'; }
18
+ static {
19
+ this.ID = "notebook.action.indentUsingTabs";
20
+ }
19
21
  constructor() {
20
22
  super({
21
23
  id: NotebookIndentUsingTabs.ID,
22
- title: ( localize(9450, "Indent Using Tabs")),
23
- precondition: undefined,
24
+ title: ( localize(9770, "Indent Using Tabs")),
25
+ precondition: undefined
24
26
  });
25
27
  }
26
28
  run(accessor, ...args) {
@@ -28,12 +30,14 @@ class NotebookIndentUsingTabs extends Action2 {
28
30
  }
29
31
  }
30
32
  class NotebookIndentUsingSpaces extends Action2 {
31
- static { this.ID = 'notebook.action.indentUsingSpaces'; }
33
+ static {
34
+ this.ID = "notebook.action.indentUsingSpaces";
35
+ }
32
36
  constructor() {
33
37
  super({
34
38
  id: NotebookIndentUsingSpaces.ID,
35
- title: ( localize(9451, "Indent Using Spaces")),
36
- precondition: undefined,
39
+ title: ( localize(9771, "Indent Using Spaces")),
40
+ precondition: undefined
37
41
  });
38
42
  }
39
43
  run(accessor, ...args) {
@@ -41,12 +45,14 @@ class NotebookIndentUsingSpaces extends Action2 {
41
45
  }
42
46
  }
43
47
  class NotebookChangeTabDisplaySize extends Action2 {
44
- static { this.ID = 'notebook.action.changeTabDisplaySize'; }
48
+ static {
49
+ this.ID = "notebook.action.changeTabDisplaySize";
50
+ }
45
51
  constructor() {
46
52
  super({
47
53
  id: NotebookChangeTabDisplaySize.ID,
48
- title: ( localize(9452, "Change Tab Display Size")),
49
- precondition: undefined,
54
+ title: ( localize(9772, "Change Tab Display Size")),
55
+ precondition: undefined
50
56
  });
51
57
  }
52
58
  run(accessor, ...args) {
@@ -54,12 +60,14 @@ class NotebookChangeTabDisplaySize extends Action2 {
54
60
  }
55
61
  }
56
62
  class NotebookIndentationToSpacesAction extends Action2 {
57
- static { this.ID = 'notebook.action.convertIndentationToSpaces'; }
63
+ static {
64
+ this.ID = "notebook.action.convertIndentationToSpaces";
65
+ }
58
66
  constructor() {
59
67
  super({
60
68
  id: NotebookIndentationToSpacesAction.ID,
61
- title: ( localize(9453, "Convert Indentation to Spaces")),
62
- precondition: undefined,
69
+ title: ( localize(9773, "Convert Indentation to Spaces")),
70
+ precondition: undefined
63
71
  });
64
72
  }
65
73
  run(accessor, ...args) {
@@ -67,12 +75,14 @@ class NotebookIndentationToSpacesAction extends Action2 {
67
75
  }
68
76
  }
69
77
  class NotebookIndentationToTabsAction extends Action2 {
70
- static { this.ID = 'notebook.action.convertIndentationToTabs'; }
78
+ static {
79
+ this.ID = "notebook.action.convertIndentationToTabs";
80
+ }
71
81
  constructor() {
72
82
  super({
73
83
  id: NotebookIndentationToTabsAction.ID,
74
- title: ( localize(9454, "Convert Indentation to Tabs")),
75
- precondition: undefined,
84
+ title: ( localize(9774, "Convert Indentation to Tabs")),
85
+ precondition: undefined
76
86
  });
77
87
  }
78
88
  run(accessor, ...args) {
@@ -95,31 +105,32 @@ function changeNotebookIndentation(accessor, insertSpaces, displaySizeOnly) {
95
105
  }
96
106
  const picks = ( [1, 2, 3, 4, 5, 6, 7, 8].map(n => ({
97
107
  id: ( n.toString()),
98
- label: ( n.toString()),
108
+ label: ( n.toString())
99
109
  })));
100
110
  const initialConfig = configurationService.getValue(NotebookSetting.cellEditorOptionsCustomizations);
101
- const initialInsertSpaces = initialConfig['editor.insertSpaces'];
102
- delete initialConfig['editor.indentSize'];
103
- delete initialConfig['editor.tabSize'];
104
- delete initialConfig['editor.insertSpaces'];
111
+ const initialInsertSpaces = initialConfig["editor.insertSpaces"];
112
+ delete initialConfig["editor.indentSize"];
113
+ delete initialConfig["editor.tabSize"];
114
+ delete initialConfig["editor.insertSpaces"];
105
115
  setTimeout(() => {
106
- quickInputService.pick(picks, { placeHolder: ( localize(9455, "Select Tab Size for Current File")) }).then(pick => {
116
+ quickInputService.pick(picks, {
117
+ placeHolder: ( localize(9775, "Select Tab Size for Current File"))
118
+ }).then(pick => {
107
119
  if (pick) {
108
120
  const pickedVal = parseInt(pick.label, 10);
109
121
  if (displaySizeOnly) {
110
122
  configurationService.updateValue(NotebookSetting.cellEditorOptionsCustomizations, {
111
123
  ...initialConfig,
112
- 'editor.tabSize': pickedVal,
113
- 'editor.indentSize': pickedVal,
114
- 'editor.insertSpaces': initialInsertSpaces
124
+ "editor.tabSize": pickedVal,
125
+ "editor.indentSize": pickedVal,
126
+ "editor.insertSpaces": initialInsertSpaces
115
127
  });
116
- }
117
- else {
128
+ } else {
118
129
  configurationService.updateValue(NotebookSetting.cellEditorOptionsCustomizations, {
119
130
  ...initialConfig,
120
- 'editor.tabSize': pickedVal,
121
- 'editor.indentSize': pickedVal,
122
- 'editor.insertSpaces': insertSpaces
131
+ "editor.tabSize": pickedVal,
132
+ "editor.indentSize": pickedVal,
133
+ "editor.insertSpaces": insertSpaces
123
134
  });
124
135
  }
125
136
  }
@@ -144,7 +155,7 @@ function convertNotebookIndentation(accessor, tabsToSpaces) {
144
155
  }
145
156
  const disposable = ( new DisposableStore());
146
157
  try {
147
- Promise.all(( notebookTextModel.cells.map(async (cell) => {
158
+ Promise.all(( notebookTextModel.cells.map(async cell => {
148
159
  const ref = await textModelService.createModelReference(cell.uri);
149
160
  disposable.add(ref);
150
161
  const textEditorModel = ref.object.textEditorModel;
@@ -153,36 +164,38 @@ function convertNotebookIndentation(accessor, tabsToSpaces) {
153
164
  return;
154
165
  }
155
166
  const edits = getIndentationEditOperations(textEditorModel, modelOpts.tabSize, tabsToSpaces);
156
- bulkEditService.apply(edits, { label: ( localize(9456, "Convert Indentation")), code: 'undoredo.convertIndentation', });
167
+ bulkEditService.apply(edits, {
168
+ label: ( localize(9776, "Convert Indentation")),
169
+ code: "undoredo.convertIndentation"
170
+ });
157
171
  }))).then(() => {
158
172
  const initialConfig = configurationService.getValue(NotebookSetting.cellEditorOptionsCustomizations);
159
- const initialIndentSize = initialConfig['editor.indentSize'];
160
- const initialTabSize = initialConfig['editor.tabSize'];
161
- delete initialConfig['editor.indentSize'];
162
- delete initialConfig['editor.tabSize'];
163
- delete initialConfig['editor.insertSpaces'];
173
+ const initialIndentSize = initialConfig["editor.indentSize"];
174
+ const initialTabSize = initialConfig["editor.tabSize"];
175
+ delete initialConfig["editor.indentSize"];
176
+ delete initialConfig["editor.tabSize"];
177
+ delete initialConfig["editor.insertSpaces"];
164
178
  configurationService.updateValue(NotebookSetting.cellEditorOptionsCustomizations, {
165
179
  ...initialConfig,
166
- 'editor.tabSize': initialTabSize,
167
- 'editor.indentSize': initialIndentSize,
168
- 'editor.insertSpaces': tabsToSpaces
180
+ "editor.tabSize": initialTabSize,
181
+ "editor.indentSize": initialIndentSize,
182
+ "editor.insertSpaces": tabsToSpaces
169
183
  });
170
184
  disposable.dispose();
171
185
  });
172
- }
173
- catch {
174
- logService.error('Failed to convert indentation to spaces for notebook cells.');
186
+ } catch {
187
+ logService.error("Failed to convert indentation to spaces for notebook cells.");
175
188
  }
176
189
  }
177
190
  function getIndentationEditOperations(model, tabSize, tabsToSpaces) {
178
191
  if (model.getLineCount() === 1 && model.getLineMaxColumn(1) === 1) {
179
192
  return [];
180
193
  }
181
- let spaces = '';
194
+ let spaces = "";
182
195
  for (let i = 0; i < tabSize; i++) {
183
- spaces += ' ';
196
+ spaces += " ";
184
197
  }
185
- const spacesRegExp = ( new RegExp(spaces, 'gi'));
198
+ const spacesRegExp = ( new RegExp(spaces, "gi"));
186
199
  const edits = [];
187
200
  for (let lineNumber = 1, lineCount = model.getLineCount(); lineNumber <= lineCount; lineNumber++) {
188
201
  let lastIndentationColumn = model.getLineFirstNonWhitespaceColumn(lineNumber);
@@ -194,10 +207,11 @@ function getIndentationEditOperations(model, tabSize, tabsToSpaces) {
194
207
  }
195
208
  const originalIndentationRange = ( new Range(lineNumber, 1, lineNumber, lastIndentationColumn));
196
209
  const originalIndentation = model.getValueInRange(originalIndentationRange);
197
- const newIndentation = (tabsToSpaces
198
- ? originalIndentation.replace(/\t/ig, spaces)
199
- : originalIndentation.replace(spacesRegExp, '\t'));
200
- edits.push(( new ResourceTextEdit(model.uri, { range: originalIndentationRange, text: newIndentation })));
210
+ const newIndentation = (tabsToSpaces ? originalIndentation.replace(/\t/ig, spaces) : originalIndentation.replace(spacesRegExp, "\t"));
211
+ edits.push(( new ResourceTextEdit(model.uri, {
212
+ range: originalIndentationRange,
213
+ text: newIndentation
214
+ })));
201
215
  }
202
216
  return edits;
203
217
  }