@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.
- 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
|
@@ -8,7 +8,9 @@ import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/pl
|
|
|
8
8
|
import { registerNotebookContribution } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/browser/notebookEditorExtensions';
|
|
9
9
|
|
|
10
10
|
let NotebookSelectionHighlighter = class NotebookSelectionHighlighter extends Disposable {
|
|
11
|
-
static {
|
|
11
|
+
static {
|
|
12
|
+
this.id = "notebook.selectionHighlighter";
|
|
13
|
+
}
|
|
12
14
|
constructor(notebookEditor, configurationService) {
|
|
13
15
|
super();
|
|
14
16
|
this.notebookEditor = notebookEditor;
|
|
@@ -16,10 +18,10 @@ let NotebookSelectionHighlighter = class NotebookSelectionHighlighter extends Di
|
|
|
16
18
|
this.isEnabled = false;
|
|
17
19
|
this.cellDecorationIds = ( new Map());
|
|
18
20
|
this.anchorDisposables = ( new DisposableStore());
|
|
19
|
-
this.isEnabled = this.configurationService.getValue(
|
|
21
|
+
this.isEnabled = this.configurationService.getValue("editor.selectionHighlight");
|
|
20
22
|
this._register(this.configurationService.onDidChangeConfiguration(e => {
|
|
21
|
-
if (e.affectsConfiguration(
|
|
22
|
-
this.isEnabled = this.configurationService.getValue(
|
|
23
|
+
if (e.affectsConfiguration("editor.selectionHighlight")) {
|
|
24
|
+
this.isEnabled = this.configurationService.getValue("editor.selectionHighlight");
|
|
23
25
|
}
|
|
24
26
|
}));
|
|
25
27
|
this._register(this.notebookEditor.onDidChangeActiveCell(async () => {
|
|
@@ -39,7 +41,7 @@ let NotebookSelectionHighlighter = class NotebookSelectionHighlighter extends Di
|
|
|
39
41
|
}
|
|
40
42
|
this.clearNotebookSelectionDecorations();
|
|
41
43
|
this.anchorDisposables.clear();
|
|
42
|
-
this.anchorDisposables.add(this.anchorCell[1].onDidChangeCursorPosition(
|
|
44
|
+
this.anchorDisposables.add(this.anchorCell[1].onDidChangeCursorPosition(e => {
|
|
43
45
|
if (e.reason !== CursorChangeReason.Explicit) {
|
|
44
46
|
this.clearNotebookSelectionDecorations();
|
|
45
47
|
return;
|
|
@@ -93,8 +95,8 @@ let NotebookSelectionHighlighter = class NotebookSelectionHighlighter extends Di
|
|
|
93
95
|
newDecorations.push({
|
|
94
96
|
range: selection,
|
|
95
97
|
options: {
|
|
96
|
-
description:
|
|
97
|
-
className:
|
|
98
|
+
description: "",
|
|
99
|
+
className: ".nb-selection-highlight"
|
|
98
100
|
}
|
|
99
101
|
});
|
|
100
102
|
}
|
|
@@ -112,14 +114,12 @@ let NotebookSelectionHighlighter = class NotebookSelectionHighlighter extends Di
|
|
|
112
114
|
});
|
|
113
115
|
}
|
|
114
116
|
getSearchText(selection, model) {
|
|
115
|
-
return model.getValueInRange(selection).replace(/\r\n/g,
|
|
117
|
+
return model.getValueInRange(selection).replace(/\r\n/g, "\n");
|
|
116
118
|
}
|
|
117
119
|
dispose() {
|
|
118
120
|
super.dispose();
|
|
119
121
|
this.anchorDisposables.dispose();
|
|
120
122
|
}
|
|
121
123
|
};
|
|
122
|
-
NotebookSelectionHighlighter = ( __decorate([
|
|
123
|
-
( __param(1, IConfigurationService))
|
|
124
|
-
], NotebookSelectionHighlighter));
|
|
124
|
+
NotebookSelectionHighlighter = ( __decorate([( __param(1, IConfigurationService))], NotebookSelectionHighlighter));
|
|
125
125
|
registerNotebookContribution(NotebookSelectionHighlighter.id, NotebookSelectionHighlighter);
|
|
@@ -17,34 +17,34 @@ import { CellEditState } from '@codingame/monaco-vscode-api/vscode/vs/workbench/
|
|
|
17
17
|
import { NOTEBOOK_EDITOR_CURSOR_BOUNDARY, NOTEBOOK_EDITOR_CURSOR_LINE_BOUNDARY, CellKind } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
|
|
18
18
|
import { NOTEBOOK_OUTPUT_INPUT_FOCUSED, NOTEBOOK_EDITOR_FOCUSED, NOTEBOOK_CELL_TYPE, NOTEBOOK_CELL_MARKDOWN_EDIT_MODE, NOTEBOOK_CURSOR_NAVIGATION_MODE, NOTEBOOK_OUTPUT_FOCUSED, NOTEBOOK_CELL_EDITOR_FOCUSED, NOTEBOOK_OR_COMPOSITE_IS_ACTIVE_EDITOR, IS_COMPOSITE_NOTEBOOK, NOTEBOOK_CELL_HAS_OUTPUTS } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookContextKeys';
|
|
19
19
|
|
|
20
|
-
const NOTEBOOK_FOCUS_TOP =
|
|
21
|
-
const NOTEBOOK_FOCUS_BOTTOM =
|
|
22
|
-
const NOTEBOOK_FOCUS_PREVIOUS_EDITOR =
|
|
23
|
-
const NOTEBOOK_FOCUS_NEXT_EDITOR =
|
|
24
|
-
const FOCUS_IN_OUTPUT_COMMAND_ID =
|
|
25
|
-
const FOCUS_OUT_OUTPUT_COMMAND_ID =
|
|
26
|
-
const CENTER_ACTIVE_CELL =
|
|
27
|
-
const NOTEBOOK_CURSOR_PAGEUP_COMMAND_ID =
|
|
28
|
-
const NOTEBOOK_CURSOR_PAGEUP_SELECT_COMMAND_ID =
|
|
29
|
-
const NOTEBOOK_CURSOR_PAGEDOWN_COMMAND_ID =
|
|
30
|
-
const NOTEBOOK_CURSOR_PAGEDOWN_SELECT_COMMAND_ID =
|
|
20
|
+
const NOTEBOOK_FOCUS_TOP = "notebook.focusTop";
|
|
21
|
+
const NOTEBOOK_FOCUS_BOTTOM = "notebook.focusBottom";
|
|
22
|
+
const NOTEBOOK_FOCUS_PREVIOUS_EDITOR = "notebook.focusPreviousEditor";
|
|
23
|
+
const NOTEBOOK_FOCUS_NEXT_EDITOR = "notebook.focusNextEditor";
|
|
24
|
+
const FOCUS_IN_OUTPUT_COMMAND_ID = "notebook.cell.focusInOutput";
|
|
25
|
+
const FOCUS_OUT_OUTPUT_COMMAND_ID = "notebook.cell.focusOutOutput";
|
|
26
|
+
const CENTER_ACTIVE_CELL = "notebook.centerActiveCell";
|
|
27
|
+
const NOTEBOOK_CURSOR_PAGEUP_COMMAND_ID = "notebook.cell.cursorPageUp";
|
|
28
|
+
const NOTEBOOK_CURSOR_PAGEUP_SELECT_COMMAND_ID = "notebook.cell.cursorPageUpSelect";
|
|
29
|
+
const NOTEBOOK_CURSOR_PAGEDOWN_COMMAND_ID = "notebook.cell.cursorPageDown";
|
|
30
|
+
const NOTEBOOK_CURSOR_PAGEDOWN_SELECT_COMMAND_ID = "notebook.cell.cursorPageDownSelect";
|
|
31
31
|
registerAction2(class extends Action2 {
|
|
32
32
|
constructor() {
|
|
33
33
|
super({
|
|
34
|
-
id:
|
|
34
|
+
id: "notebook.cell.nullAction",
|
|
35
35
|
title: ( localize(
|
|
36
|
-
|
|
36
|
+
9624,
|
|
37
37
|
"Keypresses that should be handled by the focused element in the cell output."
|
|
38
38
|
)),
|
|
39
39
|
keybinding: [{
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
40
|
+
when: NOTEBOOK_OUTPUT_INPUT_FOCUSED,
|
|
41
|
+
primary: KeyCode.DownArrow,
|
|
42
|
+
weight: KeybindingWeight.WorkbenchContrib + 1
|
|
43
|
+
}, {
|
|
44
|
+
when: NOTEBOOK_OUTPUT_INPUT_FOCUSED,
|
|
45
|
+
primary: KeyCode.UpArrow,
|
|
46
|
+
weight: KeybindingWeight.WorkbenchContrib + 1
|
|
47
|
+
}],
|
|
48
48
|
f1: false
|
|
49
49
|
});
|
|
50
50
|
}
|
|
@@ -56,38 +56,37 @@ registerAction2(class FocusNextCellAction extends NotebookCellAction {
|
|
|
56
56
|
constructor() {
|
|
57
57
|
super({
|
|
58
58
|
id: NOTEBOOK_FOCUS_NEXT_EDITOR,
|
|
59
|
-
title: ( localize(
|
|
60
|
-
keybinding: [
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
{
|
|
72
|
-
|
|
73
|
-
primary: KeyMod.CtrlCmd | KeyCode.DownArrow,
|
|
74
|
-
mac: { primary: KeyMod.WinCtrl | KeyMod.CtrlCmd | KeyCode.DownArrow, },
|
|
75
|
-
weight: KeybindingWeight.WorkbenchContrib
|
|
59
|
+
title: ( localize(9625, "Focus Next Cell Editor")),
|
|
60
|
+
keybinding: [{
|
|
61
|
+
when: ( ContextKeyExpr.and(NOTEBOOK_EDITOR_FOCUSED, ( CONTEXT_ACCESSIBILITY_MODE_ENABLED.negate()), ( ContextKeyExpr.equals("config.notebook.navigation.allowNavigateToSurroundingCells", true)), ( ContextKeyExpr.and(( ContextKeyExpr.has(InputFocusedContextKey)), EditorContextKeys.editorTextFocus, ( NOTEBOOK_EDITOR_CURSOR_BOUNDARY.notEqualsTo("top")), ( NOTEBOOK_EDITOR_CURSOR_BOUNDARY.notEqualsTo("none")), ( ContextKeyExpr.or(( NOTEBOOK_EDITOR_CURSOR_LINE_BOUNDARY.isEqualTo("end")), ( NOTEBOOK_EDITOR_CURSOR_LINE_BOUNDARY.isEqualTo("both")))))), ( EditorContextKeys.isEmbeddedDiffEditor.negate()))),
|
|
62
|
+
primary: KeyCode.DownArrow,
|
|
63
|
+
weight: NOTEBOOK_EDITOR_WIDGET_ACTION_WEIGHT
|
|
64
|
+
}, {
|
|
65
|
+
when: ( ContextKeyExpr.and(NOTEBOOK_EDITOR_FOCUSED, ( CONTEXT_ACCESSIBILITY_MODE_ENABLED.negate()), ( ContextKeyExpr.equals("config.notebook.navigation.allowNavigateToSurroundingCells", true)), ( ContextKeyExpr.and(( NOTEBOOK_CELL_TYPE.isEqualTo("markup")), ( NOTEBOOK_CELL_MARKDOWN_EDIT_MODE.isEqualTo(false)), NOTEBOOK_CURSOR_NAVIGATION_MODE)), ( EditorContextKeys.isEmbeddedDiffEditor.negate()))),
|
|
66
|
+
primary: KeyCode.DownArrow,
|
|
67
|
+
weight: KeybindingWeight.WorkbenchContrib
|
|
68
|
+
}, {
|
|
69
|
+
when: ( ContextKeyExpr.and(NOTEBOOK_EDITOR_FOCUSED, NOTEBOOK_OUTPUT_FOCUSED)),
|
|
70
|
+
primary: KeyMod.CtrlCmd | KeyCode.DownArrow,
|
|
71
|
+
mac: {
|
|
72
|
+
primary: KeyMod.WinCtrl | KeyMod.CtrlCmd | KeyCode.DownArrow
|
|
76
73
|
},
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
74
|
+
weight: KeybindingWeight.WorkbenchContrib
|
|
75
|
+
}, {
|
|
76
|
+
when: ( ContextKeyExpr.and(NOTEBOOK_CELL_EDITOR_FOCUSED, CONTEXT_ACCESSIBILITY_MODE_ENABLED)),
|
|
77
|
+
primary: KeyMod.CtrlCmd | KeyCode.PageDown,
|
|
78
|
+
mac: {
|
|
79
|
+
primary: KeyMod.WinCtrl | KeyCode.PageUp
|
|
82
80
|
},
|
|
83
|
-
|
|
81
|
+
weight: KeybindingWeight.WorkbenchContrib + 1
|
|
82
|
+
}]
|
|
84
83
|
});
|
|
85
84
|
}
|
|
86
85
|
async runWithContext(accessor, context) {
|
|
87
86
|
const editor = context.notebookEditor;
|
|
88
87
|
const activeCell = context.cell;
|
|
89
88
|
const idx = editor.getCellIndex(activeCell);
|
|
90
|
-
if (typeof idx !==
|
|
89
|
+
if (typeof idx !== "number") {
|
|
91
90
|
return;
|
|
92
91
|
}
|
|
93
92
|
if (idx >= editor.getLength() - 1) {
|
|
@@ -98,11 +97,12 @@ registerAction2(class FocusNextCellAction extends NotebookCellAction {
|
|
|
98
97
|
const foundEditor = targetCell ? findTargetCellEditor(context, targetCell) : undefined;
|
|
99
98
|
if (foundEditor && foundEditor.hasTextFocus() && InlineChatController.get(foundEditor)?.getWidgetPosition()?.lineNumber === focusEditorLine) {
|
|
100
99
|
InlineChatController.get(foundEditor)?.focus();
|
|
101
|
-
}
|
|
102
|
-
else {
|
|
100
|
+
} else {
|
|
103
101
|
const newCell = editor.cellAt(idx + 1);
|
|
104
|
-
const newFocusMode = newCell.cellKind === CellKind.Markup && newCell.getEditState() === CellEditState.Preview ?
|
|
105
|
-
await editor.focusNotebookCell(newCell, newFocusMode, {
|
|
102
|
+
const newFocusMode = newCell.cellKind === CellKind.Markup && newCell.getEditState() === CellEditState.Preview ? "container" : "editor";
|
|
103
|
+
await editor.focusNotebookCell(newCell, newFocusMode, {
|
|
104
|
+
focusEditorLine: 1
|
|
105
|
+
});
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
108
|
});
|
|
@@ -110,41 +110,41 @@ registerAction2(class FocusPreviousCellAction extends NotebookCellAction {
|
|
|
110
110
|
constructor() {
|
|
111
111
|
super({
|
|
112
112
|
id: NOTEBOOK_FOCUS_PREVIOUS_EDITOR,
|
|
113
|
-
title: ( localize(
|
|
114
|
-
keybinding: [
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
{
|
|
126
|
-
|
|
127
|
-
primary: KeyMod.CtrlCmd | KeyCode.PageUp,
|
|
128
|
-
mac: { primary: KeyMod.WinCtrl | KeyCode.PageUp, },
|
|
129
|
-
weight: KeybindingWeight.WorkbenchContrib + 1
|
|
113
|
+
title: ( localize(9626, "Focus Previous Cell Editor")),
|
|
114
|
+
keybinding: [{
|
|
115
|
+
when: ( ContextKeyExpr.and(NOTEBOOK_EDITOR_FOCUSED, ( CONTEXT_ACCESSIBILITY_MODE_ENABLED.negate()), ( ContextKeyExpr.equals("config.notebook.navigation.allowNavigateToSurroundingCells", true)), ( ContextKeyExpr.and(( ContextKeyExpr.has(InputFocusedContextKey)), EditorContextKeys.editorTextFocus, ( NOTEBOOK_EDITOR_CURSOR_BOUNDARY.notEqualsTo("bottom")), ( NOTEBOOK_EDITOR_CURSOR_BOUNDARY.notEqualsTo("none")), ( ContextKeyExpr.or(( NOTEBOOK_EDITOR_CURSOR_LINE_BOUNDARY.isEqualTo("start")), ( NOTEBOOK_EDITOR_CURSOR_LINE_BOUNDARY.isEqualTo("both")))))), ( EditorContextKeys.isEmbeddedDiffEditor.negate()))),
|
|
116
|
+
primary: KeyCode.UpArrow,
|
|
117
|
+
weight: NOTEBOOK_EDITOR_WIDGET_ACTION_WEIGHT
|
|
118
|
+
}, {
|
|
119
|
+
when: ( ContextKeyExpr.and(NOTEBOOK_EDITOR_FOCUSED, ( CONTEXT_ACCESSIBILITY_MODE_ENABLED.negate()), ( ContextKeyExpr.equals("config.notebook.navigation.allowNavigateToSurroundingCells", true)), ( ContextKeyExpr.and(( NOTEBOOK_CELL_TYPE.isEqualTo("markup")), ( NOTEBOOK_CELL_MARKDOWN_EDIT_MODE.isEqualTo(false)), NOTEBOOK_CURSOR_NAVIGATION_MODE)), ( EditorContextKeys.isEmbeddedDiffEditor.negate()))),
|
|
120
|
+
primary: KeyCode.UpArrow,
|
|
121
|
+
weight: KeybindingWeight.WorkbenchContrib
|
|
122
|
+
}, {
|
|
123
|
+
when: ( ContextKeyExpr.and(NOTEBOOK_CELL_EDITOR_FOCUSED, CONTEXT_ACCESSIBILITY_MODE_ENABLED)),
|
|
124
|
+
primary: KeyMod.CtrlCmd | KeyCode.PageUp,
|
|
125
|
+
mac: {
|
|
126
|
+
primary: KeyMod.WinCtrl | KeyCode.PageUp
|
|
130
127
|
},
|
|
131
|
-
|
|
128
|
+
weight: KeybindingWeight.WorkbenchContrib + 1
|
|
129
|
+
}]
|
|
132
130
|
});
|
|
133
131
|
}
|
|
134
132
|
async runWithContext(accessor, context) {
|
|
135
133
|
const editor = context.notebookEditor;
|
|
136
134
|
const activeCell = context.cell;
|
|
137
135
|
const idx = editor.getCellIndex(activeCell);
|
|
138
|
-
if (typeof idx !==
|
|
136
|
+
if (typeof idx !== "number") {
|
|
139
137
|
return;
|
|
140
138
|
}
|
|
141
139
|
if (idx < 1 || editor.getLength() === 0) {
|
|
142
140
|
return;
|
|
143
141
|
}
|
|
144
142
|
const newCell = editor.cellAt(idx - 1);
|
|
145
|
-
const newFocusMode = newCell.cellKind === CellKind.Markup && newCell.getEditState() === CellEditState.Preview ?
|
|
143
|
+
const newFocusMode = newCell.cellKind === CellKind.Markup && newCell.getEditState() === CellEditState.Preview ? "container" : "editor";
|
|
146
144
|
const focusEditorLine = newCell.textBuffer.getLineCount();
|
|
147
|
-
await editor.focusNotebookCell(newCell, newFocusMode, {
|
|
145
|
+
await editor.focusNotebookCell(newCell, newFocusMode, {
|
|
146
|
+
focusEditorLine: focusEditorLine
|
|
147
|
+
});
|
|
148
148
|
const foundEditor = findTargetCellEditor(context, newCell);
|
|
149
149
|
if (foundEditor && InlineChatController.get(foundEditor)?.getWidgetPosition()?.lineNumber === focusEditorLine) {
|
|
150
150
|
InlineChatController.get(foundEditor)?.focus();
|
|
@@ -155,19 +155,18 @@ registerAction2(class extends NotebookAction {
|
|
|
155
155
|
constructor() {
|
|
156
156
|
super({
|
|
157
157
|
id: NOTEBOOK_FOCUS_TOP,
|
|
158
|
-
title: ( localize(
|
|
159
|
-
keybinding: [
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
158
|
+
title: ( localize(9627, "Focus First Cell")),
|
|
159
|
+
keybinding: [{
|
|
160
|
+
when: ( ContextKeyExpr.and(NOTEBOOK_EDITOR_FOCUSED, ContextKeyExpr.not(InputFocusedContextKey))),
|
|
161
|
+
primary: KeyMod.CtrlCmd | KeyCode.Home,
|
|
162
|
+
weight: KeybindingWeight.WorkbenchContrib
|
|
163
|
+
}, {
|
|
164
|
+
when: ( ContextKeyExpr.and(NOTEBOOK_EDITOR_FOCUSED, ContextKeyExpr.not(InputFocusedContextKey))),
|
|
165
|
+
mac: {
|
|
166
|
+
primary: KeyMod.CtrlCmd | KeyCode.UpArrow
|
|
164
167
|
},
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
mac: { primary: KeyMod.CtrlCmd | KeyCode.UpArrow },
|
|
168
|
-
weight: KeybindingWeight.WorkbenchContrib
|
|
169
|
-
}
|
|
170
|
-
],
|
|
168
|
+
weight: KeybindingWeight.WorkbenchContrib
|
|
169
|
+
}]
|
|
171
170
|
});
|
|
172
171
|
}
|
|
173
172
|
async runWithContext(accessor, context) {
|
|
@@ -176,27 +175,26 @@ registerAction2(class extends NotebookAction {
|
|
|
176
175
|
return;
|
|
177
176
|
}
|
|
178
177
|
const firstCell = editor.cellAt(0);
|
|
179
|
-
await editor.focusNotebookCell(firstCell,
|
|
178
|
+
await editor.focusNotebookCell(firstCell, "container");
|
|
180
179
|
}
|
|
181
180
|
});
|
|
182
181
|
registerAction2(class extends NotebookAction {
|
|
183
182
|
constructor() {
|
|
184
183
|
super({
|
|
185
184
|
id: NOTEBOOK_FOCUS_BOTTOM,
|
|
186
|
-
title: ( localize(
|
|
187
|
-
keybinding: [
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
185
|
+
title: ( localize(9628, "Focus Last Cell")),
|
|
186
|
+
keybinding: [{
|
|
187
|
+
when: ( ContextKeyExpr.and(NOTEBOOK_EDITOR_FOCUSED, ContextKeyExpr.not(InputFocusedContextKey))),
|
|
188
|
+
primary: KeyMod.CtrlCmd | KeyCode.End,
|
|
189
|
+
mac: undefined,
|
|
190
|
+
weight: KeybindingWeight.WorkbenchContrib
|
|
191
|
+
}, {
|
|
192
|
+
when: ( ContextKeyExpr.and(NOTEBOOK_EDITOR_FOCUSED, ContextKeyExpr.not(InputFocusedContextKey))),
|
|
193
|
+
mac: {
|
|
194
|
+
primary: KeyMod.CtrlCmd | KeyCode.DownArrow
|
|
193
195
|
},
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
mac: { primary: KeyMod.CtrlCmd | KeyCode.DownArrow },
|
|
197
|
-
weight: KeybindingWeight.WorkbenchContrib
|
|
198
|
-
}
|
|
199
|
-
],
|
|
196
|
+
weight: KeybindingWeight.WorkbenchContrib
|
|
197
|
+
}]
|
|
200
198
|
});
|
|
201
199
|
}
|
|
202
200
|
async runWithContext(accessor, context) {
|
|
@@ -208,7 +206,7 @@ registerAction2(class extends NotebookAction {
|
|
|
208
206
|
const lastVisibleIdx = editor.getPreviousVisibleCellIndex(lastIdx);
|
|
209
207
|
if (lastVisibleIdx) {
|
|
210
208
|
const cell = editor.cellAt(lastVisibleIdx);
|
|
211
|
-
await editor.focusNotebookCell(cell,
|
|
209
|
+
await editor.focusNotebookCell(cell, "container");
|
|
212
210
|
}
|
|
213
211
|
}
|
|
214
212
|
});
|
|
@@ -216,58 +214,62 @@ registerAction2(class extends NotebookCellAction {
|
|
|
216
214
|
constructor() {
|
|
217
215
|
super({
|
|
218
216
|
id: FOCUS_IN_OUTPUT_COMMAND_ID,
|
|
219
|
-
title: ( localize2(
|
|
217
|
+
title: ( localize2(9629, "Focus In Active Cell Output")),
|
|
220
218
|
f1: true,
|
|
221
219
|
keybinding: [{
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
}
|
|
220
|
+
when: ( ContextKeyExpr.and(( IS_COMPOSITE_NOTEBOOK.negate()), IsWindowsContext, NOTEBOOK_CELL_HAS_OUTPUTS)),
|
|
221
|
+
primary: KeyMod.CtrlCmd | KeyCode.DownArrow,
|
|
222
|
+
weight: KeybindingWeight.WorkbenchContrib
|
|
223
|
+
}, {
|
|
224
|
+
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.DownArrow,
|
|
225
|
+
mac: {
|
|
226
|
+
primary: KeyMod.WinCtrl | KeyMod.CtrlCmd | KeyCode.DownArrow
|
|
227
|
+
},
|
|
228
|
+
weight: KeybindingWeight.WorkbenchContrib
|
|
229
|
+
}],
|
|
230
230
|
precondition: NOTEBOOK_OR_COMPOSITE_IS_ACTIVE_EDITOR
|
|
231
231
|
});
|
|
232
232
|
}
|
|
233
233
|
async runWithContext(accessor, context) {
|
|
234
234
|
const editor = context.notebookEditor;
|
|
235
235
|
const activeCell = context.cell;
|
|
236
|
-
return timeout(0).then(() => editor.focusNotebookCell(activeCell,
|
|
236
|
+
return timeout(0).then(() => editor.focusNotebookCell(activeCell, "output"));
|
|
237
237
|
}
|
|
238
238
|
});
|
|
239
239
|
registerAction2(class extends NotebookCellAction {
|
|
240
240
|
constructor() {
|
|
241
241
|
super({
|
|
242
242
|
id: FOCUS_OUT_OUTPUT_COMMAND_ID,
|
|
243
|
-
title: ( localize(
|
|
243
|
+
title: ( localize(9630, "Focus Out Active Cell Output")),
|
|
244
244
|
keybinding: {
|
|
245
245
|
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.UpArrow,
|
|
246
|
-
mac: {
|
|
246
|
+
mac: {
|
|
247
|
+
primary: KeyMod.WinCtrl | KeyMod.CtrlCmd | KeyCode.UpArrow
|
|
248
|
+
},
|
|
247
249
|
weight: KeybindingWeight.WorkbenchContrib
|
|
248
250
|
},
|
|
249
|
-
precondition: ( ContextKeyExpr.and(NOTEBOOK_EDITOR_FOCUSED, NOTEBOOK_OUTPUT_FOCUSED))
|
|
251
|
+
precondition: ( ContextKeyExpr.and(NOTEBOOK_EDITOR_FOCUSED, NOTEBOOK_OUTPUT_FOCUSED))
|
|
250
252
|
});
|
|
251
253
|
}
|
|
252
254
|
async runWithContext(accessor, context) {
|
|
253
255
|
const editor = context.notebookEditor;
|
|
254
256
|
const activeCell = context.cell;
|
|
255
|
-
await editor.focusNotebookCell(activeCell,
|
|
257
|
+
await editor.focusNotebookCell(activeCell, "editor");
|
|
256
258
|
}
|
|
257
259
|
});
|
|
258
260
|
registerAction2(class CenterActiveCellAction extends NotebookCellAction {
|
|
259
261
|
constructor() {
|
|
260
262
|
super({
|
|
261
263
|
id: CENTER_ACTIVE_CELL,
|
|
262
|
-
title: ( localize(
|
|
264
|
+
title: ( localize(9631, "Center Active Cell")),
|
|
263
265
|
keybinding: {
|
|
264
266
|
when: NOTEBOOK_EDITOR_FOCUSED,
|
|
265
267
|
primary: KeyMod.CtrlCmd | KeyCode.KeyL,
|
|
266
268
|
mac: {
|
|
267
|
-
primary: KeyMod.WinCtrl | KeyCode.KeyL
|
|
269
|
+
primary: KeyMod.WinCtrl | KeyCode.KeyL
|
|
268
270
|
},
|
|
269
271
|
weight: KeybindingWeight.WorkbenchContrib
|
|
270
|
-
}
|
|
272
|
+
}
|
|
271
273
|
});
|
|
272
274
|
}
|
|
273
275
|
async runWithContext(accessor, context) {
|
|
@@ -278,72 +280,72 @@ registerAction2(class extends NotebookCellAction {
|
|
|
278
280
|
constructor() {
|
|
279
281
|
super({
|
|
280
282
|
id: NOTEBOOK_CURSOR_PAGEUP_COMMAND_ID,
|
|
281
|
-
title: ( localize(
|
|
282
|
-
keybinding: [
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
}
|
|
288
|
-
]
|
|
283
|
+
title: ( localize(9632, "Cell Cursor Page Up")),
|
|
284
|
+
keybinding: [{
|
|
285
|
+
when: ( ContextKeyExpr.and(NOTEBOOK_EDITOR_FOCUSED, ( ContextKeyExpr.has(InputFocusedContextKey)), EditorContextKeys.editorTextFocus)),
|
|
286
|
+
primary: KeyCode.PageUp,
|
|
287
|
+
weight: NOTEBOOK_EDITOR_WIDGET_ACTION_WEIGHT
|
|
288
|
+
}]
|
|
289
289
|
});
|
|
290
290
|
}
|
|
291
291
|
async runWithContext(accessor, context) {
|
|
292
|
-
EditorExtensionsRegistry.getEditorCommand(
|
|
292
|
+
EditorExtensionsRegistry.getEditorCommand("cursorPageUp").runCommand(accessor, {
|
|
293
|
+
pageSize: getPageSize(context)
|
|
294
|
+
});
|
|
293
295
|
}
|
|
294
296
|
});
|
|
295
297
|
registerAction2(class extends NotebookCellAction {
|
|
296
298
|
constructor() {
|
|
297
299
|
super({
|
|
298
300
|
id: NOTEBOOK_CURSOR_PAGEUP_SELECT_COMMAND_ID,
|
|
299
|
-
title: ( localize(
|
|
300
|
-
keybinding: [
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
}
|
|
306
|
-
]
|
|
301
|
+
title: ( localize(9633, "Cell Cursor Page Up Select")),
|
|
302
|
+
keybinding: [{
|
|
303
|
+
when: ( ContextKeyExpr.and(NOTEBOOK_EDITOR_FOCUSED, ( ContextKeyExpr.has(InputFocusedContextKey)), EditorContextKeys.editorTextFocus, ( NOTEBOOK_OUTPUT_FOCUSED.negate()))),
|
|
304
|
+
primary: KeyMod.Shift | KeyCode.PageUp,
|
|
305
|
+
weight: NOTEBOOK_EDITOR_WIDGET_ACTION_WEIGHT
|
|
306
|
+
}]
|
|
307
307
|
});
|
|
308
308
|
}
|
|
309
309
|
async runWithContext(accessor, context) {
|
|
310
|
-
EditorExtensionsRegistry.getEditorCommand(
|
|
310
|
+
EditorExtensionsRegistry.getEditorCommand("cursorPageUpSelect").runCommand(accessor, {
|
|
311
|
+
pageSize: getPageSize(context)
|
|
312
|
+
});
|
|
311
313
|
}
|
|
312
314
|
});
|
|
313
315
|
registerAction2(class extends NotebookCellAction {
|
|
314
316
|
constructor() {
|
|
315
317
|
super({
|
|
316
318
|
id: NOTEBOOK_CURSOR_PAGEDOWN_COMMAND_ID,
|
|
317
|
-
title: ( localize(
|
|
318
|
-
keybinding: [
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
}
|
|
324
|
-
]
|
|
319
|
+
title: ( localize(9634, "Cell Cursor Page Down")),
|
|
320
|
+
keybinding: [{
|
|
321
|
+
when: ( ContextKeyExpr.and(NOTEBOOK_EDITOR_FOCUSED, ( ContextKeyExpr.has(InputFocusedContextKey)), EditorContextKeys.editorTextFocus)),
|
|
322
|
+
primary: KeyCode.PageDown,
|
|
323
|
+
weight: NOTEBOOK_EDITOR_WIDGET_ACTION_WEIGHT
|
|
324
|
+
}]
|
|
325
325
|
});
|
|
326
326
|
}
|
|
327
327
|
async runWithContext(accessor, context) {
|
|
328
|
-
EditorExtensionsRegistry.getEditorCommand(
|
|
328
|
+
EditorExtensionsRegistry.getEditorCommand("cursorPageDown").runCommand(accessor, {
|
|
329
|
+
pageSize: getPageSize(context)
|
|
330
|
+
});
|
|
329
331
|
}
|
|
330
332
|
});
|
|
331
333
|
registerAction2(class extends NotebookCellAction {
|
|
332
334
|
constructor() {
|
|
333
335
|
super({
|
|
334
336
|
id: NOTEBOOK_CURSOR_PAGEDOWN_SELECT_COMMAND_ID,
|
|
335
|
-
title: ( localize(
|
|
336
|
-
keybinding: [
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
}
|
|
342
|
-
]
|
|
337
|
+
title: ( localize(9635, "Cell Cursor Page Down Select")),
|
|
338
|
+
keybinding: [{
|
|
339
|
+
when: ( ContextKeyExpr.and(NOTEBOOK_EDITOR_FOCUSED, ( ContextKeyExpr.has(InputFocusedContextKey)), EditorContextKeys.editorTextFocus, ( NOTEBOOK_OUTPUT_FOCUSED.negate()))),
|
|
340
|
+
primary: KeyMod.Shift | KeyCode.PageDown,
|
|
341
|
+
weight: NOTEBOOK_EDITOR_WIDGET_ACTION_WEIGHT
|
|
342
|
+
}]
|
|
343
343
|
});
|
|
344
344
|
}
|
|
345
345
|
async runWithContext(accessor, context) {
|
|
346
|
-
EditorExtensionsRegistry.getEditorCommand(
|
|
346
|
+
EditorExtensionsRegistry.getEditorCommand("cursorPageDownSelect").runCommand(accessor, {
|
|
347
|
+
pageSize: getPageSize(context)
|
|
348
|
+
});
|
|
347
349
|
}
|
|
348
350
|
});
|
|
349
351
|
function getPageSize(context) {
|
|
@@ -353,15 +355,15 @@ function getPageSize(context) {
|
|
|
353
355
|
return Math.max(1, Math.floor((layoutInfo?.height || 0) / lineHeight) - 2);
|
|
354
356
|
}
|
|
355
357
|
( Registry.as(Extensions.Configuration)).registerConfiguration({
|
|
356
|
-
id:
|
|
358
|
+
id: "notebook",
|
|
357
359
|
order: 100,
|
|
358
|
-
type:
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
type:
|
|
360
|
+
type: "object",
|
|
361
|
+
"properties": {
|
|
362
|
+
"notebook.navigation.allowNavigateToSurroundingCells": {
|
|
363
|
+
type: "boolean",
|
|
362
364
|
default: true,
|
|
363
365
|
markdownDescription: ( localize(
|
|
364
|
-
|
|
366
|
+
9636,
|
|
365
367
|
"When enabled cursor can navigate to the next/previous cell when the current cursor in the cell editor is at the first/last line."
|
|
366
368
|
))
|
|
367
369
|
}
|