@codingame/monaco-vscode-notebook-service-override 25.1.2 → 26.0.1
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/index.js +2 -2
- package/package.json +3 -3
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/emptyTextEditorHint/emptyTextEditorHint.js +112 -94
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellCommands/cellCommands.js +95 -96
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellDiagnostics/cellDiagnosticEditorContrib.js +28 -19
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellDiagnostics/cellDiagnosticsActions.js +15 -9
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellDiagnostics/diagnosticCellStatusBarContrib.js +22 -17
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/contributedStatusBarItemController.js +25 -10
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/statusBarProviders.js +37 -44
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/clipboard/notebookClipboard.js +211 -115
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/debug/notebookBreakpoints.js +16 -18
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/debug/notebookCellPausing.js +5 -8
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/debug/notebookDebugDecorations.js +57 -49
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/editorHint/emptyCellEditorHint.js +24 -11
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/editorStatusBar/editorStatusBar.js +78 -76
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/execute/executionEditorProgress.js +14 -15
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFind.js +43 -28
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/format/formatting.js +65 -34
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/gettingStarted/notebookGettingStarted.js +19 -16
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/kernelDetection/notebookKernelDetection.js +6 -10
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/layout/layoutActions.js +15 -17
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/marker/markerProvider.js +28 -16
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/multicursor/notebookMulticursor.js +211 -170
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/multicursor/notebookSelectionHighlight.js +11 -11
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/navigation/arrow.js +158 -156
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookInlineVariables.js +109 -105
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariableContextKeys.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariables.js +28 -22
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesDataSource.js +26 -17
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesTree.js +23 -16
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesView.js +72 -40
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/outline/notebookOutline.js +233 -186
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/profile/notebookProfile.js +22 -18
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/saveParticipants/saveParticipants.js +239 -151
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/troubleshoot/layout.js +85 -86
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/undoRedo/notebookUndoRedo.js +25 -11
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/viewportWarmup/viewportWarmup.js +13 -10
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/apiActions.js +8 -5
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/editActions.js +218 -196
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/executeActions.js +258 -255
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/layoutActions.js +106 -98
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/notebookIndentationActions.js +63 -49
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/sectionActions.js +55 -64
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/variablesActions.js +21 -25
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffActions.js +149 -129
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookMultiDiffEditor.d.ts +57 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookMultiDiffEditor.js +286 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookMultiDiffEditorInput.d.ts +22 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookMultiDiffEditorInput.js +82 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebook.contribution.js +452 -363
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookAccessibilityHelp.js +44 -61
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookAccessibleView.js +9 -11
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookExtensionPoint.js +203 -207
- package/vscode/src/vs/workbench/contrib/notebook/browser/outputEditor/notebookOutputEditor.js +148 -104
- package/vscode/src/vs/workbench/contrib/notebook/browser/outputEditor/notebookOutputEditorInput.js +19 -11
- package/vscode/src/vs/workbench/contrib/notebook/browser/replEditorAccessibleView.js +9 -11
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookCellStatusBarServiceImpl.js +9 -6
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookEditorServiceImpl.js +34 -22
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookExecutionServiceImpl.js +29 -18
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookExecutionStateServiceImpl.js +70 -52
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKernelHistoryServiceImpl.js +31 -19
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKernelServiceImpl.js +78 -41
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKeymapServiceImpl.js +37 -27
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookLoggingServiceImpl.js +9 -6
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookRendererMessagingServiceImpl.js +8 -7
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookServiceImpl.js +214 -119
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookWorkerServiceImpl.js +38 -36
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookOutlineDataSource.js +24 -25
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookOutlineDataSourceFactory.js +2 -6
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookOutlineEntryFactory.js +26 -15
- package/vscode/src/vs/workbench/contrib/notebook/common/model/cellEdit.js +35 -15
- package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookTextModel.js +468 -258
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookDiffEditorInput.d.ts +33 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookDiffEditorInput.js +113 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorModelResolverServiceImpl.js +74 -58
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookOutputRenderer.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookOutputRenderer.js +7 -10
- package/vscode/src/vs/workbench/contrib/notebook/common/services/notebookCellMatching.js +72 -16
- package/vscode/src/vs/workbench/contrib/notebook/common/services/notebookWebWorker.js +70 -51
- package/vscode/src/vs/workbench/contrib/replNotebook/browser/repl.contribution.js +195 -149
- package/vscode/src/vs/workbench/contrib/replNotebook/browser/replEditorAccessibilityHelp.js +60 -81
- package/vscode/src/vs/workbench/services/workingCopy/common/abstractFileWorkingCopyManager.js +7 -12
- package/vscode/src/vs/workbench/services/workingCopy/common/fileWorkingCopyManager.js +104 -66
- package/vscode/src/vs/workbench/services/workingCopy/common/storedFileWorkingCopyManager.js +115 -77
- package/vscode/src/vs/workbench/services/workingCopy/common/untitledFileWorkingCopy.js +42 -26
- package/vscode/src/vs/workbench/services/workingCopy/common/untitledFileWorkingCopyManager.js +19 -12
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions.d.ts +0 -7
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions.js +0 -198
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebook.chat.contribution.d.ts +0 -8
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebook.chat.contribution.js +0 -333
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebookChatContext.d.ts +0 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebookChatContext.js +0 -7
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/insertCellActions.d.ts +0 -13
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/insertCellActions.js +0 -261
|
@@ -10,7 +10,7 @@ import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/pl
|
|
|
10
10
|
import { ContextKeyExpr } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey';
|
|
11
11
|
import { IDebugService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/debug/common/debug.service';
|
|
12
12
|
import { CTX_INLINE_CHAT_FOCUSED } from '@codingame/monaco-vscode-katex-common/vscode/vs/workbench/contrib/inlineChat/common/inlineChat';
|
|
13
|
-
import { insertCell } from '@codingame/monaco-vscode-
|
|
13
|
+
import { insertCell } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/browser/controller/cellOperations';
|
|
14
14
|
import { NotebookAction, getContextFromUri, getContextFromActiveEditor, NotebookMultiCellAction, cellExecutionArgs, NOTEBOOK_EDITOR_WIDGET_ACTION_WEIGHT, parseMultiCellExecutionArgs, CELL_TITLE_CELL_GROUP_ID, CellToolbarOrder, NotebookCellAction } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/browser/controller/coreActions';
|
|
15
15
|
import { CellEditState, EXECUTE_CELL_COMMAND_ID, ScrollToRevealBehavior, CellFocusMode } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/browser/notebookBrowser';
|
|
16
16
|
import { executeAllIcon, executeIcon, executeAboveIcon, executeBelowIcon, stopIcon, executingStateIcon, errorStateIcon } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/browser/notebookIcons';
|
|
@@ -22,30 +22,30 @@ import { IEditorGroupsService } from '@codingame/monaco-vscode-api/vscode/vs/wor
|
|
|
22
22
|
import { IEditorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service';
|
|
23
23
|
import { CodeCellViewModel } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/browser/viewModel/codeCellViewModel';
|
|
24
24
|
|
|
25
|
-
const EXECUTE_NOTEBOOK_COMMAND_ID =
|
|
26
|
-
const CANCEL_NOTEBOOK_COMMAND_ID =
|
|
27
|
-
const INTERRUPT_NOTEBOOK_COMMAND_ID =
|
|
28
|
-
const CANCEL_CELL_COMMAND_ID =
|
|
29
|
-
const EXECUTE_CELL_FOCUS_CONTAINER_COMMAND_ID =
|
|
30
|
-
const EXECUTE_CELL_SELECT_BELOW =
|
|
31
|
-
const EXECUTE_CELL_INSERT_BELOW =
|
|
32
|
-
const EXECUTE_CELL_AND_BELOW =
|
|
33
|
-
const EXECUTE_CELLS_ABOVE =
|
|
34
|
-
const RENDER_ALL_MARKDOWN_CELLS =
|
|
35
|
-
const REVEAL_RUNNING_CELL =
|
|
36
|
-
const REVEAL_LAST_FAILED_CELL =
|
|
37
|
-
const executeCondition = ( ContextKeyExpr.and(( NOTEBOOK_CELL_TYPE.isEqualTo(
|
|
25
|
+
const EXECUTE_NOTEBOOK_COMMAND_ID = "notebook.execute";
|
|
26
|
+
const CANCEL_NOTEBOOK_COMMAND_ID = "notebook.cancelExecution";
|
|
27
|
+
const INTERRUPT_NOTEBOOK_COMMAND_ID = "notebook.interruptExecution";
|
|
28
|
+
const CANCEL_CELL_COMMAND_ID = "notebook.cell.cancelExecution";
|
|
29
|
+
const EXECUTE_CELL_FOCUS_CONTAINER_COMMAND_ID = "notebook.cell.executeAndFocusContainer";
|
|
30
|
+
const EXECUTE_CELL_SELECT_BELOW = "notebook.cell.executeAndSelectBelow";
|
|
31
|
+
const EXECUTE_CELL_INSERT_BELOW = "notebook.cell.executeAndInsertBelow";
|
|
32
|
+
const EXECUTE_CELL_AND_BELOW = "notebook.cell.executeCellAndBelow";
|
|
33
|
+
const EXECUTE_CELLS_ABOVE = "notebook.cell.executeCellsAbove";
|
|
34
|
+
const RENDER_ALL_MARKDOWN_CELLS = "notebook.renderAllMarkdownCells";
|
|
35
|
+
const REVEAL_RUNNING_CELL = "notebook.revealRunningCell";
|
|
36
|
+
const REVEAL_LAST_FAILED_CELL = "notebook.revealLastFailedCell";
|
|
37
|
+
const executeCondition = ( ContextKeyExpr.and(( NOTEBOOK_CELL_TYPE.isEqualTo("code")), ( ContextKeyExpr.or(
|
|
38
38
|
ContextKeyExpr.greater(NOTEBOOK_KERNEL_COUNT.key, 0),
|
|
39
39
|
ContextKeyExpr.greater(NOTEBOOK_KERNEL_SOURCE_COUNT.key, 0),
|
|
40
40
|
NOTEBOOK_MISSING_KERNEL_EXTENSION
|
|
41
41
|
))));
|
|
42
42
|
const executeThisCellCondition = ( ContextKeyExpr.and(executeCondition, ( NOTEBOOK_CELL_EXECUTING.toNegated())));
|
|
43
|
-
const executeSectionCondition = ( ContextKeyExpr.and(( NOTEBOOK_CELL_TYPE.isEqualTo(
|
|
43
|
+
const executeSectionCondition = ( ContextKeyExpr.and(( NOTEBOOK_CELL_TYPE.isEqualTo("markup"))));
|
|
44
44
|
function renderAllMarkdownCells(context) {
|
|
45
45
|
for (let i = 0; i < context.notebookEditor.getLength(); i++) {
|
|
46
46
|
const cell = context.notebookEditor.cellAt(i);
|
|
47
47
|
if (cell.cellKind === CellKind.Markup) {
|
|
48
|
-
cell.updateEditState(CellEditState.Preview,
|
|
48
|
+
cell.updateEditState(CellEditState.Preview, "renderAllMarkdownCells");
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
}
|
|
@@ -57,15 +57,19 @@ async function runCell(editorGroupsService, context, editorService) {
|
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
if (context.autoReveal && (context.cell || context.selectedCells?.length) && editorService) {
|
|
60
|
-
editorService.openEditor({
|
|
60
|
+
editorService.openEditor({
|
|
61
|
+
resource: context.notebookEditor.textModel.uri,
|
|
62
|
+
options: {
|
|
63
|
+
revealIfOpened: true
|
|
64
|
+
}
|
|
65
|
+
});
|
|
61
66
|
}
|
|
62
67
|
if (context.ui && context.cell) {
|
|
63
68
|
if (context.autoReveal) {
|
|
64
69
|
handleAutoReveal(context.cell, context.notebookEditor);
|
|
65
70
|
}
|
|
66
71
|
await context.notebookEditor.executeNotebookCells(Iterable.single(context.cell));
|
|
67
|
-
}
|
|
68
|
-
else if (context.selectedCells?.length || context.cell) {
|
|
72
|
+
} else if (context.selectedCells?.length || context.cell) {
|
|
69
73
|
const selectedCells = context.selectedCells?.length ? context.selectedCells : [context.cell];
|
|
70
74
|
const firstCell = selectedCells[0];
|
|
71
75
|
if (firstCell && context.autoReveal) {
|
|
@@ -75,7 +79,10 @@ async function runCell(editorGroupsService, context, editorService) {
|
|
|
75
79
|
}
|
|
76
80
|
let foundEditor = undefined;
|
|
77
81
|
for (const [, codeEditor] of context.notebookEditor.codeEditors) {
|
|
78
|
-
if (isEqual(
|
|
82
|
+
if (isEqual(
|
|
83
|
+
codeEditor.getModel()?.uri,
|
|
84
|
+
(context.cell ?? context.selectedCells?.[0])?.uri
|
|
85
|
+
)) {
|
|
79
86
|
foundEditor = codeEditor;
|
|
80
87
|
break;
|
|
81
88
|
}
|
|
@@ -87,10 +94,15 @@ async function runCell(editorGroupsService, context, editorService) {
|
|
|
87
94
|
const SMART_VIEWPORT_TOP_REVEAL_PADDING = 20;
|
|
88
95
|
const SMART_VIEWPORT_BOTTOM_REVEAL_PADDING = 60;
|
|
89
96
|
function handleAutoReveal(cell, notebookEditor) {
|
|
90
|
-
notebookEditor.focusNotebookCell(cell,
|
|
97
|
+
notebookEditor.focusNotebookCell(cell, "container", {
|
|
98
|
+
skipReveal: true
|
|
99
|
+
});
|
|
91
100
|
if (cell.cellKind === CellKind.Markup) {
|
|
92
101
|
const cellIndex = notebookEditor.getCellIndex(cell);
|
|
93
|
-
notebookEditor.revealCellRangeInView({
|
|
102
|
+
notebookEditor.revealCellRangeInView({
|
|
103
|
+
start: cellIndex,
|
|
104
|
+
end: cellIndex + 1
|
|
105
|
+
});
|
|
94
106
|
return;
|
|
95
107
|
}
|
|
96
108
|
if (!(cell instanceof CodeCellViewModel)) {
|
|
@@ -105,11 +117,16 @@ function handleAutoReveal(cell, notebookEditor) {
|
|
|
105
117
|
const viewportHeight66 = viewportHeight * 0.66;
|
|
106
118
|
const totalHeight = cell.layoutInfo.totalHeight;
|
|
107
119
|
const isFullyVisible = cellEditorScrollTop >= notebookEditor.scrollTop && cellOutputScrollBottom <= notebookEditor.scrollBottom;
|
|
108
|
-
const isEditorBottomVisible = ((
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
const
|
|
120
|
+
const isEditorBottomVisible = ((cellEditorScrollBottom - 25) >= notebookEditor.scrollTop) && ((cellEditorScrollBottom + 25) <= notebookEditor.scrollBottom);
|
|
121
|
+
const revealWithTopPadding = position => {
|
|
122
|
+
notebookEditor.setScrollTop(position - SMART_VIEWPORT_TOP_REVEAL_PADDING);
|
|
123
|
+
};
|
|
124
|
+
const revealWithNoPadding = position => {
|
|
125
|
+
notebookEditor.setScrollTop(position);
|
|
126
|
+
};
|
|
127
|
+
const revealWithBottomPadding = position => {
|
|
128
|
+
notebookEditor.setScrollTop(position + SMART_VIEWPORT_BOTTOM_REVEAL_PADDING);
|
|
129
|
+
};
|
|
113
130
|
if (isFullyVisible) {
|
|
114
131
|
return;
|
|
115
132
|
}
|
|
@@ -120,11 +137,9 @@ function handleAutoReveal(cell, notebookEditor) {
|
|
|
120
137
|
if (totalHeight > viewportHeight && !isEditorBottomVisible) {
|
|
121
138
|
if (cellOutputHeight > 0 && cellOutputHeight >= viewportHeight66) {
|
|
122
139
|
revealWithNoPadding(cellEditorScrollBottom - viewportHeight34);
|
|
123
|
-
}
|
|
124
|
-
else if (cellOutputHeight > 0) {
|
|
140
|
+
} else if (cellOutputHeight > 0) {
|
|
125
141
|
revealWithBottomPadding(cellOutputScrollBottom - viewportHeight);
|
|
126
|
-
}
|
|
127
|
-
else {
|
|
142
|
+
} else {
|
|
128
143
|
revealWithNoPadding(cellEditorScrollBottom - viewportHeight66);
|
|
129
144
|
}
|
|
130
145
|
}
|
|
@@ -133,7 +148,7 @@ registerAction2(class RenderAllMarkdownCellsAction extends NotebookAction {
|
|
|
133
148
|
constructor() {
|
|
134
149
|
super({
|
|
135
150
|
id: RENDER_ALL_MARKDOWN_CELLS,
|
|
136
|
-
title: ( localize(
|
|
151
|
+
title: ( localize(9718, "Render All Markdown Cells"))
|
|
137
152
|
});
|
|
138
153
|
}
|
|
139
154
|
async runWithContext(accessor, context) {
|
|
@@ -144,31 +159,26 @@ registerAction2(class ExecuteNotebookAction extends NotebookAction {
|
|
|
144
159
|
constructor() {
|
|
145
160
|
super({
|
|
146
161
|
id: EXECUTE_NOTEBOOK_COMMAND_ID,
|
|
147
|
-
title: ( localize(
|
|
162
|
+
title: ( localize(9719, "Run All")),
|
|
148
163
|
icon: executeAllIcon,
|
|
149
164
|
metadata: {
|
|
150
|
-
description: ( localize(
|
|
151
|
-
args: [
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
}
|
|
156
|
-
]
|
|
165
|
+
description: ( localize(9719, "Run All")),
|
|
166
|
+
args: [{
|
|
167
|
+
name: "uri",
|
|
168
|
+
description: "The document uri"
|
|
169
|
+
}]
|
|
157
170
|
},
|
|
158
|
-
menu: [
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
when: ( ContextKeyExpr.and(( ContextKeyExpr.or(( NOTEBOOK_INTERRUPTIBLE_KERNEL.toNegated()), ( NOTEBOOK_HAS_SOMETHING_RUNNING.toNegated()))), ( ContextKeyExpr.and(NOTEBOOK_HAS_SOMETHING_RUNNING, ( NOTEBOOK_INTERRUPTIBLE_KERNEL.toNegated())))?.negate(), ( ContextKeyExpr.equals('config.notebook.globalToolbar', true))))
|
|
170
|
-
}
|
|
171
|
-
]
|
|
171
|
+
menu: [{
|
|
172
|
+
id: MenuId.EditorTitle,
|
|
173
|
+
order: -1,
|
|
174
|
+
group: "navigation",
|
|
175
|
+
when: ( ContextKeyExpr.and(NOTEBOOK_IS_ACTIVE_EDITOR, ( ContextKeyExpr.or(( NOTEBOOK_INTERRUPTIBLE_KERNEL.toNegated()), ( NOTEBOOK_HAS_SOMETHING_RUNNING.toNegated()))), ( ContextKeyExpr.notEquals("config.notebook.globalToolbar", true))))
|
|
176
|
+
}, {
|
|
177
|
+
id: MenuId.NotebookToolbar,
|
|
178
|
+
order: -1,
|
|
179
|
+
group: "navigation/execute",
|
|
180
|
+
when: ( ContextKeyExpr.and(( ContextKeyExpr.or(( NOTEBOOK_INTERRUPTIBLE_KERNEL.toNegated()), ( NOTEBOOK_HAS_SOMETHING_RUNNING.toNegated()))), ( ContextKeyExpr.and(NOTEBOOK_HAS_SOMETHING_RUNNING, ( NOTEBOOK_INTERRUPTIBLE_KERNEL.toNegated())))?.negate(), ( ContextKeyExpr.equals("config.notebook.globalToolbar", true))))
|
|
181
|
+
}]
|
|
172
182
|
});
|
|
173
183
|
}
|
|
174
184
|
getEditorContextFromArgsOrActive(accessor, context) {
|
|
@@ -195,7 +205,7 @@ registerAction2(class ExecuteCell extends NotebookMultiCellAction {
|
|
|
195
205
|
super({
|
|
196
206
|
id: EXECUTE_CELL_COMMAND_ID,
|
|
197
207
|
precondition: executeThisCellCondition,
|
|
198
|
-
title: ( localize(
|
|
208
|
+
title: ( localize(9720, "Execute Cell")),
|
|
199
209
|
keybinding: {
|
|
200
210
|
when: NOTEBOOK_CELL_LIST_FOCUSED,
|
|
201
211
|
primary: KeyMod.WinCtrl | KeyCode.Enter,
|
|
@@ -207,10 +217,10 @@ registerAction2(class ExecuteCell extends NotebookMultiCellAction {
|
|
|
207
217
|
menu: {
|
|
208
218
|
id: MenuId.NotebookCellExecutePrimary,
|
|
209
219
|
when: executeThisCellCondition,
|
|
210
|
-
group:
|
|
220
|
+
group: "inline"
|
|
211
221
|
},
|
|
212
222
|
metadata: {
|
|
213
|
-
description: ( localize(
|
|
223
|
+
description: ( localize(9720, "Execute Cell")),
|
|
214
224
|
args: cellExecutionArgs
|
|
215
225
|
},
|
|
216
226
|
icon: executeIcon
|
|
@@ -223,7 +233,9 @@ registerAction2(class ExecuteCell extends NotebookMultiCellAction {
|
|
|
223
233
|
const editorGroupsService = accessor.get(IEditorGroupsService);
|
|
224
234
|
const editorService = accessor.get(IEditorService);
|
|
225
235
|
if (context.ui) {
|
|
226
|
-
await context.notebookEditor.focusNotebookCell(context.cell,
|
|
236
|
+
await context.notebookEditor.focusNotebookCell(context.cell, "container", {
|
|
237
|
+
skipReveal: true
|
|
238
|
+
});
|
|
227
239
|
}
|
|
228
240
|
await runCell(editorGroupsService, context, editorService);
|
|
229
241
|
}
|
|
@@ -233,19 +245,16 @@ registerAction2(class ExecuteAboveCells extends NotebookMultiCellAction {
|
|
|
233
245
|
super({
|
|
234
246
|
id: EXECUTE_CELLS_ABOVE,
|
|
235
247
|
precondition: executeCondition,
|
|
236
|
-
title: ( localize(
|
|
237
|
-
menu: [
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
when: ( ContextKeyExpr.and(executeCondition, ( ContextKeyExpr.equals(`config.${NotebookSetting.consolidatedRunButton}`, false))))
|
|
247
|
-
}
|
|
248
|
-
],
|
|
248
|
+
title: ( localize(9721, "Execute Above Cells")),
|
|
249
|
+
menu: [{
|
|
250
|
+
id: MenuId.NotebookCellExecute,
|
|
251
|
+
when: ( ContextKeyExpr.and(executeCondition, ( ContextKeyExpr.equals(`config.${NotebookSetting.consolidatedRunButton}`, true))))
|
|
252
|
+
}, {
|
|
253
|
+
id: MenuId.NotebookCellTitle,
|
|
254
|
+
order: CellToolbarOrder.ExecuteAboveCells,
|
|
255
|
+
group: CELL_TITLE_CELL_GROUP_ID,
|
|
256
|
+
when: ( ContextKeyExpr.and(executeCondition, ( ContextKeyExpr.equals(`config.${NotebookSetting.consolidatedRunButton}`, false))))
|
|
257
|
+
}],
|
|
249
258
|
icon: executeAboveIcon
|
|
250
259
|
});
|
|
251
260
|
}
|
|
@@ -256,13 +265,17 @@ registerAction2(class ExecuteAboveCells extends NotebookMultiCellAction {
|
|
|
256
265
|
let endCellIdx = undefined;
|
|
257
266
|
if (context.ui) {
|
|
258
267
|
endCellIdx = context.notebookEditor.getCellIndex(context.cell);
|
|
259
|
-
await context.notebookEditor.focusNotebookCell(context.cell,
|
|
260
|
-
|
|
261
|
-
|
|
268
|
+
await context.notebookEditor.focusNotebookCell(context.cell, "container", {
|
|
269
|
+
skipReveal: true
|
|
270
|
+
});
|
|
271
|
+
} else {
|
|
262
272
|
endCellIdx = Math.min(...( context.selectedCells.map(cell => context.notebookEditor.getCellIndex(cell))));
|
|
263
273
|
}
|
|
264
|
-
if (typeof endCellIdx ===
|
|
265
|
-
const range = {
|
|
274
|
+
if (typeof endCellIdx === "number") {
|
|
275
|
+
const range = {
|
|
276
|
+
start: 0,
|
|
277
|
+
end: endCellIdx
|
|
278
|
+
};
|
|
266
279
|
const cells = context.notebookEditor.getCellsInRange(range);
|
|
267
280
|
context.notebookEditor.executeNotebookCells(cells);
|
|
268
281
|
}
|
|
@@ -273,19 +286,16 @@ registerAction2(class ExecuteCellAndBelow extends NotebookMultiCellAction {
|
|
|
273
286
|
super({
|
|
274
287
|
id: EXECUTE_CELL_AND_BELOW,
|
|
275
288
|
precondition: executeCondition,
|
|
276
|
-
title: ( localize(
|
|
277
|
-
menu: [
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
when: ( ContextKeyExpr.and(executeCondition, ( ContextKeyExpr.equals(`config.${NotebookSetting.consolidatedRunButton}`, false))))
|
|
287
|
-
}
|
|
288
|
-
],
|
|
289
|
+
title: ( localize(9722, "Execute Cell and Below")),
|
|
290
|
+
menu: [{
|
|
291
|
+
id: MenuId.NotebookCellExecute,
|
|
292
|
+
when: ( ContextKeyExpr.and(executeCondition, ( ContextKeyExpr.equals(`config.${NotebookSetting.consolidatedRunButton}`, true))))
|
|
293
|
+
}, {
|
|
294
|
+
id: MenuId.NotebookCellTitle,
|
|
295
|
+
order: CellToolbarOrder.ExecuteCellAndBelow,
|
|
296
|
+
group: CELL_TITLE_CELL_GROUP_ID,
|
|
297
|
+
when: ( ContextKeyExpr.and(executeCondition, ( ContextKeyExpr.equals(`config.${NotebookSetting.consolidatedRunButton}`, false))))
|
|
298
|
+
}],
|
|
289
299
|
icon: executeBelowIcon
|
|
290
300
|
});
|
|
291
301
|
}
|
|
@@ -296,13 +306,17 @@ registerAction2(class ExecuteCellAndBelow extends NotebookMultiCellAction {
|
|
|
296
306
|
let startCellIdx = undefined;
|
|
297
307
|
if (context.ui) {
|
|
298
308
|
startCellIdx = context.notebookEditor.getCellIndex(context.cell);
|
|
299
|
-
await context.notebookEditor.focusNotebookCell(context.cell,
|
|
300
|
-
|
|
301
|
-
|
|
309
|
+
await context.notebookEditor.focusNotebookCell(context.cell, "container", {
|
|
310
|
+
skipReveal: true
|
|
311
|
+
});
|
|
312
|
+
} else {
|
|
302
313
|
startCellIdx = Math.min(...( context.selectedCells.map(cell => context.notebookEditor.getCellIndex(cell))));
|
|
303
314
|
}
|
|
304
|
-
if (typeof startCellIdx ===
|
|
305
|
-
const range = {
|
|
315
|
+
if (typeof startCellIdx === "number") {
|
|
316
|
+
const range = {
|
|
317
|
+
start: startCellIdx,
|
|
318
|
+
end: context.notebookEditor.getLength()
|
|
319
|
+
};
|
|
306
320
|
const cells = context.notebookEditor.getCellsInRange(range);
|
|
307
321
|
context.notebookEditor.executeNotebookCells(cells);
|
|
308
322
|
}
|
|
@@ -313,9 +327,9 @@ registerAction2(class ExecuteCellFocusContainer extends NotebookMultiCellAction
|
|
|
313
327
|
super({
|
|
314
328
|
id: EXECUTE_CELL_FOCUS_CONTAINER_COMMAND_ID,
|
|
315
329
|
precondition: executeThisCellCondition,
|
|
316
|
-
title: ( localize(
|
|
330
|
+
title: ( localize(9723, "Execute Cell and Focus Container")),
|
|
317
331
|
metadata: {
|
|
318
|
-
description: ( localize(
|
|
332
|
+
description: ( localize(9723, "Execute Cell and Focus Container")),
|
|
319
333
|
args: cellExecutionArgs
|
|
320
334
|
},
|
|
321
335
|
icon: executeIcon
|
|
@@ -328,66 +342,65 @@ registerAction2(class ExecuteCellFocusContainer extends NotebookMultiCellAction
|
|
|
328
342
|
const editorGroupsService = accessor.get(IEditorGroupsService);
|
|
329
343
|
const editorService = accessor.get(IEditorService);
|
|
330
344
|
if (context.ui) {
|
|
331
|
-
await context.notebookEditor.focusNotebookCell(context.cell,
|
|
332
|
-
|
|
333
|
-
|
|
345
|
+
await context.notebookEditor.focusNotebookCell(context.cell, "container", {
|
|
346
|
+
skipReveal: true
|
|
347
|
+
});
|
|
348
|
+
} else {
|
|
334
349
|
const firstCell = context.selectedCells[0];
|
|
335
350
|
if (firstCell) {
|
|
336
|
-
await context.notebookEditor.focusNotebookCell(firstCell,
|
|
351
|
+
await context.notebookEditor.focusNotebookCell(firstCell, "container", {
|
|
352
|
+
skipReveal: true
|
|
353
|
+
});
|
|
337
354
|
}
|
|
338
355
|
}
|
|
339
356
|
await runCell(editorGroupsService, context, editorService);
|
|
340
357
|
}
|
|
341
358
|
});
|
|
342
|
-
const cellCancelCondition = ( ContextKeyExpr.or(( ContextKeyExpr.equals(NOTEBOOK_CELL_EXECUTION_STATE.key,
|
|
359
|
+
const cellCancelCondition = ( ContextKeyExpr.or(( ContextKeyExpr.equals(NOTEBOOK_CELL_EXECUTION_STATE.key, "executing")), ( ContextKeyExpr.equals(NOTEBOOK_CELL_EXECUTION_STATE.key, "pending"))));
|
|
343
360
|
registerAction2(class CancelExecuteCell extends NotebookMultiCellAction {
|
|
344
361
|
constructor() {
|
|
345
362
|
super({
|
|
346
363
|
id: CANCEL_CELL_COMMAND_ID,
|
|
347
364
|
precondition: cellCancelCondition,
|
|
348
|
-
title: ( localize(
|
|
365
|
+
title: ( localize(9724, "Stop Cell Execution")),
|
|
349
366
|
icon: stopIcon,
|
|
350
367
|
menu: {
|
|
351
368
|
id: MenuId.NotebookCellExecutePrimary,
|
|
352
369
|
when: cellCancelCondition,
|
|
353
|
-
group:
|
|
370
|
+
group: "inline"
|
|
354
371
|
},
|
|
355
372
|
metadata: {
|
|
356
|
-
description: ( localize(
|
|
357
|
-
args: [
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
'end': {
|
|
376
|
-
'type': 'number'
|
|
377
|
-
}
|
|
378
|
-
}
|
|
373
|
+
description: ( localize(9724, "Stop Cell Execution")),
|
|
374
|
+
args: [{
|
|
375
|
+
name: "options",
|
|
376
|
+
description: "The cell range options",
|
|
377
|
+
schema: {
|
|
378
|
+
"type": "object",
|
|
379
|
+
"required": ["ranges"],
|
|
380
|
+
"properties": {
|
|
381
|
+
"ranges": {
|
|
382
|
+
"type": "array",
|
|
383
|
+
items: [{
|
|
384
|
+
"type": "object",
|
|
385
|
+
"required": ["start", "end"],
|
|
386
|
+
"properties": {
|
|
387
|
+
"start": {
|
|
388
|
+
"type": "number"
|
|
389
|
+
},
|
|
390
|
+
"end": {
|
|
391
|
+
"type": "number"
|
|
379
392
|
}
|
|
380
|
-
|
|
381
|
-
}
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
393
|
+
}
|
|
394
|
+
}]
|
|
395
|
+
},
|
|
396
|
+
"document": {
|
|
397
|
+
"type": "object",
|
|
398
|
+
"description": "The document uri"
|
|
386
399
|
}
|
|
387
400
|
}
|
|
388
401
|
}
|
|
389
|
-
]
|
|
390
|
-
}
|
|
402
|
+
}]
|
|
403
|
+
}
|
|
391
404
|
});
|
|
392
405
|
}
|
|
393
406
|
parseArgs(accessor, ...args) {
|
|
@@ -395,10 +408,11 @@ registerAction2(class CancelExecuteCell extends NotebookMultiCellAction {
|
|
|
395
408
|
}
|
|
396
409
|
async runWithContext(accessor, context) {
|
|
397
410
|
if (context.ui) {
|
|
398
|
-
await context.notebookEditor.focusNotebookCell(context.cell,
|
|
411
|
+
await context.notebookEditor.focusNotebookCell(context.cell, "container", {
|
|
412
|
+
skipReveal: true
|
|
413
|
+
});
|
|
399
414
|
return context.notebookEditor.cancelNotebookCells(Iterable.single(context.cell));
|
|
400
|
-
}
|
|
401
|
-
else {
|
|
415
|
+
} else {
|
|
402
416
|
return context.notebookEditor.cancelNotebookCells(context.selectedCells);
|
|
403
417
|
}
|
|
404
418
|
}
|
|
@@ -407,57 +421,55 @@ registerAction2(class ExecuteCellSelectBelow extends NotebookCellAction {
|
|
|
407
421
|
constructor() {
|
|
408
422
|
super({
|
|
409
423
|
id: EXECUTE_CELL_SELECT_BELOW,
|
|
410
|
-
precondition: ( ContextKeyExpr.or(executeThisCellCondition, ( NOTEBOOK_CELL_TYPE.isEqualTo(
|
|
411
|
-
title: ( localize(
|
|
424
|
+
precondition: ( ContextKeyExpr.or(executeThisCellCondition, ( NOTEBOOK_CELL_TYPE.isEqualTo("markup")))),
|
|
425
|
+
title: ( localize(9725, "Execute Notebook Cell and Select Below")),
|
|
412
426
|
keybinding: {
|
|
413
427
|
when: ( ContextKeyExpr.and(NOTEBOOK_CELL_LIST_FOCUSED, ( CTX_INLINE_CHAT_FOCUSED.negate()))),
|
|
414
428
|
primary: KeyMod.Shift | KeyCode.Enter,
|
|
415
429
|
weight: NOTEBOOK_EDITOR_WIDGET_ACTION_WEIGHT
|
|
416
|
-
}
|
|
430
|
+
}
|
|
417
431
|
});
|
|
418
432
|
}
|
|
419
433
|
async runWithContext(accessor, context) {
|
|
420
434
|
const editorGroupsService = accessor.get(IEditorGroupsService);
|
|
421
435
|
const editorService = accessor.get(IEditorService);
|
|
422
436
|
const idx = context.notebookEditor.getCellIndex(context.cell);
|
|
423
|
-
if (typeof idx !==
|
|
437
|
+
if (typeof idx !== "number") {
|
|
424
438
|
return;
|
|
425
439
|
}
|
|
426
440
|
const languageService = accessor.get(ILanguageService);
|
|
427
441
|
const config = accessor.get(IConfigurationService);
|
|
428
442
|
const scrollBehavior = config.getValue(NotebookSetting.scrollToRevealCell);
|
|
429
443
|
let focusOptions;
|
|
430
|
-
if (scrollBehavior ===
|
|
431
|
-
focusOptions = { skipReveal: true };
|
|
432
|
-
}
|
|
433
|
-
else {
|
|
444
|
+
if (scrollBehavior === "none") {
|
|
434
445
|
focusOptions = {
|
|
435
|
-
|
|
446
|
+
skipReveal: true
|
|
447
|
+
};
|
|
448
|
+
} else {
|
|
449
|
+
focusOptions = {
|
|
450
|
+
revealBehavior: scrollBehavior === "fullCell" ? ScrollToRevealBehavior.fullCell : ScrollToRevealBehavior.firstLine
|
|
436
451
|
};
|
|
437
452
|
}
|
|
438
453
|
if (context.cell.cellKind === CellKind.Markup) {
|
|
439
454
|
const nextCell = context.notebookEditor.cellAt(idx + 1);
|
|
440
455
|
context.cell.updateEditState(CellEditState.Preview, EXECUTE_CELL_SELECT_BELOW);
|
|
441
456
|
if (nextCell) {
|
|
442
|
-
await context.notebookEditor.focusNotebookCell(nextCell,
|
|
443
|
-
}
|
|
444
|
-
|
|
445
|
-
const newCell = insertCell(languageService, context.notebookEditor, idx, CellKind.Markup, 'below');
|
|
457
|
+
await context.notebookEditor.focusNotebookCell(nextCell, "container", focusOptions);
|
|
458
|
+
} else {
|
|
459
|
+
const newCell = insertCell(languageService, context.notebookEditor, idx, CellKind.Markup, "below");
|
|
446
460
|
if (newCell) {
|
|
447
|
-
await context.notebookEditor.focusNotebookCell(newCell,
|
|
461
|
+
await context.notebookEditor.focusNotebookCell(newCell, "editor", focusOptions);
|
|
448
462
|
}
|
|
449
463
|
}
|
|
450
464
|
return;
|
|
451
|
-
}
|
|
452
|
-
else {
|
|
465
|
+
} else {
|
|
453
466
|
const nextCell = context.notebookEditor.cellAt(idx + 1);
|
|
454
467
|
if (nextCell) {
|
|
455
|
-
await context.notebookEditor.focusNotebookCell(nextCell,
|
|
456
|
-
}
|
|
457
|
-
|
|
458
|
-
const newCell = insertCell(languageService, context.notebookEditor, idx, CellKind.Code, 'below');
|
|
468
|
+
await context.notebookEditor.focusNotebookCell(nextCell, "container", focusOptions);
|
|
469
|
+
} else {
|
|
470
|
+
const newCell = insertCell(languageService, context.notebookEditor, idx, CellKind.Code, "below");
|
|
459
471
|
if (newCell) {
|
|
460
|
-
await context.notebookEditor.focusNotebookCell(newCell,
|
|
472
|
+
await context.notebookEditor.focusNotebookCell(newCell, "editor", focusOptions);
|
|
461
473
|
}
|
|
462
474
|
}
|
|
463
475
|
return runCell(editorGroupsService, context, editorService);
|
|
@@ -468,13 +480,13 @@ registerAction2(class ExecuteCellInsertBelow extends NotebookCellAction {
|
|
|
468
480
|
constructor() {
|
|
469
481
|
super({
|
|
470
482
|
id: EXECUTE_CELL_INSERT_BELOW,
|
|
471
|
-
precondition: ( ContextKeyExpr.or(executeThisCellCondition, ( NOTEBOOK_CELL_TYPE.isEqualTo(
|
|
472
|
-
title: ( localize(
|
|
483
|
+
precondition: ( ContextKeyExpr.or(executeThisCellCondition, ( NOTEBOOK_CELL_TYPE.isEqualTo("markup")))),
|
|
484
|
+
title: ( localize(9726, "Execute Notebook Cell and Insert Below")),
|
|
473
485
|
keybinding: {
|
|
474
486
|
when: NOTEBOOK_CELL_LIST_FOCUSED,
|
|
475
487
|
primary: KeyMod.Alt | KeyCode.Enter,
|
|
476
488
|
weight: NOTEBOOK_EDITOR_WIDGET_ACTION_WEIGHT
|
|
477
|
-
}
|
|
489
|
+
}
|
|
478
490
|
});
|
|
479
491
|
}
|
|
480
492
|
async runWithContext(accessor, context) {
|
|
@@ -482,15 +494,20 @@ registerAction2(class ExecuteCellInsertBelow extends NotebookCellAction {
|
|
|
482
494
|
const editorService = accessor.get(IEditorService);
|
|
483
495
|
const idx = context.notebookEditor.getCellIndex(context.cell);
|
|
484
496
|
const languageService = accessor.get(ILanguageService);
|
|
485
|
-
const newFocusMode = context.cell.focusMode === CellFocusMode.Editor ?
|
|
486
|
-
const newCell = insertCell(
|
|
497
|
+
const newFocusMode = context.cell.focusMode === CellFocusMode.Editor ? "editor" : "container";
|
|
498
|
+
const newCell = insertCell(
|
|
499
|
+
languageService,
|
|
500
|
+
context.notebookEditor,
|
|
501
|
+
idx,
|
|
502
|
+
context.cell.cellKind,
|
|
503
|
+
"below"
|
|
504
|
+
);
|
|
487
505
|
if (newCell) {
|
|
488
506
|
await context.notebookEditor.focusNotebookCell(newCell, newFocusMode);
|
|
489
507
|
}
|
|
490
508
|
if (context.cell.cellKind === CellKind.Markup) {
|
|
491
509
|
context.cell.updateEditState(CellEditState.Preview, EXECUTE_CELL_INSERT_BELOW);
|
|
492
|
-
}
|
|
493
|
-
else {
|
|
510
|
+
} else {
|
|
494
511
|
runCell(editorGroupsService, context, editorService);
|
|
495
512
|
}
|
|
496
513
|
}
|
|
@@ -507,22 +524,19 @@ registerAction2(class CancelAllNotebook extends CancelNotebook {
|
|
|
507
524
|
constructor() {
|
|
508
525
|
super({
|
|
509
526
|
id: CANCEL_NOTEBOOK_COMMAND_ID,
|
|
510
|
-
title: ( localize2(
|
|
527
|
+
title: ( localize2(9727, "Stop Execution")),
|
|
511
528
|
icon: stopIcon,
|
|
512
|
-
menu: [
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
when: ( ContextKeyExpr.and(NOTEBOOK_HAS_SOMETHING_RUNNING, ( NOTEBOOK_INTERRUPTIBLE_KERNEL.toNegated()), ( ContextKeyExpr.equals('config.notebook.globalToolbar', true))))
|
|
524
|
-
}
|
|
525
|
-
]
|
|
529
|
+
menu: [{
|
|
530
|
+
id: MenuId.EditorTitle,
|
|
531
|
+
order: -1,
|
|
532
|
+
group: "navigation",
|
|
533
|
+
when: ( ContextKeyExpr.and(NOTEBOOK_IS_ACTIVE_EDITOR, NOTEBOOK_HAS_SOMETHING_RUNNING, ( NOTEBOOK_INTERRUPTIBLE_KERNEL.toNegated()), ( ContextKeyExpr.notEquals("config.notebook.globalToolbar", true))))
|
|
534
|
+
}, {
|
|
535
|
+
id: MenuId.NotebookToolbar,
|
|
536
|
+
order: -1,
|
|
537
|
+
group: "navigation/execute",
|
|
538
|
+
when: ( ContextKeyExpr.and(NOTEBOOK_HAS_SOMETHING_RUNNING, ( NOTEBOOK_INTERRUPTIBLE_KERNEL.toNegated()), ( ContextKeyExpr.equals("config.notebook.globalToolbar", true))))
|
|
539
|
+
}]
|
|
526
540
|
});
|
|
527
541
|
}
|
|
528
542
|
});
|
|
@@ -530,75 +544,67 @@ registerAction2(class InterruptNotebook extends CancelNotebook {
|
|
|
530
544
|
constructor() {
|
|
531
545
|
super({
|
|
532
546
|
id: INTERRUPT_NOTEBOOK_COMMAND_ID,
|
|
533
|
-
title: ( localize2(
|
|
547
|
+
title: ( localize2(9728, "Interrupt")),
|
|
534
548
|
precondition: ( ContextKeyExpr.and(NOTEBOOK_HAS_SOMETHING_RUNNING, NOTEBOOK_INTERRUPTIBLE_KERNEL)),
|
|
535
549
|
icon: stopIcon,
|
|
536
|
-
menu: [
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
id: MenuId.InteractiveToolbar,
|
|
560
|
-
group: 'navigation/execute'
|
|
561
|
-
}
|
|
562
|
-
]
|
|
550
|
+
menu: [{
|
|
551
|
+
id: MenuId.EditorTitle,
|
|
552
|
+
order: -1,
|
|
553
|
+
group: "navigation",
|
|
554
|
+
when: ( ContextKeyExpr.and(
|
|
555
|
+
NOTEBOOK_IS_ACTIVE_EDITOR,
|
|
556
|
+
NOTEBOOK_HAS_SOMETHING_RUNNING,
|
|
557
|
+
NOTEBOOK_INTERRUPTIBLE_KERNEL,
|
|
558
|
+
( ContextKeyExpr.notEquals("config.notebook.globalToolbar", true))
|
|
559
|
+
))
|
|
560
|
+
}, {
|
|
561
|
+
id: MenuId.NotebookToolbar,
|
|
562
|
+
order: -1,
|
|
563
|
+
group: "navigation/execute",
|
|
564
|
+
when: ( ContextKeyExpr.and(
|
|
565
|
+
NOTEBOOK_HAS_SOMETHING_RUNNING,
|
|
566
|
+
NOTEBOOK_INTERRUPTIBLE_KERNEL,
|
|
567
|
+
( ContextKeyExpr.equals("config.notebook.globalToolbar", true))
|
|
568
|
+
))
|
|
569
|
+
}, {
|
|
570
|
+
id: MenuId.InteractiveToolbar,
|
|
571
|
+
group: "navigation/execute"
|
|
572
|
+
}]
|
|
563
573
|
});
|
|
564
574
|
}
|
|
565
575
|
});
|
|
566
576
|
MenuRegistry.appendMenuItem(MenuId.NotebookToolbar, {
|
|
567
|
-
title: ( localize(
|
|
577
|
+
title: ( localize(9729, "Go To")),
|
|
568
578
|
submenu: MenuId.NotebookCellExecuteGoTo,
|
|
569
|
-
group:
|
|
579
|
+
group: "navigation/execute",
|
|
570
580
|
order: 20,
|
|
571
|
-
icon: ThemeIcon.modify(executingStateIcon,
|
|
581
|
+
icon: ThemeIcon.modify(executingStateIcon, "spin")
|
|
572
582
|
});
|
|
573
583
|
registerAction2(class RevealRunningCellAction extends NotebookAction {
|
|
574
584
|
constructor() {
|
|
575
585
|
super({
|
|
576
586
|
id: REVEAL_RUNNING_CELL,
|
|
577
|
-
title: ( localize(
|
|
578
|
-
tooltip: ( localize(
|
|
579
|
-
shortTitle: ( localize(
|
|
587
|
+
title: ( localize(9730, "Go to Running Cell")),
|
|
588
|
+
tooltip: ( localize(9730, "Go to Running Cell")),
|
|
589
|
+
shortTitle: ( localize(9730, "Go to Running Cell")),
|
|
580
590
|
precondition: NOTEBOOK_HAS_RUNNING_CELL,
|
|
581
|
-
menu: [
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
order: 10
|
|
599
|
-
}
|
|
600
|
-
],
|
|
601
|
-
icon: ThemeIcon.modify(executingStateIcon, 'spin')
|
|
591
|
+
menu: [{
|
|
592
|
+
id: MenuId.EditorTitle,
|
|
593
|
+
when: ( ContextKeyExpr.and(NOTEBOOK_IS_ACTIVE_EDITOR, NOTEBOOK_HAS_RUNNING_CELL, ( ContextKeyExpr.notEquals("config.notebook.globalToolbar", true)))),
|
|
594
|
+
group: "navigation",
|
|
595
|
+
order: 0
|
|
596
|
+
}, {
|
|
597
|
+
id: MenuId.NotebookCellExecuteGoTo,
|
|
598
|
+
when: ( ContextKeyExpr.and(NOTEBOOK_IS_ACTIVE_EDITOR, NOTEBOOK_HAS_RUNNING_CELL, ( ContextKeyExpr.equals("config.notebook.globalToolbar", true)))),
|
|
599
|
+
group: "navigation/execute",
|
|
600
|
+
order: 20
|
|
601
|
+
}, {
|
|
602
|
+
id: MenuId.InteractiveToolbar,
|
|
603
|
+
when: ( ContextKeyExpr.and(NOTEBOOK_HAS_RUNNING_CELL, ( ContextKeyExpr.equals("activeEditor", "workbench.editor.interactive")))),
|
|
604
|
+
group: "navigation",
|
|
605
|
+
order: 10
|
|
606
|
+
}],
|
|
607
|
+
icon: ThemeIcon.modify(executingStateIcon, "spin")
|
|
602
608
|
});
|
|
603
609
|
}
|
|
604
610
|
async runWithContext(accessor, context) {
|
|
@@ -610,7 +616,7 @@ registerAction2(class RevealRunningCellAction extends NotebookAction {
|
|
|
610
616
|
const focusHandle = topStackFrameCell ?? executingCells[0].cellHandle;
|
|
611
617
|
const cell = context.notebookEditor.getCellByHandle(focusHandle);
|
|
612
618
|
if (cell) {
|
|
613
|
-
context.notebookEditor.focusNotebookCell(cell,
|
|
619
|
+
context.notebookEditor.focusNotebookCell(cell, "container");
|
|
614
620
|
}
|
|
615
621
|
}
|
|
616
622
|
}
|
|
@@ -634,25 +640,22 @@ registerAction2(class RevealLastFailedCellAction extends NotebookAction {
|
|
|
634
640
|
constructor() {
|
|
635
641
|
super({
|
|
636
642
|
id: REVEAL_LAST_FAILED_CELL,
|
|
637
|
-
title: ( localize(
|
|
638
|
-
tooltip: ( localize(
|
|
639
|
-
shortTitle: ( localize(
|
|
643
|
+
title: ( localize(9731, "Go to Most Recently Failed Cell")),
|
|
644
|
+
tooltip: ( localize(9731, "Go to Most Recently Failed Cell")),
|
|
645
|
+
shortTitle: ( localize(9732, "Go to Most Recently Failed Cell")),
|
|
640
646
|
precondition: NOTEBOOK_LAST_CELL_FAILED,
|
|
641
|
-
menu: [
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
},
|
|
654
|
-
],
|
|
655
|
-
icon: errorStateIcon,
|
|
647
|
+
menu: [{
|
|
648
|
+
id: MenuId.EditorTitle,
|
|
649
|
+
when: ( ContextKeyExpr.and(NOTEBOOK_IS_ACTIVE_EDITOR, NOTEBOOK_LAST_CELL_FAILED, ( NOTEBOOK_HAS_RUNNING_CELL.toNegated()), ( ContextKeyExpr.notEquals("config.notebook.globalToolbar", true)))),
|
|
650
|
+
group: "navigation",
|
|
651
|
+
order: 0
|
|
652
|
+
}, {
|
|
653
|
+
id: MenuId.NotebookCellExecuteGoTo,
|
|
654
|
+
when: ( ContextKeyExpr.and(NOTEBOOK_IS_ACTIVE_EDITOR, NOTEBOOK_LAST_CELL_FAILED, ( NOTEBOOK_HAS_RUNNING_CELL.toNegated()), ( ContextKeyExpr.equals("config.notebook.globalToolbar", true)))),
|
|
655
|
+
group: "navigation/execute",
|
|
656
|
+
order: 20
|
|
657
|
+
}],
|
|
658
|
+
icon: errorStateIcon
|
|
656
659
|
});
|
|
657
660
|
}
|
|
658
661
|
async runWithContext(accessor, context) {
|
|
@@ -662,7 +665,7 @@ registerAction2(class RevealLastFailedCellAction extends NotebookAction {
|
|
|
662
665
|
if (lastFailedCellHandle !== undefined) {
|
|
663
666
|
const lastFailedCell = context.notebookEditor.getCellByHandle(lastFailedCellHandle);
|
|
664
667
|
if (lastFailedCell) {
|
|
665
|
-
context.notebookEditor.focusNotebookCell(lastFailedCell,
|
|
668
|
+
context.notebookEditor.focusNotebookCell(lastFailedCell, "container");
|
|
666
669
|
}
|
|
667
670
|
}
|
|
668
671
|
}
|