@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
|
@@ -43,9 +43,9 @@ import { REPL_EDITOR_ID, NotebookSetting, NotebookWorkingCopyTypeIdentifier, Cel
|
|
|
43
43
|
import { MOST_RECENT_REPL_EDITOR, IS_COMPOSITE_NOTEBOOK, NOTEBOOK_CELL_LIST_FOCUSED, NOTEBOOK_EDITOR_FOCUSED } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookContextKeys';
|
|
44
44
|
import { INotebookEditorModelResolverService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookEditorModelResolverService.service';
|
|
45
45
|
import { INotebookService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookService.service';
|
|
46
|
-
import { ReplEditor, isReplEditorControl } from '@codingame/monaco-vscode-
|
|
46
|
+
import { ReplEditor, isReplEditorControl } from '@codingame/monaco-vscode-katex-common/vscode/vs/workbench/contrib/replNotebook/browser/replEditor';
|
|
47
47
|
import { ReplEditorInputAccessibilityHelp, ReplEditorHistoryAccessibilityHelp } from './replEditorAccessibilityHelp.js';
|
|
48
|
-
import { ReplEditorInput } from '@codingame/monaco-vscode-
|
|
48
|
+
import { ReplEditorInput } from '@codingame/monaco-vscode-katex-common/vscode/vs/workbench/contrib/replNotebook/browser/replEditorInput';
|
|
49
49
|
|
|
50
50
|
class ReplEditorSerializer {
|
|
51
51
|
canSerialize(input) {
|
|
@@ -67,80 +67,123 @@ class ReplEditorSerializer {
|
|
|
67
67
|
if (!data) {
|
|
68
68
|
return undefined;
|
|
69
69
|
}
|
|
70
|
-
const {
|
|
71
|
-
|
|
70
|
+
const {
|
|
71
|
+
resource,
|
|
72
|
+
viewType
|
|
73
|
+
} = data;
|
|
74
|
+
if (!data || !URI.isUri(resource) || typeof viewType !== "string") {
|
|
72
75
|
return undefined;
|
|
73
76
|
}
|
|
74
77
|
const input = instantiationService.createInstance(ReplEditorInput, resource, data.label);
|
|
75
78
|
return input;
|
|
76
79
|
}
|
|
77
80
|
}
|
|
78
|
-
( Registry.as(EditorExtensions.EditorPane)).registerEditorPane(
|
|
79
|
-
(
|
|
80
|
-
]
|
|
81
|
+
( Registry.as(EditorExtensions.EditorPane)).registerEditorPane(
|
|
82
|
+
EditorPaneDescriptor.create(ReplEditor, REPL_EDITOR_ID, "REPL Editor"),
|
|
83
|
+
[( new SyncDescriptor(ReplEditorInput))]
|
|
84
|
+
);
|
|
81
85
|
( Registry.as(EditorExtensions.EditorFactory)).registerEditorSerializer(ReplEditorInput.ID, ReplEditorSerializer);
|
|
82
86
|
let ReplDocumentContribution = class ReplDocumentContribution extends Disposable {
|
|
83
|
-
static {
|
|
84
|
-
|
|
87
|
+
static {
|
|
88
|
+
this.ID = "workbench.contrib.replDocument";
|
|
89
|
+
}
|
|
90
|
+
constructor(
|
|
91
|
+
notebookService,
|
|
92
|
+
editorResolverService,
|
|
93
|
+
notebookEditorModelResolverService,
|
|
94
|
+
instantiationService,
|
|
95
|
+
configurationService
|
|
96
|
+
) {
|
|
85
97
|
super();
|
|
86
98
|
this.notebookEditorModelResolverService = notebookEditorModelResolverService;
|
|
87
99
|
this.instantiationService = instantiationService;
|
|
88
100
|
this.configurationService = configurationService;
|
|
89
101
|
this.editorInputCache = ( new ResourceMap());
|
|
90
102
|
editorResolverService.registerEditor(
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
103
|
+
` `,
|
|
104
|
+
{
|
|
105
|
+
id: "repl",
|
|
106
|
+
label: "repl Editor",
|
|
107
|
+
priority: RegisteredEditorPriority.option
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
canSupportResource: uri => notebookService.getNotebookTextModel(uri) !== undefined,
|
|
111
|
+
singlePerResource: true
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
createUntitledEditorInput: async (
|
|
115
|
+
{
|
|
116
|
+
resource,
|
|
117
|
+
options
|
|
104
118
|
}
|
|
105
|
-
|
|
106
|
-
|
|
119
|
+
) => {
|
|
120
|
+
if (resource) {
|
|
121
|
+
const editor = this.editorInputCache.get(resource);
|
|
122
|
+
if (editor && !editor.isDisposed()) {
|
|
123
|
+
return {
|
|
124
|
+
editor,
|
|
125
|
+
options
|
|
126
|
+
};
|
|
127
|
+
} else if (editor) {
|
|
128
|
+
this.editorInputCache.delete(resource);
|
|
129
|
+
}
|
|
107
130
|
}
|
|
131
|
+
const scratchpad = this.configurationService.getValue(NotebookSetting.InteractiveWindowPromptToSave) !== true;
|
|
132
|
+
const ref = await this.notebookEditorModelResolverService.resolve({
|
|
133
|
+
untitledResource: resource
|
|
134
|
+
}, "jupyter-notebook", {
|
|
135
|
+
scratchpad,
|
|
136
|
+
viewType: "repl"
|
|
137
|
+
});
|
|
138
|
+
const notebookUri = ref.object.notebook.uri;
|
|
139
|
+
Event.once(ref.object.notebook.onWillDispose)(() => {
|
|
140
|
+
ref.dispose();
|
|
141
|
+
});
|
|
142
|
+
const label = options?.label ?? undefined;
|
|
143
|
+
const editor = this.instantiationService.createInstance(ReplEditorInput, notebookUri, label);
|
|
144
|
+
this.editorInputCache.set(notebookUri, editor);
|
|
145
|
+
Event.once(editor.onWillDispose)(() => this.editorInputCache.delete(notebookUri));
|
|
146
|
+
return {
|
|
147
|
+
editor,
|
|
148
|
+
options
|
|
149
|
+
};
|
|
150
|
+
},
|
|
151
|
+
createEditorInput: async (
|
|
152
|
+
{
|
|
153
|
+
resource,
|
|
154
|
+
options
|
|
155
|
+
}
|
|
156
|
+
) => {
|
|
157
|
+
if (( this.editorInputCache.has(resource))) {
|
|
158
|
+
return {
|
|
159
|
+
editor: this.editorInputCache.get(resource),
|
|
160
|
+
options
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
const label = options?.label ?? undefined;
|
|
164
|
+
const editor = this.instantiationService.createInstance(ReplEditorInput, resource, label);
|
|
165
|
+
this.editorInputCache.set(resource, editor);
|
|
166
|
+
Event.once(editor.onWillDispose)(() => this.editorInputCache.delete(resource));
|
|
167
|
+
return {
|
|
168
|
+
editor,
|
|
169
|
+
options
|
|
170
|
+
};
|
|
108
171
|
}
|
|
109
|
-
const scratchpad = this.configurationService.getValue(NotebookSetting.InteractiveWindowPromptToSave) !== true;
|
|
110
|
-
const ref = await this.notebookEditorModelResolverService.resolve({ untitledResource: resource }, 'jupyter-notebook', { scratchpad, viewType: 'repl' });
|
|
111
|
-
const notebookUri = ref.object.notebook.uri;
|
|
112
|
-
Event.once(ref.object.notebook.onWillDispose)(() => {
|
|
113
|
-
ref.dispose();
|
|
114
|
-
});
|
|
115
|
-
const label = options?.label ?? undefined;
|
|
116
|
-
const editor = this.instantiationService.createInstance(ReplEditorInput, notebookUri, label);
|
|
117
|
-
this.editorInputCache.set(notebookUri, editor);
|
|
118
|
-
Event.once(editor.onWillDispose)(() => this.editorInputCache.delete(notebookUri));
|
|
119
|
-
return { editor, options };
|
|
120
|
-
},
|
|
121
|
-
createEditorInput: async ({ resource, options }) => {
|
|
122
|
-
if (( this.editorInputCache.has(resource))) {
|
|
123
|
-
return { editor: this.editorInputCache.get(resource), options };
|
|
124
|
-
}
|
|
125
|
-
const label = options?.label ?? undefined;
|
|
126
|
-
const editor = this.instantiationService.createInstance(ReplEditorInput, resource, label);
|
|
127
|
-
this.editorInputCache.set(resource, editor);
|
|
128
|
-
Event.once(editor.onWillDispose)(() => this.editorInputCache.delete(resource));
|
|
129
|
-
return { editor, options };
|
|
130
172
|
}
|
|
131
|
-
|
|
173
|
+
);
|
|
132
174
|
}
|
|
133
175
|
};
|
|
134
|
-
ReplDocumentContribution = ( __decorate([
|
|
135
|
-
( __param(0, INotebookService)),
|
|
136
|
-
( __param(1, IEditorResolverService)),
|
|
137
|
-
( __param(2, INotebookEditorModelResolverService)),
|
|
138
|
-
( __param(3, IInstantiationService)),
|
|
139
|
-
( __param(4, IConfigurationService))
|
|
140
|
-
], ReplDocumentContribution));
|
|
176
|
+
ReplDocumentContribution = ( __decorate([( __param(0, INotebookService)), ( __param(1, IEditorResolverService)), ( __param(2, INotebookEditorModelResolverService)), ( __param(3, IInstantiationService)), ( __param(4, IConfigurationService))], ReplDocumentContribution));
|
|
141
177
|
let ReplWindowWorkingCopyEditorHandler = class ReplWindowWorkingCopyEditorHandler extends Disposable {
|
|
142
|
-
static {
|
|
143
|
-
|
|
178
|
+
static {
|
|
179
|
+
this.ID = "workbench.contrib.replWorkingCopyEditorHandler";
|
|
180
|
+
}
|
|
181
|
+
constructor(
|
|
182
|
+
instantiationService,
|
|
183
|
+
workingCopyEditorService,
|
|
184
|
+
extensionService,
|
|
185
|
+
notebookService
|
|
186
|
+
) {
|
|
144
187
|
super();
|
|
145
188
|
this.instantiationService = instantiationService;
|
|
146
189
|
this.workingCopyEditorService = workingCopyEditorService;
|
|
@@ -153,7 +196,7 @@ let ReplWindowWorkingCopyEditorHandler = class ReplWindowWorkingCopyEditorHandle
|
|
|
153
196
|
if (!notebookType) {
|
|
154
197
|
return false;
|
|
155
198
|
}
|
|
156
|
-
return !!notebookType && notebookType.viewType ===
|
|
199
|
+
return !!notebookType && notebookType.viewType === "repl" && (await this.notebookService.canResolve(notebookType.notebookType));
|
|
157
200
|
}
|
|
158
201
|
isOpen(workingCopy, editor) {
|
|
159
202
|
if (!this.handles(workingCopy)) {
|
|
@@ -172,31 +215,34 @@ let ReplWindowWorkingCopyEditorHandler = class ReplWindowWorkingCopyEditorHandle
|
|
|
172
215
|
return NotebookWorkingCopyTypeIdentifier.parse(workingCopy.typeId);
|
|
173
216
|
}
|
|
174
217
|
};
|
|
175
|
-
ReplWindowWorkingCopyEditorHandler = ( __decorate([
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
registerWorkbenchContribution2(
|
|
182
|
-
|
|
218
|
+
ReplWindowWorkingCopyEditorHandler = ( __decorate([( __param(0, IInstantiationService)), ( __param(1, IWorkingCopyEditorService)), ( __param(2, IExtensionService)), ( __param(3, INotebookService))], ReplWindowWorkingCopyEditorHandler));
|
|
219
|
+
registerWorkbenchContribution2(
|
|
220
|
+
ReplWindowWorkingCopyEditorHandler.ID,
|
|
221
|
+
ReplWindowWorkingCopyEditorHandler,
|
|
222
|
+
WorkbenchPhase.BlockRestore
|
|
223
|
+
);
|
|
224
|
+
registerWorkbenchContribution2(
|
|
225
|
+
ReplDocumentContribution.ID,
|
|
226
|
+
ReplDocumentContribution,
|
|
227
|
+
WorkbenchPhase.BlockRestore
|
|
228
|
+
);
|
|
183
229
|
AccessibleViewRegistry.register(( new ReplEditorInputAccessibilityHelp()));
|
|
184
230
|
AccessibleViewRegistry.register(( new ReplEditorHistoryAccessibilityHelp()));
|
|
185
231
|
registerAction2(class extends Action2 {
|
|
186
232
|
constructor() {
|
|
187
233
|
super({
|
|
188
|
-
id:
|
|
189
|
-
title: ( localize2(
|
|
190
|
-
category:
|
|
234
|
+
id: "repl.focusLastItemExecuted",
|
|
235
|
+
title: ( localize2(10734, "Focus Most Recent REPL Execution")),
|
|
236
|
+
category: "REPL",
|
|
191
237
|
menu: {
|
|
192
238
|
id: MenuId.CommandPalette,
|
|
193
|
-
when: MOST_RECENT_REPL_EDITOR
|
|
239
|
+
when: MOST_RECENT_REPL_EDITOR
|
|
194
240
|
},
|
|
195
241
|
keybinding: [{
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
242
|
+
primary: KeyChord(KeyMod.Alt | KeyCode.End, KeyMod.Alt | KeyCode.End),
|
|
243
|
+
weight: NOTEBOOK_EDITOR_WIDGET_ACTION_WEIGHT,
|
|
244
|
+
when: ( ContextKeyExpr.or(IS_COMPOSITE_NOTEBOOK, ( NOTEBOOK_CELL_LIST_FOCUSED.negate())))
|
|
245
|
+
}],
|
|
200
246
|
precondition: MOST_RECENT_REPL_EDITOR
|
|
201
247
|
});
|
|
202
248
|
}
|
|
@@ -207,8 +253,7 @@ registerAction2(class extends Action2 {
|
|
|
207
253
|
let notebookEditor;
|
|
208
254
|
if (editorControl && isReplEditorControl(editorControl)) {
|
|
209
255
|
notebookEditor = editorControl.notebookEditor;
|
|
210
|
-
}
|
|
211
|
-
else {
|
|
256
|
+
} else {
|
|
212
257
|
const uriString = MOST_RECENT_REPL_EDITOR.getValue(contextKeyService);
|
|
213
258
|
const uri = uriString ? ( URI.parse(uriString)) : undefined;
|
|
214
259
|
if (!uri) {
|
|
@@ -228,7 +273,7 @@ registerAction2(class extends Action2 {
|
|
|
228
273
|
const lastCellIndex = viewModel.length - 1;
|
|
229
274
|
if (lastCellIndex >= 0) {
|
|
230
275
|
const cell = viewModel.viewCells[lastCellIndex];
|
|
231
|
-
notebookEditor.focusNotebookCell(cell,
|
|
276
|
+
notebookEditor.focusNotebookCell(cell, "container");
|
|
232
277
|
}
|
|
233
278
|
}
|
|
234
279
|
}
|
|
@@ -236,22 +281,22 @@ registerAction2(class extends Action2 {
|
|
|
236
281
|
registerAction2(class extends Action2 {
|
|
237
282
|
constructor() {
|
|
238
283
|
super({
|
|
239
|
-
id:
|
|
240
|
-
title: ( localize2(
|
|
241
|
-
category:
|
|
284
|
+
id: "repl.input.focus",
|
|
285
|
+
title: ( localize2(10735, "Focus Input Editor")),
|
|
286
|
+
category: "REPL",
|
|
242
287
|
menu: {
|
|
243
288
|
id: MenuId.CommandPalette,
|
|
244
|
-
when: MOST_RECENT_REPL_EDITOR
|
|
289
|
+
when: MOST_RECENT_REPL_EDITOR
|
|
245
290
|
},
|
|
246
291
|
keybinding: [{
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
292
|
+
when: ( ContextKeyExpr.and(IS_COMPOSITE_NOTEBOOK, NOTEBOOK_EDITOR_FOCUSED)),
|
|
293
|
+
weight: NOTEBOOK_EDITOR_WIDGET_ACTION_WEIGHT,
|
|
294
|
+
primary: KeyMod.CtrlCmd | KeyCode.DownArrow
|
|
295
|
+
}, {
|
|
296
|
+
when: ( ContextKeyExpr.and(MOST_RECENT_REPL_EDITOR)),
|
|
297
|
+
weight: KeybindingWeight.WorkbenchContrib + 5,
|
|
298
|
+
primary: KeyChord(KeyMod.Alt | KeyCode.Home, KeyMod.Alt | KeyCode.Home)
|
|
299
|
+
}]
|
|
255
300
|
});
|
|
256
301
|
}
|
|
257
302
|
async run(accessor) {
|
|
@@ -260,8 +305,7 @@ registerAction2(class extends Action2 {
|
|
|
260
305
|
const contextKeyService = accessor.get(IContextKeyService);
|
|
261
306
|
if (editorControl && isReplEditorControl(editorControl) && editorControl.notebookEditor) {
|
|
262
307
|
editorService.activeEditorPane?.focus();
|
|
263
|
-
}
|
|
264
|
-
else {
|
|
308
|
+
} else {
|
|
265
309
|
const uriString = MOST_RECENT_REPL_EDITOR.getValue(contextKeyService);
|
|
266
310
|
const uri = uriString ? ( URI.parse(uriString)) : undefined;
|
|
267
311
|
if (!uri) {
|
|
@@ -269,7 +313,12 @@ registerAction2(class extends Action2 {
|
|
|
269
313
|
}
|
|
270
314
|
const replEditor = editorService.findEditors(uri)[0];
|
|
271
315
|
if (replEditor) {
|
|
272
|
-
await editorService.openEditor({
|
|
316
|
+
await editorService.openEditor({
|
|
317
|
+
resource: uri,
|
|
318
|
+
options: {
|
|
319
|
+
preserveFocus: false
|
|
320
|
+
}
|
|
321
|
+
}, replEditor.groupId);
|
|
273
322
|
}
|
|
274
323
|
}
|
|
275
324
|
}
|
|
@@ -277,38 +326,34 @@ registerAction2(class extends Action2 {
|
|
|
277
326
|
registerAction2(class extends Action2 {
|
|
278
327
|
constructor() {
|
|
279
328
|
super({
|
|
280
|
-
id:
|
|
281
|
-
title: ( localize2(
|
|
282
|
-
category:
|
|
329
|
+
id: "repl.execute",
|
|
330
|
+
title: ( localize2(10736, "Execute REPL input")),
|
|
331
|
+
category: "REPL",
|
|
283
332
|
keybinding: [{
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
menu: [
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
}
|
|
300
|
-
],
|
|
333
|
+
when: ( ContextKeyExpr.and(IS_COMPOSITE_NOTEBOOK, ( ContextKeyExpr.equals("activeEditor", "workbench.editor.repl")), ( NOTEBOOK_CELL_LIST_FOCUSED.negate()))),
|
|
334
|
+
primary: KeyMod.CtrlCmd | KeyCode.Enter,
|
|
335
|
+
weight: NOTEBOOK_EDITOR_WIDGET_ACTION_WEIGHT
|
|
336
|
+
}, {
|
|
337
|
+
when: ( ContextKeyExpr.and(IS_COMPOSITE_NOTEBOOK, ( ContextKeyExpr.equals("activeEditor", "workbench.editor.repl")), ( ContextKeyExpr.equals("config.interactiveWindow.executeWithShiftEnter", true)), ( NOTEBOOK_CELL_LIST_FOCUSED.negate()))),
|
|
338
|
+
primary: KeyMod.Shift | KeyCode.Enter,
|
|
339
|
+
weight: NOTEBOOK_EDITOR_WIDGET_ACTION_WEIGHT
|
|
340
|
+
}, {
|
|
341
|
+
when: ( ContextKeyExpr.and(IS_COMPOSITE_NOTEBOOK, ( ContextKeyExpr.equals("activeEditor", "workbench.editor.repl")), ( ContextKeyExpr.equals("config.interactiveWindow.executeWithShiftEnter", false)), ( NOTEBOOK_CELL_LIST_FOCUSED.negate()))),
|
|
342
|
+
primary: KeyCode.Enter,
|
|
343
|
+
weight: NOTEBOOK_EDITOR_WIDGET_ACTION_WEIGHT
|
|
344
|
+
}],
|
|
345
|
+
menu: [{
|
|
346
|
+
id: MenuId.ReplInputExecute
|
|
347
|
+
}],
|
|
301
348
|
icon: executeIcon,
|
|
302
349
|
f1: false,
|
|
303
350
|
metadata: {
|
|
304
|
-
description:
|
|
305
|
-
args: [
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
}
|
|
311
|
-
]
|
|
351
|
+
description: "Execute the Contents of the Input Box",
|
|
352
|
+
args: [{
|
|
353
|
+
name: "resource",
|
|
354
|
+
description: "Interactive resource Uri",
|
|
355
|
+
isOptional: true
|
|
356
|
+
}]
|
|
312
357
|
}
|
|
313
358
|
});
|
|
314
359
|
}
|
|
@@ -328,8 +373,7 @@ registerAction2(class extends Action2 {
|
|
|
328
373
|
break;
|
|
329
374
|
}
|
|
330
375
|
}
|
|
331
|
-
}
|
|
332
|
-
else {
|
|
376
|
+
} else {
|
|
333
377
|
editorControl = editorService.activeEditorPane?.getControl();
|
|
334
378
|
}
|
|
335
379
|
if (isReplEditorControl(editorControl)) {
|
|
@@ -354,34 +398,36 @@ async function executeReplInput(bulkEditService, historyService, notebookEditorS
|
|
|
354
398
|
ctrl.acceptSession();
|
|
355
399
|
}
|
|
356
400
|
historyService.replaceLast(notebookDocument.uri, value);
|
|
357
|
-
historyService.addToHistory(notebookDocument.uri,
|
|
358
|
-
textModel.setValue(
|
|
401
|
+
historyService.addToHistory(notebookDocument.uri, "");
|
|
402
|
+
textModel.setValue("");
|
|
359
403
|
notebookDocument.cells[index].resetTextBuffer(textModel.getTextBuffer());
|
|
360
|
-
const collapseState = editorControl.notebookEditor.notebookOptions.getDisplayOptions().interactiveWindowCollapseCodeCells ===
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
const range = { start: index, end: index + 1 };
|
|
404
|
+
const collapseState = editorControl.notebookEditor.notebookOptions.getDisplayOptions().interactiveWindowCollapseCodeCells === "fromEditor" ? {
|
|
405
|
+
inputCollapsed: false,
|
|
406
|
+
outputCollapsed: false
|
|
407
|
+
} : undefined;
|
|
408
|
+
await bulkEditService.apply([( new ResourceNotebookCellEdit(notebookDocument.uri, {
|
|
409
|
+
editType: CellEditType.Replace,
|
|
410
|
+
index: index,
|
|
411
|
+
count: 0,
|
|
412
|
+
cells: [{
|
|
413
|
+
cellKind: CellKind.Code,
|
|
414
|
+
mime: undefined,
|
|
415
|
+
language,
|
|
416
|
+
source: value,
|
|
417
|
+
outputs: [],
|
|
418
|
+
metadata: {},
|
|
419
|
+
collapseState
|
|
420
|
+
}]
|
|
421
|
+
}))]);
|
|
422
|
+
const range = {
|
|
423
|
+
start: index,
|
|
424
|
+
end: index + 1
|
|
425
|
+
};
|
|
383
426
|
editorControl.notebookEditor.revealCellRangeInView(range);
|
|
384
|
-
await editorControl.notebookEditor.executeNotebookCells(editorControl.notebookEditor.getCellsInRange({
|
|
427
|
+
await editorControl.notebookEditor.executeNotebookCells(editorControl.notebookEditor.getCellsInRange({
|
|
428
|
+
start: index,
|
|
429
|
+
end: index + 1
|
|
430
|
+
}));
|
|
385
431
|
const editor = notebookEditorService.getNotebookEditor(editorControl.notebookEditor.getId());
|
|
386
432
|
if (editor) {
|
|
387
433
|
editor.setSelections([range]);
|
|
@@ -392,12 +438,12 @@ async function executeReplInput(bulkEditService, historyService, notebookEditorS
|
|
|
392
438
|
}
|
|
393
439
|
AccessibleViewRegistry.register(( new ReplEditorAccessibleView()));
|
|
394
440
|
KeybindingsRegistry.registerCommandAndKeybindingRule({
|
|
395
|
-
id:
|
|
441
|
+
id: "list.find.replInputFocus",
|
|
396
442
|
weight: KeybindingWeight.WorkbenchContrib + 1,
|
|
397
|
-
when: ( ContextKeyExpr.equals(
|
|
443
|
+
when: ( ContextKeyExpr.equals("view", REPL_VIEW_ID)),
|
|
398
444
|
primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.KeyF,
|
|
399
445
|
secondary: [KeyCode.F3],
|
|
400
|
-
handler:
|
|
446
|
+
handler: accessor => {
|
|
401
447
|
getReplView(accessor.get(IViewsService))?.openFind();
|
|
402
448
|
}
|
|
403
449
|
});
|
|
@@ -9,7 +9,7 @@ import { IS_COMPOSITE_NOTEBOOK, NOTEBOOK_CELL_LIST_FOCUSED } from '@codingame/mo
|
|
|
9
9
|
class ReplEditorInputAccessibilityHelp {
|
|
10
10
|
constructor() {
|
|
11
11
|
this.priority = 105;
|
|
12
|
-
this.name =
|
|
12
|
+
this.name = "REPL Editor Input";
|
|
13
13
|
this.when = ( ContextKeyExpr.and(IS_COMPOSITE_NOTEBOOK, ( NOTEBOOK_CELL_LIST_FOCUSED.negate())));
|
|
14
14
|
this.type = AccessibleViewType.Help;
|
|
15
15
|
}
|
|
@@ -18,45 +18,37 @@ class ReplEditorInputAccessibilityHelp {
|
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
function getAccessibilityInputHelpText() {
|
|
21
|
-
return [
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
)),
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
)),
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
'<keybinding:editor.action.accessibleView>'
|
|
48
|
-
)),
|
|
49
|
-
( localize(
|
|
50
|
-
10426,
|
|
51
|
-
'The Focus Input Editor command{0} will bring the focus back to this editor.',
|
|
52
|
-
'<keybinding:repl.input.focus>'
|
|
53
|
-
)),
|
|
54
|
-
].join('\n');
|
|
21
|
+
return [( localize(
|
|
22
|
+
10738,
|
|
23
|
+
"You are in a REPL Editor Input box which will accept code to be executed in the REPL."
|
|
24
|
+
)), ( localize(
|
|
25
|
+
10739,
|
|
26
|
+
"The Execute command{0} will evaluate the expression in the input box.",
|
|
27
|
+
"<keybinding:repl.execute>"
|
|
28
|
+
)), ( localize(
|
|
29
|
+
10740,
|
|
30
|
+
"The setting `accessibility.replEditor.readLastExecutionOutput` controls if output will be automatically read when execution completes."
|
|
31
|
+
)), ( localize(
|
|
32
|
+
10741,
|
|
33
|
+
"The setting `accessibility.replEditor.autoFocusReplExecution` controls if focus will automatically move to the REPL after executing code."
|
|
34
|
+
)), ( localize(
|
|
35
|
+
10742,
|
|
36
|
+
"The Focus Last executed command{0} will move focus to the last executed item in the REPL history.",
|
|
37
|
+
"<keybinding:repl.focusLastItemExecuted>"
|
|
38
|
+
)), ( localize(
|
|
39
|
+
10743,
|
|
40
|
+
"When you run the Open Accessbility View command{0} from this input box, the output from the last execution will be shown in the accessibility view.",
|
|
41
|
+
"<keybinding:editor.action.accessibleView>"
|
|
42
|
+
)), ( localize(
|
|
43
|
+
10744,
|
|
44
|
+
"The Focus Input Editor command{0} will bring the focus back to this editor.",
|
|
45
|
+
"<keybinding:repl.input.focus>"
|
|
46
|
+
))].join("\n");
|
|
55
47
|
}
|
|
56
48
|
class ReplEditorHistoryAccessibilityHelp {
|
|
57
49
|
constructor() {
|
|
58
50
|
this.priority = 105;
|
|
59
|
-
this.name =
|
|
51
|
+
this.name = "REPL Editor History";
|
|
60
52
|
this.when = ( ContextKeyExpr.and(IS_COMPOSITE_NOTEBOOK, NOTEBOOK_CELL_LIST_FOCUSED));
|
|
61
53
|
this.type = AccessibleViewType.Help;
|
|
62
54
|
}
|
|
@@ -65,56 +57,43 @@ class ReplEditorHistoryAccessibilityHelp {
|
|
|
65
57
|
}
|
|
66
58
|
}
|
|
67
59
|
function getAccessibilityHistoryHelpText() {
|
|
68
|
-
return [
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
'
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
)),
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
'<keybinding:repl.input.focus>'
|
|
97
|
-
)),
|
|
98
|
-
( localize(
|
|
99
|
-
10424,
|
|
100
|
-
'The Focus Last executed command{0} will move focus to the last executed item in the REPL history.',
|
|
101
|
-
'<keybinding:repl.focusLastItemExecuted>'
|
|
102
|
-
)),
|
|
103
|
-
].join('\n');
|
|
60
|
+
return [( localize(
|
|
61
|
+
10745,
|
|
62
|
+
"You are in a REPL History which is a list of cells that have been executed in the REPL. Each cell has an input, an output, and the cell container."
|
|
63
|
+
)), ( localize(
|
|
64
|
+
10746,
|
|
65
|
+
"The Edit Cell command{0} will move focus to the read-only editor for the input of the cell.",
|
|
66
|
+
"<keybinding:notebook.cell.edit>"
|
|
67
|
+
)), ( localize(
|
|
68
|
+
10747,
|
|
69
|
+
"The Quit Edit command{0} will move focus to the cell container, where the up and down arrows will also move focus between cells in the history.",
|
|
70
|
+
"<keybinding:notebook.cell.quitEdit>"
|
|
71
|
+
)), ( localize(
|
|
72
|
+
10748,
|
|
73
|
+
"Run the Open Accessbility View command{0} while navigating the history for an accessible view of the item's output.",
|
|
74
|
+
"<keybinding:editor.action.accessibleView>"
|
|
75
|
+
)), ( localize(
|
|
76
|
+
10749,
|
|
77
|
+
"The Focus Output command{0} will set focus on the output when focused on a previously executed item.",
|
|
78
|
+
"<keybinding:notebook.cell.focusInOutput>"
|
|
79
|
+
)), ( localize(
|
|
80
|
+
10750,
|
|
81
|
+
"The Focus Input Editor command{0} will move focus to the REPL input box.",
|
|
82
|
+
"<keybinding:repl.input.focus>"
|
|
83
|
+
)), ( localize(
|
|
84
|
+
10742,
|
|
85
|
+
"The Focus Last executed command{0} will move focus to the last executed item in the REPL history.",
|
|
86
|
+
"<keybinding:repl.focusLastItemExecuted>"
|
|
87
|
+
))].join("\n");
|
|
104
88
|
}
|
|
105
89
|
function getAccessibilityHelpProvider(editorService, helpText) {
|
|
106
|
-
const activeEditor = editorService.getActiveCodeEditor()
|
|
107
|
-
|| editorService.getFocusedCodeEditor();
|
|
90
|
+
const activeEditor = editorService.getActiveCodeEditor() || editorService.getFocusedCodeEditor();
|
|
108
91
|
if (!activeEditor) {
|
|
109
92
|
return;
|
|
110
93
|
}
|
|
111
|
-
return ( new AccessibleContentProvider(
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
() => helpText,
|
|
115
|
-
() => activeEditor.focus(),
|
|
116
|
-
AccessibilityVerbositySettingId.ReplEditor
|
|
117
|
-
));
|
|
94
|
+
return ( new AccessibleContentProvider(AccessibleViewProviderId.ReplEditor, {
|
|
95
|
+
type: AccessibleViewType.Help
|
|
96
|
+
}, () => helpText, () => activeEditor.focus(), AccessibilityVerbositySettingId.ReplEditor));
|
|
118
97
|
}
|
|
119
98
|
|
|
120
99
|
export { ReplEditorHistoryAccessibilityHelp, ReplEditorInputAccessibilityHelp };
|