@codingame/monaco-vscode-notebook-service-override 4.5.1 → 4.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/emptyTextEditorHint/emptyTextEditorHint.js +30 -44
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/statusBarProviders.js +24 -32
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/clipboard/notebookClipboard.js +30 -53
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/editorStatusBar/editorStatusBar.js +40 -84
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFind.js +9 -12
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/format/formatting.js +35 -48
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/gettingStarted/notebookGettingStarted.js +13 -16
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/layout/layoutActions.js +2 -5
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/navigation/arrow.js +94 -77
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariables.js +13 -16
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesDataSource.js +8 -11
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesTree.js +3 -12
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesView.js +25 -28
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/outline/notebookOutline.js +71 -89
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/profile/notebookProfile.js +4 -7
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/saveParticipants/saveParticipants.js +97 -119
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/troubleshoot/layout.js +7 -18
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions.js +128 -177
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/executeActions.js +132 -145
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/insertCellActions.js +70 -130
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/layoutActions.js +32 -92
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/sectionActions.js +39 -64
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementOutputs.js +28 -43
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementViewModel.js +7 -7
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffNestedCellViewModel.js +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffActions.js +23 -66
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditor.js +58 -57
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebook.contribution.js +162 -264
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookAccessibility.js +33 -36
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookExtensionPoint.js +58 -153
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookEditorServiceImpl.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookExecutionServiceImpl.js +15 -14
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookExecutionStateServiceImpl.js +5 -5
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKernelHistoryServiceImpl.js +13 -16
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKernelServiceImpl.js +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKeymapServiceImpl.js +22 -29
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookLoggingServiceImpl.js +5 -8
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookServiceImpl.js +100 -92
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookWorkerServiceImpl.js +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/common/model/cellEdit.js +4 -4
- package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookTextModel.js +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookDiffEditorInput.js +6 -2
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorModelResolverServiceImpl.js +6 -4
- package/vscode/src/vs/workbench/contrib/notebook/common/services/notebookSimpleWorker.js +1 -1
- package/vscode/src/vs/workbench/services/workingCopy/common/fileWorkingCopyManager.js +41 -76
- package/vscode/src/vs/workbench/services/workingCopy/common/storedFileWorkingCopyManager.js +42 -45
|
@@ -22,6 +22,7 @@ import { INotebookExecutionStateService } from 'vscode/vscode/vs/workbench/contr
|
|
|
22
22
|
import { IEditorGroupsService } from 'vscode/vscode/vs/workbench/services/editor/common/editorGroupsService.service';
|
|
23
23
|
import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService.service';
|
|
24
24
|
|
|
25
|
+
const _moduleId = "vs/workbench/contrib/notebook/browser/controller/executeActions";
|
|
25
26
|
const EXECUTE_NOTEBOOK_COMMAND_ID = 'notebook.execute';
|
|
26
27
|
const CANCEL_NOTEBOOK_COMMAND_ID = 'notebook.cancelExecution';
|
|
27
28
|
const INTERRUPT_NOTEBOOK_COMMAND_ID = 'notebook.interruptExecution';
|
|
@@ -34,12 +35,15 @@ const EXECUTE_CELLS_ABOVE = 'notebook.cell.executeCellsAbove';
|
|
|
34
35
|
const RENDER_ALL_MARKDOWN_CELLS = 'notebook.renderAllMarkdownCells';
|
|
35
36
|
const REVEAL_RUNNING_CELL = 'notebook.revealRunningCell';
|
|
36
37
|
const REVEAL_LAST_FAILED_CELL = 'notebook.revealLastFailedCell';
|
|
37
|
-
const executeCondition = ( ContextKeyExpr.and(
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
)
|
|
42
|
-
|
|
38
|
+
const executeCondition = ( (ContextKeyExpr.and(
|
|
39
|
+
(NOTEBOOK_CELL_TYPE.isEqualTo('code')),
|
|
40
|
+
(ContextKeyExpr.or(
|
|
41
|
+
ContextKeyExpr.greater(NOTEBOOK_KERNEL_COUNT.key, 0),
|
|
42
|
+
ContextKeyExpr.greater(NOTEBOOK_KERNEL_SOURCE_COUNT.key, 0),
|
|
43
|
+
NOTEBOOK_MISSING_KERNEL_EXTENSION
|
|
44
|
+
))
|
|
45
|
+
)));
|
|
46
|
+
const executeThisCellCondition = ( (ContextKeyExpr.and(executeCondition, (NOTEBOOK_CELL_EXECUTING.toNegated()))));
|
|
43
47
|
function renderAllMarkdownCells(context) {
|
|
44
48
|
for (let i = 0; i < context.notebookEditor.getLength(); i++) {
|
|
45
49
|
const cell = context.notebookEditor.cellAt(i);
|
|
@@ -91,11 +95,7 @@ registerAction2(class RenderAllMarkdownCellsAction extends NotebookAction {
|
|
|
91
95
|
constructor() {
|
|
92
96
|
super({
|
|
93
97
|
id: RENDER_ALL_MARKDOWN_CELLS,
|
|
94
|
-
title: ( localizeWithPath(
|
|
95
|
-
'vs/workbench/contrib/notebook/browser/controller/executeActions',
|
|
96
|
-
'notebookActions.renderMarkdown',
|
|
97
|
-
"Render All Markdown Cells"
|
|
98
|
-
)),
|
|
98
|
+
title: ( localizeWithPath(_moduleId, 0, "Render All Markdown Cells")),
|
|
99
99
|
});
|
|
100
100
|
}
|
|
101
101
|
async runWithContext(accessor, context) {
|
|
@@ -106,18 +106,10 @@ registerAction2(class ExecuteNotebookAction extends NotebookAction {
|
|
|
106
106
|
constructor() {
|
|
107
107
|
super({
|
|
108
108
|
id: EXECUTE_NOTEBOOK_COMMAND_ID,
|
|
109
|
-
title: ( localizeWithPath(
|
|
110
|
-
'vs/workbench/contrib/notebook/browser/controller/executeActions',
|
|
111
|
-
'notebookActions.executeNotebook',
|
|
112
|
-
"Run All"
|
|
113
|
-
)),
|
|
109
|
+
title: ( localizeWithPath(_moduleId, 1, "Run All")),
|
|
114
110
|
icon: executeAllIcon,
|
|
115
111
|
metadata: {
|
|
116
|
-
description: ( localizeWithPath(
|
|
117
|
-
'vs/workbench/contrib/notebook/browser/controller/executeActions',
|
|
118
|
-
'notebookActions.executeNotebook',
|
|
119
|
-
"Run All"
|
|
120
|
-
)),
|
|
112
|
+
description: ( localizeWithPath(_moduleId, 1, "Run All")),
|
|
121
113
|
args: [
|
|
122
114
|
{
|
|
123
115
|
name: 'uri',
|
|
@@ -130,13 +122,27 @@ registerAction2(class ExecuteNotebookAction extends NotebookAction {
|
|
|
130
122
|
id: MenuId.EditorTitle,
|
|
131
123
|
order: -1,
|
|
132
124
|
group: 'navigation',
|
|
133
|
-
when: ( ContextKeyExpr.and(
|
|
125
|
+
when: ( (ContextKeyExpr.and(
|
|
126
|
+
NOTEBOOK_IS_ACTIVE_EDITOR,
|
|
127
|
+
executeNotebookCondition,
|
|
128
|
+
(ContextKeyExpr.or(
|
|
129
|
+
(NOTEBOOK_INTERRUPTIBLE_KERNEL.toNegated()),
|
|
130
|
+
(NOTEBOOK_HAS_SOMETHING_RUNNING.toNegated())
|
|
131
|
+
)),
|
|
132
|
+
(ContextKeyExpr.notEquals('config.notebook.globalToolbar', true))
|
|
133
|
+
)))
|
|
134
134
|
},
|
|
135
135
|
{
|
|
136
136
|
id: MenuId.NotebookToolbar,
|
|
137
137
|
order: -1,
|
|
138
138
|
group: 'navigation/execute',
|
|
139
|
-
when: ( ContextKeyExpr.and(executeNotebookCondition,
|
|
139
|
+
when: ( (ContextKeyExpr.and(executeNotebookCondition, (ContextKeyExpr.or(
|
|
140
|
+
(NOTEBOOK_INTERRUPTIBLE_KERNEL.toNegated()),
|
|
141
|
+
(NOTEBOOK_HAS_SOMETHING_RUNNING.toNegated())
|
|
142
|
+
)), ( (ContextKeyExpr.and(
|
|
143
|
+
NOTEBOOK_HAS_SOMETHING_RUNNING,
|
|
144
|
+
(NOTEBOOK_INTERRUPTIBLE_KERNEL.toNegated())
|
|
145
|
+
)))?.negate(), (ContextKeyExpr.equals('config.notebook.globalToolbar', true)))))
|
|
140
146
|
}
|
|
141
147
|
]
|
|
142
148
|
});
|
|
@@ -147,7 +153,7 @@ registerAction2(class ExecuteNotebookAction extends NotebookAction {
|
|
|
147
153
|
async runWithContext(accessor, context) {
|
|
148
154
|
renderAllMarkdownCells(context);
|
|
149
155
|
const editorService = accessor.get(IEditorService);
|
|
150
|
-
const editor = editorService.getEditors(0 ).find(editor => editor.editor instanceof NotebookEditorInput && editor.editor.viewType === context.notebookEditor.textModel.viewType && ( editor.editor.resource.toString()) === ( context.notebookEditor.textModel.uri.toString()));
|
|
156
|
+
const editor = editorService.getEditors(0 ).find(editor => editor.editor instanceof NotebookEditorInput && editor.editor.viewType === context.notebookEditor.textModel.viewType && ( (editor.editor.resource.toString())) === ( (context.notebookEditor.textModel.uri.toString())));
|
|
151
157
|
const editorGroupService = accessor.get(IEditorGroupsService);
|
|
152
158
|
if (editor) {
|
|
153
159
|
const group = editorGroupService.getGroup(editor.groupId);
|
|
@@ -161,13 +167,12 @@ registerAction2(class ExecuteCell extends NotebookMultiCellAction {
|
|
|
161
167
|
super({
|
|
162
168
|
id: EXECUTE_CELL_COMMAND_ID,
|
|
163
169
|
precondition: executeThisCellCondition,
|
|
164
|
-
title: ( localizeWithPath(
|
|
165
|
-
'vs/workbench/contrib/notebook/browser/controller/executeActions',
|
|
166
|
-
'notebookActions.execute',
|
|
167
|
-
"Execute Cell"
|
|
168
|
-
)),
|
|
170
|
+
title: ( localizeWithPath(_moduleId, 2, "Execute Cell")),
|
|
169
171
|
keybinding: {
|
|
170
|
-
when: ( ContextKeyExpr.or(
|
|
172
|
+
when: ( (ContextKeyExpr.or(
|
|
173
|
+
NOTEBOOK_CELL_LIST_FOCUSED,
|
|
174
|
+
(ContextKeyExpr.and(CTX_NOTEBOOK_CELL_CHAT_FOCUSED, CTX_INLINE_CHAT_FOCUSED))
|
|
175
|
+
))),
|
|
171
176
|
primary: 256 | 3 ,
|
|
172
177
|
win: {
|
|
173
178
|
primary: 2048 | 512 | 3
|
|
@@ -180,11 +185,7 @@ registerAction2(class ExecuteCell extends NotebookMultiCellAction {
|
|
|
180
185
|
group: 'inline'
|
|
181
186
|
},
|
|
182
187
|
metadata: {
|
|
183
|
-
description: ( localizeWithPath(
|
|
184
|
-
'vs/workbench/contrib/notebook/browser/controller/executeActions',
|
|
185
|
-
'notebookActions.execute',
|
|
186
|
-
"Execute Cell"
|
|
187
|
-
)),
|
|
188
|
+
description: ( localizeWithPath(_moduleId, 2, "Execute Cell")),
|
|
188
189
|
args: cellExecutionArgs
|
|
189
190
|
},
|
|
190
191
|
icon: executeIcon
|
|
@@ -218,21 +219,23 @@ registerAction2(class ExecuteAboveCells extends NotebookMultiCellAction {
|
|
|
218
219
|
super({
|
|
219
220
|
id: EXECUTE_CELLS_ABOVE,
|
|
220
221
|
precondition: executeCondition,
|
|
221
|
-
title: ( localizeWithPath(
|
|
222
|
-
'vs/workbench/contrib/notebook/browser/controller/executeActions',
|
|
223
|
-
'notebookActions.executeAbove',
|
|
224
|
-
"Execute Above Cells"
|
|
225
|
-
)),
|
|
222
|
+
title: ( localizeWithPath(_moduleId, 3, "Execute Above Cells")),
|
|
226
223
|
menu: [
|
|
227
224
|
{
|
|
228
225
|
id: MenuId.NotebookCellExecute,
|
|
229
|
-
when: ( ContextKeyExpr.and(
|
|
226
|
+
when: ( (ContextKeyExpr.and(
|
|
227
|
+
executeCondition,
|
|
228
|
+
(ContextKeyExpr.equals(`config.${NotebookSetting.consolidatedRunButton}`, true))
|
|
229
|
+
)))
|
|
230
230
|
},
|
|
231
231
|
{
|
|
232
232
|
id: MenuId.NotebookCellTitle,
|
|
233
233
|
order: 1 ,
|
|
234
234
|
group: CELL_TITLE_CELL_GROUP_ID,
|
|
235
|
-
when: ( ContextKeyExpr.and(
|
|
235
|
+
when: ( (ContextKeyExpr.and(
|
|
236
|
+
executeCondition,
|
|
237
|
+
(ContextKeyExpr.equals(`config.${NotebookSetting.consolidatedRunButton}`, false))
|
|
238
|
+
)))
|
|
236
239
|
}
|
|
237
240
|
],
|
|
238
241
|
icon: executeAboveIcon
|
|
@@ -248,7 +251,7 @@ registerAction2(class ExecuteAboveCells extends NotebookMultiCellAction {
|
|
|
248
251
|
await context.notebookEditor.focusNotebookCell(context.cell, 'container', { skipReveal: true });
|
|
249
252
|
}
|
|
250
253
|
else {
|
|
251
|
-
endCellIdx = Math.min(...( context.selectedCells.map(cell => context.notebookEditor.getCellIndex(cell))));
|
|
254
|
+
endCellIdx = Math.min(...( (context.selectedCells.map(cell => context.notebookEditor.getCellIndex(cell)))));
|
|
252
255
|
}
|
|
253
256
|
if (typeof endCellIdx === 'number') {
|
|
254
257
|
const range = { start: 0, end: endCellIdx };
|
|
@@ -262,21 +265,23 @@ registerAction2(class ExecuteCellAndBelow extends NotebookMultiCellAction {
|
|
|
262
265
|
super({
|
|
263
266
|
id: EXECUTE_CELL_AND_BELOW,
|
|
264
267
|
precondition: executeCondition,
|
|
265
|
-
title: ( localizeWithPath(
|
|
266
|
-
'vs/workbench/contrib/notebook/browser/controller/executeActions',
|
|
267
|
-
'notebookActions.executeBelow',
|
|
268
|
-
"Execute Cell and Below"
|
|
269
|
-
)),
|
|
268
|
+
title: ( localizeWithPath(_moduleId, 4, "Execute Cell and Below")),
|
|
270
269
|
menu: [
|
|
271
270
|
{
|
|
272
271
|
id: MenuId.NotebookCellExecute,
|
|
273
|
-
when: ( ContextKeyExpr.and(
|
|
272
|
+
when: ( (ContextKeyExpr.and(
|
|
273
|
+
executeCondition,
|
|
274
|
+
(ContextKeyExpr.equals(`config.${NotebookSetting.consolidatedRunButton}`, true))
|
|
275
|
+
)))
|
|
274
276
|
},
|
|
275
277
|
{
|
|
276
278
|
id: MenuId.NotebookCellTitle,
|
|
277
279
|
order: 2 ,
|
|
278
280
|
group: CELL_TITLE_CELL_GROUP_ID,
|
|
279
|
-
when: ( ContextKeyExpr.and(
|
|
281
|
+
when: ( (ContextKeyExpr.and(
|
|
282
|
+
executeCondition,
|
|
283
|
+
(ContextKeyExpr.equals(`config.${NotebookSetting.consolidatedRunButton}`, false))
|
|
284
|
+
)))
|
|
280
285
|
}
|
|
281
286
|
],
|
|
282
287
|
icon: executeBelowIcon
|
|
@@ -292,7 +297,7 @@ registerAction2(class ExecuteCellAndBelow extends NotebookMultiCellAction {
|
|
|
292
297
|
await context.notebookEditor.focusNotebookCell(context.cell, 'container', { skipReveal: true });
|
|
293
298
|
}
|
|
294
299
|
else {
|
|
295
|
-
startCellIdx = Math.min(...( context.selectedCells.map(cell => context.notebookEditor.getCellIndex(cell))));
|
|
300
|
+
startCellIdx = Math.min(...( (context.selectedCells.map(cell => context.notebookEditor.getCellIndex(cell)))));
|
|
296
301
|
}
|
|
297
302
|
if (typeof startCellIdx === 'number') {
|
|
298
303
|
const range = { start: startCellIdx, end: context.notebookEditor.getLength() };
|
|
@@ -306,17 +311,9 @@ registerAction2(class ExecuteCellFocusContainer extends NotebookMultiCellAction
|
|
|
306
311
|
super({
|
|
307
312
|
id: EXECUTE_CELL_FOCUS_CONTAINER_COMMAND_ID,
|
|
308
313
|
precondition: executeThisCellCondition,
|
|
309
|
-
title: ( localizeWithPath(
|
|
310
|
-
'vs/workbench/contrib/notebook/browser/controller/executeActions',
|
|
311
|
-
'notebookActions.executeAndFocusContainer',
|
|
312
|
-
"Execute Cell and Focus Container"
|
|
313
|
-
)),
|
|
314
|
+
title: ( localizeWithPath(_moduleId, 5, "Execute Cell and Focus Container")),
|
|
314
315
|
metadata: {
|
|
315
|
-
description: ( localizeWithPath(
|
|
316
|
-
'vs/workbench/contrib/notebook/browser/controller/executeActions',
|
|
317
|
-
'notebookActions.executeAndFocusContainer',
|
|
318
|
-
"Execute Cell and Focus Container"
|
|
319
|
-
)),
|
|
316
|
+
description: ( localizeWithPath(_moduleId, 5, "Execute Cell and Focus Container")),
|
|
320
317
|
args: cellExecutionArgs
|
|
321
318
|
},
|
|
322
319
|
icon: executeIcon
|
|
@@ -339,17 +336,16 @@ registerAction2(class ExecuteCellFocusContainer extends NotebookMultiCellAction
|
|
|
339
336
|
await runCell(editorGroupsService, context);
|
|
340
337
|
}
|
|
341
338
|
});
|
|
342
|
-
const cellCancelCondition = ( ContextKeyExpr.or(
|
|
339
|
+
const cellCancelCondition = ( (ContextKeyExpr.or(
|
|
340
|
+
(ContextKeyExpr.equals(NOTEBOOK_CELL_EXECUTION_STATE.key, 'executing')),
|
|
341
|
+
(ContextKeyExpr.equals(NOTEBOOK_CELL_EXECUTION_STATE.key, 'pending'))
|
|
342
|
+
)));
|
|
343
343
|
registerAction2(class CancelExecuteCell extends NotebookMultiCellAction {
|
|
344
344
|
constructor() {
|
|
345
345
|
super({
|
|
346
346
|
id: CANCEL_CELL_COMMAND_ID,
|
|
347
347
|
precondition: cellCancelCondition,
|
|
348
|
-
title: ( localizeWithPath(
|
|
349
|
-
'vs/workbench/contrib/notebook/browser/controller/executeActions',
|
|
350
|
-
'notebookActions.cancel',
|
|
351
|
-
"Stop Cell Execution"
|
|
352
|
-
)),
|
|
348
|
+
title: ( localizeWithPath(_moduleId, 6, "Stop Cell Execution")),
|
|
353
349
|
icon: stopIcon,
|
|
354
350
|
menu: {
|
|
355
351
|
id: MenuId.NotebookCellExecutePrimary,
|
|
@@ -357,11 +353,7 @@ registerAction2(class CancelExecuteCell extends NotebookMultiCellAction {
|
|
|
357
353
|
group: 'inline'
|
|
358
354
|
},
|
|
359
355
|
metadata: {
|
|
360
|
-
description: ( localizeWithPath(
|
|
361
|
-
'vs/workbench/contrib/notebook/browser/controller/executeActions',
|
|
362
|
-
'notebookActions.cancel',
|
|
363
|
-
"Stop Cell Execution"
|
|
364
|
-
)),
|
|
356
|
+
description: ( localizeWithPath(_moduleId, 6, "Stop Cell Execution")),
|
|
365
357
|
args: [
|
|
366
358
|
{
|
|
367
359
|
name: 'options',
|
|
@@ -415,14 +407,16 @@ registerAction2(class ExecuteCellSelectBelow extends NotebookCellAction {
|
|
|
415
407
|
constructor() {
|
|
416
408
|
super({
|
|
417
409
|
id: EXECUTE_CELL_SELECT_BELOW,
|
|
418
|
-
precondition: ( ContextKeyExpr.or(
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
)),
|
|
410
|
+
precondition: ( (ContextKeyExpr.or(
|
|
411
|
+
executeThisCellCondition,
|
|
412
|
+
(NOTEBOOK_CELL_TYPE.isEqualTo('markup'))
|
|
413
|
+
))),
|
|
414
|
+
title: ( localizeWithPath(_moduleId, 7, "Execute Notebook Cell and Select Below")),
|
|
424
415
|
keybinding: {
|
|
425
|
-
when: ( ContextKeyExpr.and(
|
|
416
|
+
when: ( (ContextKeyExpr.and(
|
|
417
|
+
NOTEBOOK_CELL_LIST_FOCUSED,
|
|
418
|
+
(CTX_INLINE_CHAT_FOCUSED.negate())
|
|
419
|
+
))),
|
|
426
420
|
primary: 1024 | 3 ,
|
|
427
421
|
weight: NOTEBOOK_EDITOR_WIDGET_ACTION_WEIGHT
|
|
428
422
|
},
|
|
@@ -479,12 +473,11 @@ registerAction2(class ExecuteCellInsertBelow extends NotebookCellAction {
|
|
|
479
473
|
constructor() {
|
|
480
474
|
super({
|
|
481
475
|
id: EXECUTE_CELL_INSERT_BELOW,
|
|
482
|
-
precondition: ( ContextKeyExpr.or(
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
)),
|
|
476
|
+
precondition: ( (ContextKeyExpr.or(
|
|
477
|
+
executeThisCellCondition,
|
|
478
|
+
(NOTEBOOK_CELL_TYPE.isEqualTo('markup'))
|
|
479
|
+
))),
|
|
480
|
+
title: ( localizeWithPath(_moduleId, 8, "Execute Notebook Cell and Insert Below")),
|
|
488
481
|
keybinding: {
|
|
489
482
|
when: NOTEBOOK_CELL_LIST_FOCUSED,
|
|
490
483
|
primary: 512 | 3 ,
|
|
@@ -521,24 +514,29 @@ registerAction2(class CancelAllNotebook extends CancelNotebook {
|
|
|
521
514
|
constructor() {
|
|
522
515
|
super({
|
|
523
516
|
id: CANCEL_NOTEBOOK_COMMAND_ID,
|
|
524
|
-
title: ( localize2WithPath(
|
|
525
|
-
'vs/workbench/contrib/notebook/browser/controller/executeActions',
|
|
526
|
-
'notebookActions.cancelNotebook',
|
|
527
|
-
"Stop Execution"
|
|
528
|
-
)),
|
|
517
|
+
title: ( localize2WithPath(_moduleId, 9, "Stop Execution")),
|
|
529
518
|
icon: stopIcon,
|
|
530
519
|
menu: [
|
|
531
520
|
{
|
|
532
521
|
id: MenuId.EditorTitle,
|
|
533
522
|
order: -1,
|
|
534
523
|
group: 'navigation',
|
|
535
|
-
when: ( ContextKeyExpr.and(
|
|
524
|
+
when: ( (ContextKeyExpr.and(
|
|
525
|
+
NOTEBOOK_IS_ACTIVE_EDITOR,
|
|
526
|
+
NOTEBOOK_HAS_SOMETHING_RUNNING,
|
|
527
|
+
(NOTEBOOK_INTERRUPTIBLE_KERNEL.toNegated()),
|
|
528
|
+
(ContextKeyExpr.notEquals('config.notebook.globalToolbar', true))
|
|
529
|
+
)))
|
|
536
530
|
},
|
|
537
531
|
{
|
|
538
532
|
id: MenuId.NotebookToolbar,
|
|
539
533
|
order: -1,
|
|
540
534
|
group: 'navigation/execute',
|
|
541
|
-
when: ( ContextKeyExpr.and(
|
|
535
|
+
when: ( (ContextKeyExpr.and(
|
|
536
|
+
NOTEBOOK_HAS_SOMETHING_RUNNING,
|
|
537
|
+
(NOTEBOOK_INTERRUPTIBLE_KERNEL.toNegated()),
|
|
538
|
+
(ContextKeyExpr.equals('config.notebook.globalToolbar', true))
|
|
539
|
+
)))
|
|
542
540
|
}
|
|
543
541
|
]
|
|
544
542
|
});
|
|
@@ -548,34 +546,30 @@ registerAction2(class InterruptNotebook extends CancelNotebook {
|
|
|
548
546
|
constructor() {
|
|
549
547
|
super({
|
|
550
548
|
id: INTERRUPT_NOTEBOOK_COMMAND_ID,
|
|
551
|
-
title: ( localize2WithPath(
|
|
552
|
-
|
|
553
|
-
'notebookActions.interruptNotebook',
|
|
554
|
-
"Interrupt"
|
|
555
|
-
)),
|
|
556
|
-
precondition: ( ContextKeyExpr.and(NOTEBOOK_HAS_SOMETHING_RUNNING, NOTEBOOK_INTERRUPTIBLE_KERNEL)),
|
|
549
|
+
title: ( localize2WithPath(_moduleId, 10, "Interrupt")),
|
|
550
|
+
precondition: ( (ContextKeyExpr.and(NOTEBOOK_HAS_SOMETHING_RUNNING, NOTEBOOK_INTERRUPTIBLE_KERNEL))),
|
|
557
551
|
icon: stopIcon,
|
|
558
552
|
menu: [
|
|
559
553
|
{
|
|
560
554
|
id: MenuId.EditorTitle,
|
|
561
555
|
order: -1,
|
|
562
556
|
group: 'navigation',
|
|
563
|
-
when: ( ContextKeyExpr.and(
|
|
557
|
+
when: ( (ContextKeyExpr.and(
|
|
564
558
|
NOTEBOOK_IS_ACTIVE_EDITOR,
|
|
565
559
|
NOTEBOOK_HAS_SOMETHING_RUNNING,
|
|
566
560
|
NOTEBOOK_INTERRUPTIBLE_KERNEL,
|
|
567
|
-
|
|
568
|
-
))
|
|
561
|
+
(ContextKeyExpr.notEquals('config.notebook.globalToolbar', true))
|
|
562
|
+
)))
|
|
569
563
|
},
|
|
570
564
|
{
|
|
571
565
|
id: MenuId.NotebookToolbar,
|
|
572
566
|
order: -1,
|
|
573
567
|
group: 'navigation/execute',
|
|
574
|
-
when: ( ContextKeyExpr.and(
|
|
568
|
+
when: ( (ContextKeyExpr.and(
|
|
575
569
|
NOTEBOOK_HAS_SOMETHING_RUNNING,
|
|
576
570
|
NOTEBOOK_INTERRUPTIBLE_KERNEL,
|
|
577
|
-
|
|
578
|
-
))
|
|
571
|
+
(ContextKeyExpr.equals('config.notebook.globalToolbar', true))
|
|
572
|
+
)))
|
|
579
573
|
},
|
|
580
574
|
{
|
|
581
575
|
id: MenuId.InteractiveToolbar,
|
|
@@ -586,11 +580,7 @@ registerAction2(class InterruptNotebook extends CancelNotebook {
|
|
|
586
580
|
}
|
|
587
581
|
});
|
|
588
582
|
MenuRegistry.appendMenuItem(MenuId.NotebookToolbar, {
|
|
589
|
-
title: ( localizeWithPath(
|
|
590
|
-
'vs/workbench/contrib/notebook/browser/controller/executeActions',
|
|
591
|
-
'revealRunningCellShort',
|
|
592
|
-
"Go To"
|
|
593
|
-
)),
|
|
583
|
+
title: ( localizeWithPath(_moduleId, 11, "Go To")),
|
|
594
584
|
submenu: MenuId.NotebookCellExecuteGoTo,
|
|
595
585
|
group: 'navigation/execute',
|
|
596
586
|
order: 20,
|
|
@@ -600,38 +590,37 @@ registerAction2(class RevealRunningCellAction extends NotebookAction {
|
|
|
600
590
|
constructor() {
|
|
601
591
|
super({
|
|
602
592
|
id: REVEAL_RUNNING_CELL,
|
|
603
|
-
title: ( localizeWithPath(
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
"Go to Running Cell"
|
|
607
|
-
)),
|
|
608
|
-
tooltip: ( localizeWithPath(
|
|
609
|
-
'vs/workbench/contrib/notebook/browser/controller/executeActions',
|
|
610
|
-
'revealRunningCell',
|
|
611
|
-
"Go to Running Cell"
|
|
612
|
-
)),
|
|
613
|
-
shortTitle: ( localizeWithPath(
|
|
614
|
-
'vs/workbench/contrib/notebook/browser/controller/executeActions',
|
|
615
|
-
'revealRunningCell',
|
|
616
|
-
"Go to Running Cell"
|
|
617
|
-
)),
|
|
593
|
+
title: ( localizeWithPath(_moduleId, 12, "Go to Running Cell")),
|
|
594
|
+
tooltip: ( localizeWithPath(_moduleId, 12, "Go to Running Cell")),
|
|
595
|
+
shortTitle: ( localizeWithPath(_moduleId, 12, "Go to Running Cell")),
|
|
618
596
|
precondition: NOTEBOOK_HAS_RUNNING_CELL,
|
|
619
597
|
menu: [
|
|
620
598
|
{
|
|
621
599
|
id: MenuId.EditorTitle,
|
|
622
|
-
when: ( ContextKeyExpr.and(
|
|
600
|
+
when: ( (ContextKeyExpr.and(
|
|
601
|
+
NOTEBOOK_IS_ACTIVE_EDITOR,
|
|
602
|
+
NOTEBOOK_HAS_RUNNING_CELL,
|
|
603
|
+
(ContextKeyExpr.notEquals('config.notebook.globalToolbar', true))
|
|
604
|
+
))),
|
|
623
605
|
group: 'navigation',
|
|
624
606
|
order: 0
|
|
625
607
|
},
|
|
626
608
|
{
|
|
627
609
|
id: MenuId.NotebookCellExecuteGoTo,
|
|
628
|
-
when: ( ContextKeyExpr.and(
|
|
610
|
+
when: ( (ContextKeyExpr.and(
|
|
611
|
+
NOTEBOOK_IS_ACTIVE_EDITOR,
|
|
612
|
+
NOTEBOOK_HAS_RUNNING_CELL,
|
|
613
|
+
(ContextKeyExpr.equals('config.notebook.globalToolbar', true))
|
|
614
|
+
))),
|
|
629
615
|
group: 'navigation/execute',
|
|
630
616
|
order: 20
|
|
631
617
|
},
|
|
632
618
|
{
|
|
633
619
|
id: MenuId.InteractiveToolbar,
|
|
634
|
-
when: ( ContextKeyExpr.and(
|
|
620
|
+
when: ( (ContextKeyExpr.and(
|
|
621
|
+
NOTEBOOK_HAS_RUNNING_CELL,
|
|
622
|
+
(ContextKeyExpr.equals('activeEditor', 'workbench.editor.interactive'))
|
|
623
|
+
))),
|
|
635
624
|
group: 'navigation',
|
|
636
625
|
order: 10
|
|
637
626
|
}
|
|
@@ -659,7 +648,7 @@ registerAction2(class RevealRunningCellAction extends NotebookAction {
|
|
|
659
648
|
const sf = thread.getTopStackFrame();
|
|
660
649
|
if (sf) {
|
|
661
650
|
const parsed = CellUri.parse(sf.source.uri);
|
|
662
|
-
if (parsed && ( parsed.notebook.toString()) === ( notebook.toString())) {
|
|
651
|
+
if (parsed && ( (parsed.notebook.toString())) === ( (notebook.toString()))) {
|
|
663
652
|
return parsed.handle;
|
|
664
653
|
}
|
|
665
654
|
}
|
|
@@ -672,32 +661,30 @@ registerAction2(class RevealLastFailedCellAction extends NotebookAction {
|
|
|
672
661
|
constructor() {
|
|
673
662
|
super({
|
|
674
663
|
id: REVEAL_LAST_FAILED_CELL,
|
|
675
|
-
title: ( localizeWithPath(
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
"Go to Most Recently Failed Cell"
|
|
679
|
-
)),
|
|
680
|
-
tooltip: ( localizeWithPath(
|
|
681
|
-
'vs/workbench/contrib/notebook/browser/controller/executeActions',
|
|
682
|
-
'revealLastFailedCell',
|
|
683
|
-
"Go to Most Recently Failed Cell"
|
|
684
|
-
)),
|
|
685
|
-
shortTitle: ( localizeWithPath(
|
|
686
|
-
'vs/workbench/contrib/notebook/browser/controller/executeActions',
|
|
687
|
-
'revealLastFailedCellShort',
|
|
688
|
-
"Go to Most Recently Failed Cell"
|
|
689
|
-
)),
|
|
664
|
+
title: ( localizeWithPath(_moduleId, 13, "Go to Most Recently Failed Cell")),
|
|
665
|
+
tooltip: ( localizeWithPath(_moduleId, 13, "Go to Most Recently Failed Cell")),
|
|
666
|
+
shortTitle: ( localizeWithPath(_moduleId, 14, "Go to Most Recently Failed Cell")),
|
|
690
667
|
precondition: NOTEBOOK_LAST_CELL_FAILED,
|
|
691
668
|
menu: [
|
|
692
669
|
{
|
|
693
670
|
id: MenuId.EditorTitle,
|
|
694
|
-
when: ( ContextKeyExpr.and(
|
|
671
|
+
when: ( (ContextKeyExpr.and(
|
|
672
|
+
NOTEBOOK_IS_ACTIVE_EDITOR,
|
|
673
|
+
NOTEBOOK_LAST_CELL_FAILED,
|
|
674
|
+
(NOTEBOOK_HAS_RUNNING_CELL.toNegated()),
|
|
675
|
+
(ContextKeyExpr.notEquals('config.notebook.globalToolbar', true))
|
|
676
|
+
))),
|
|
695
677
|
group: 'navigation',
|
|
696
678
|
order: 0
|
|
697
679
|
},
|
|
698
680
|
{
|
|
699
681
|
id: MenuId.NotebookCellExecuteGoTo,
|
|
700
|
-
when: ( ContextKeyExpr.and(
|
|
682
|
+
when: ( (ContextKeyExpr.and(
|
|
683
|
+
NOTEBOOK_IS_ACTIVE_EDITOR,
|
|
684
|
+
NOTEBOOK_LAST_CELL_FAILED,
|
|
685
|
+
(NOTEBOOK_HAS_RUNNING_CELL.toNegated()),
|
|
686
|
+
(ContextKeyExpr.equals('config.notebook.globalToolbar', true))
|
|
687
|
+
))),
|
|
701
688
|
group: 'navigation/execute',
|
|
702
689
|
order: 20
|
|
703
690
|
},
|