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