@codingame/monaco-vscode-notebook-service-override 37.1.0 → 37.3.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 +7 -2
- package/package.json +3 -3
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebook.d.ts +22 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebook.js +210 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookDocuments.d.ts +24 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookDocuments.js +140 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookDocumentsAndEditors.d.ts +29 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookDocumentsAndEditors.js +194 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookEditors.d.ts +27 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookEditors.js +149 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookKernels.d.ts +49 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookKernels.js +372 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookRenderers.d.ts +10 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookRenderers.js +26 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookSaveParticipant.d.ts +9 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadNotebookSaveParticipant.js +43 -0
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/emptyTextEditorHint/emptyTextEditorHint.js +9 -9
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellCommands/cellCommands.js +24 -24
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellDiagnostics/cellDiagnosticsActions.js +4 -4
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellDiagnostics/diagnosticCellStatusBarContrib.js +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/contributedStatusBarItemController.js +5 -5
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/statusBarProviders.js +3 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/clipboard/notebookClipboard.js +19 -19
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/debug/notebookDebugDecorations.js +7 -7
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/editorStatusBar/editorStatusBar.js +9 -9
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFind.js +6 -6
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/format/formatting.js +9 -9
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/gettingStarted/notebookGettingStarted.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/layout/layoutActions.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/multicursor/notebookMulticursor.js +32 -19
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/multicursor/notebookSelectionHighlight.js +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/navigation/arrow.js +13 -13
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookInlineVariables.js +4 -4
- 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 +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesDataSource.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesTree.js +3 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/outline/notebookOutline.js +14 -14
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/profile/notebookProfile.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/saveParticipants/saveParticipants.js +30 -30
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/troubleshoot/layout.js +5 -5
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/apiActions.js +11 -14
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/editActions.js +38 -38
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/executeActions.js +30 -26
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/layoutActions.js +21 -21
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/notebookIndentationActions.js +11 -11
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/sectionActions.js +12 -12
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/variablesActions.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffActions.js +24 -24
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookMultiDiffEditor.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookMultiDiffEditor.js +7 -7
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookMultiDiffEditorInput.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebook.contribution.js +68 -68
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookAccessibilityHelp.js +10 -10
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookExtensionPoint.js +35 -35
- package/vscode/src/vs/workbench/contrib/notebook/browser/outputEditor/notebookOutputEditor.js +4 -4
- package/vscode/src/vs/workbench/contrib/notebook/browser/outputEditor/notebookOutputEditorInput.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/replEditorAccessibleView.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookCellStatusBarServiceImpl.js +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookEditorServiceImpl.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookExecutionServiceImpl.js +8 -5
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookExecutionStateServiceImpl.js +4 -4
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKernelHistoryServiceImpl.js +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKernelServiceImpl.js +7 -7
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKeymapServiceImpl.js +15 -12
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookLoggingServiceImpl.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookRendererMessagingServiceImpl.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookServiceImpl.js +9 -9
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookWorkerServiceImpl.js +8 -8
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookOutlineEntryFactory.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookTextModel.js +26 -26
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorModel.d.ts +87 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorModel.js +352 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorModelResolverServiceImpl.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookOutputRenderer.js +3 -3
- package/vscode/src/vs/workbench/contrib/notebook/common/services/notebookWebWorker.js +44 -18
- package/vscode/src/vs/workbench/contrib/replNotebook/browser/repl.contribution.js +5 -5
- package/vscode/src/vs/workbench/contrib/replNotebook/browser/replEditorAccessibilityHelp.js +14 -14
- package/vscode/src/vs/workbench/services/workingCopy/common/abstractFileWorkingCopyManager.js +2 -2
- package/vscode/src/vs/workbench/services/workingCopy/common/fileWorkingCopyManager.js +12 -12
- package/vscode/src/vs/workbench/services/workingCopy/common/storedFileWorkingCopyManager.js +5 -5
|
@@ -28,7 +28,7 @@ const NotebookPreloadContribution = ( Object.freeze({
|
|
|
28
28
|
localResourceRoots: "localResourceRoots"
|
|
29
29
|
}));
|
|
30
30
|
const notebookProviderContribution = {
|
|
31
|
-
description: ( localize(
|
|
31
|
+
description: ( localize(16884, "Contributes notebook document provider.")),
|
|
32
32
|
type: "array",
|
|
33
33
|
defaultSnippets: [{
|
|
34
34
|
body: [{
|
|
@@ -49,25 +49,25 @@ const notebookProviderContribution = {
|
|
|
49
49
|
properties: {
|
|
50
50
|
[NotebookEditorContribution.type]: {
|
|
51
51
|
type: "string",
|
|
52
|
-
description: ( localize(
|
|
52
|
+
description: ( localize(16885, "Type of the notebook."))
|
|
53
53
|
},
|
|
54
54
|
[NotebookEditorContribution.displayName]: {
|
|
55
55
|
type: "string",
|
|
56
|
-
description: ( localize(
|
|
56
|
+
description: ( localize(16886, "Human readable name of the notebook."))
|
|
57
57
|
},
|
|
58
58
|
[NotebookEditorContribution.selector]: {
|
|
59
59
|
type: "array",
|
|
60
|
-
description: ( localize(
|
|
60
|
+
description: ( localize(16887, "Set of globs that the notebook is for.")),
|
|
61
61
|
items: {
|
|
62
62
|
type: "object",
|
|
63
63
|
properties: {
|
|
64
64
|
filenamePattern: {
|
|
65
65
|
type: "string",
|
|
66
|
-
description: ( localize(
|
|
66
|
+
description: ( localize(16888, "Glob that the notebook is enabled for."))
|
|
67
67
|
},
|
|
68
68
|
excludeFileNamePattern: {
|
|
69
69
|
type: "string",
|
|
70
|
-
description: ( localize(
|
|
70
|
+
description: ( localize(16889, "Glob that the notebook is disabled for."))
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
}
|
|
@@ -75,15 +75,15 @@ const notebookProviderContribution = {
|
|
|
75
75
|
[NotebookEditorContribution.priority]: {
|
|
76
76
|
type: "string",
|
|
77
77
|
markdownDeprecationMessage: ( localize(
|
|
78
|
-
|
|
78
|
+
16890,
|
|
79
79
|
"Controls if the custom editor is enabled automatically when the user opens a file. This may be overridden by users using the `workbench.editorAssociations` setting."
|
|
80
80
|
)),
|
|
81
81
|
enum: [NotebookEditorPriority.default, NotebookEditorPriority.option],
|
|
82
82
|
markdownEnumDescriptions: [( localize(
|
|
83
|
-
|
|
83
|
+
16891,
|
|
84
84
|
"The editor is automatically used when the user opens a resource, provided that no other default custom editors are registered for that resource."
|
|
85
85
|
)), ( localize(
|
|
86
|
-
|
|
86
|
+
16892,
|
|
87
87
|
"The editor is not automatically used when the user opens a resource, but a user can switch to the editor using the `Reopen With` command."
|
|
88
88
|
))],
|
|
89
89
|
default: "default"
|
|
@@ -98,7 +98,7 @@ const defaultRendererSnippet = ( Object.freeze({
|
|
|
98
98
|
entrypoint: ""
|
|
99
99
|
}));
|
|
100
100
|
const notebookRendererContribution = {
|
|
101
|
-
description: ( localize(
|
|
101
|
+
description: ( localize(16893, "Contributes notebook output renderer provider.")),
|
|
102
102
|
type: "array",
|
|
103
103
|
defaultSnippets: [{
|
|
104
104
|
body: [defaultRendererSnippet]
|
|
@@ -113,11 +113,11 @@ const notebookRendererContribution = {
|
|
|
113
113
|
properties: {
|
|
114
114
|
[NotebookRendererContribution.id]: {
|
|
115
115
|
type: "string",
|
|
116
|
-
description: ( localize(
|
|
116
|
+
description: ( localize(16894, "Unique identifier of the notebook output renderer."))
|
|
117
117
|
},
|
|
118
118
|
[NotebookRendererContribution.displayName]: {
|
|
119
119
|
type: "string",
|
|
120
|
-
description: ( localize(
|
|
120
|
+
description: ( localize(16895, "Human readable name of the notebook output renderer."))
|
|
121
121
|
},
|
|
122
122
|
[NotebookRendererContribution.hardDependencies]: {
|
|
123
123
|
type: "array",
|
|
@@ -126,7 +126,7 @@ const notebookRendererContribution = {
|
|
|
126
126
|
type: "string"
|
|
127
127
|
},
|
|
128
128
|
markdownDescription: ( localize(
|
|
129
|
-
|
|
129
|
+
16896,
|
|
130
130
|
"List of kernel dependencies the renderer requires. If any of the dependencies are present in the `NotebookKernel.preloads`, the renderer can be used."
|
|
131
131
|
))
|
|
132
132
|
},
|
|
@@ -137,7 +137,7 @@ const notebookRendererContribution = {
|
|
|
137
137
|
type: "string"
|
|
138
138
|
},
|
|
139
139
|
markdownDescription: ( localize(
|
|
140
|
-
|
|
140
|
+
16897,
|
|
141
141
|
"List of soft kernel dependencies the renderer can make use of. If any of the dependencies are present in the `NotebookKernel.preloads`, the renderer will be preferred over renderers that don't interact with the kernel."
|
|
142
142
|
))
|
|
143
143
|
},
|
|
@@ -145,14 +145,14 @@ const notebookRendererContribution = {
|
|
|
145
145
|
default: "never",
|
|
146
146
|
enum: ["always", "optional", "never"],
|
|
147
147
|
enumDescriptions: [( localize(
|
|
148
|
-
|
|
148
|
+
16898,
|
|
149
149
|
"Messaging is required. The renderer will only be used when it's part of an extension that can be run in an extension host."
|
|
150
150
|
)), ( localize(
|
|
151
|
-
|
|
151
|
+
16899,
|
|
152
152
|
"The renderer is better with messaging available, but it's not required."
|
|
153
|
-
)), ( localize(
|
|
153
|
+
)), ( localize(16900, "The renderer does not require messaging."))],
|
|
154
154
|
description: ( localize(
|
|
155
|
-
|
|
155
|
+
16901,
|
|
156
156
|
"Defines how and if the renderer needs to communicate with an extension host, via `createRendererMessaging`. Renderers with stronger messaging requirements may not work in all environments."
|
|
157
157
|
))
|
|
158
158
|
}
|
|
@@ -166,13 +166,13 @@ const notebookRendererContribution = {
|
|
|
166
166
|
properties: {
|
|
167
167
|
[NotebookRendererContribution.mimeTypes]: {
|
|
168
168
|
type: "array",
|
|
169
|
-
description: ( localize(
|
|
169
|
+
description: ( localize(16902, "Set of globs that the notebook is for.")),
|
|
170
170
|
items: {
|
|
171
171
|
type: "string"
|
|
172
172
|
}
|
|
173
173
|
},
|
|
174
174
|
[NotebookRendererContribution.entrypoint]: {
|
|
175
|
-
description: ( localize(
|
|
175
|
+
description: ( localize(16903, "File to load in the webview to render the extension.")),
|
|
176
176
|
type: "string"
|
|
177
177
|
}
|
|
178
178
|
}
|
|
@@ -180,17 +180,17 @@ const notebookRendererContribution = {
|
|
|
180
180
|
required: [NotebookRendererContribution.entrypoint],
|
|
181
181
|
properties: {
|
|
182
182
|
[NotebookRendererContribution.entrypoint]: {
|
|
183
|
-
description: ( localize(
|
|
183
|
+
description: ( localize(16903, "File to load in the webview to render the extension.")),
|
|
184
184
|
type: "object",
|
|
185
185
|
required: ["extends", "path"],
|
|
186
186
|
properties: {
|
|
187
187
|
extends: {
|
|
188
188
|
type: "string",
|
|
189
|
-
description: ( localize(
|
|
189
|
+
description: ( localize(16904, "Existing renderer that this one extends."))
|
|
190
190
|
},
|
|
191
191
|
path: {
|
|
192
192
|
type: "string",
|
|
193
|
-
description: ( localize(
|
|
193
|
+
description: ( localize(16903, "File to load in the webview to render the extension."))
|
|
194
194
|
}
|
|
195
195
|
}
|
|
196
196
|
}
|
|
@@ -200,7 +200,7 @@ const notebookRendererContribution = {
|
|
|
200
200
|
}
|
|
201
201
|
};
|
|
202
202
|
const notebookPreloadContribution = {
|
|
203
|
-
description: ( localize(
|
|
203
|
+
description: ( localize(16905, "Contributes notebook preloads.")),
|
|
204
204
|
type: "array",
|
|
205
205
|
defaultSnippets: [{
|
|
206
206
|
body: [{
|
|
@@ -214,11 +214,11 @@ const notebookPreloadContribution = {
|
|
|
214
214
|
properties: {
|
|
215
215
|
[NotebookPreloadContribution.type]: {
|
|
216
216
|
type: "string",
|
|
217
|
-
description: ( localize(
|
|
217
|
+
description: ( localize(16906, "Type of the notebook."))
|
|
218
218
|
},
|
|
219
219
|
[NotebookPreloadContribution.entrypoint]: {
|
|
220
220
|
type: "string",
|
|
221
|
-
description: ( localize(
|
|
221
|
+
description: ( localize(16907, "Path to file loaded in the webview."))
|
|
222
222
|
},
|
|
223
223
|
[NotebookPreloadContribution.localResourceRoots]: {
|
|
224
224
|
type: "array",
|
|
@@ -226,7 +226,7 @@ const notebookPreloadContribution = {
|
|
|
226
226
|
type: "string"
|
|
227
227
|
},
|
|
228
228
|
description: ( localize(
|
|
229
|
-
|
|
229
|
+
16908,
|
|
230
230
|
"Paths to additional resources that should be allowed in the webview."
|
|
231
231
|
))
|
|
232
232
|
}
|
|
@@ -278,10 +278,10 @@ class NotebooksDataRenderer extends Disposable {
|
|
|
278
278
|
dispose: () => {}
|
|
279
279
|
};
|
|
280
280
|
}
|
|
281
|
-
const headers = [( localize(
|
|
282
|
-
const rows =
|
|
281
|
+
const headers = [( localize(16909, "ID")), ( localize(16910, "Name"))];
|
|
282
|
+
const rows = contrib.sort((a, b) => a.type.localeCompare(b.type)).map(notebook => {
|
|
283
283
|
return [notebook.type, notebook.displayName];
|
|
284
|
-
})
|
|
284
|
+
});
|
|
285
285
|
return {
|
|
286
286
|
data: {
|
|
287
287
|
headers,
|
|
@@ -310,10 +310,10 @@ class NotebookRenderersDataRenderer extends Disposable {
|
|
|
310
310
|
dispose: () => {}
|
|
311
311
|
};
|
|
312
312
|
}
|
|
313
|
-
const headers = [( localize(
|
|
314
|
-
const rows =
|
|
313
|
+
const headers = [( localize(16911, "Name")), ( localize(16912, "Mimetypes"))];
|
|
314
|
+
const rows = contrib.sort((a, b) => a.displayName.localeCompare(b.displayName)).map(notebookRenderer => {
|
|
315
315
|
return [notebookRenderer.displayName, notebookRenderer.mimeTypes.join(",")];
|
|
316
|
-
})
|
|
316
|
+
});
|
|
317
317
|
return {
|
|
318
318
|
data: {
|
|
319
319
|
headers,
|
|
@@ -325,7 +325,7 @@ class NotebookRenderersDataRenderer extends Disposable {
|
|
|
325
325
|
}
|
|
326
326
|
( Registry.as(Extensions.ExtensionFeaturesRegistry)).registerExtensionFeature({
|
|
327
327
|
id: "notebooks",
|
|
328
|
-
label: ( localize(
|
|
328
|
+
label: ( localize(16913, "Notebooks")),
|
|
329
329
|
access: {
|
|
330
330
|
canToggle: false
|
|
331
331
|
},
|
|
@@ -333,7 +333,7 @@ class NotebookRenderersDataRenderer extends Disposable {
|
|
|
333
333
|
});
|
|
334
334
|
( Registry.as(Extensions.ExtensionFeaturesRegistry)).registerExtensionFeature({
|
|
335
335
|
id: "notebookRenderer",
|
|
336
|
-
label: ( localize(
|
|
336
|
+
label: ( localize(16914, "Notebook Renderers")),
|
|
337
337
|
access: {
|
|
338
338
|
canToggle: false
|
|
339
339
|
},
|
package/vscode/src/vs/workbench/contrib/notebook/browser/outputEditor/notebookOutputEditor.js
CHANGED
|
@@ -142,7 +142,7 @@ let NotebookOutputEditor = class NotebookOutputEditor extends EditorPane {
|
|
|
142
142
|
if (this.input) {
|
|
143
143
|
return this.input.getName();
|
|
144
144
|
}
|
|
145
|
-
return localize(
|
|
145
|
+
return localize(16944, "Notebook Output Editor");
|
|
146
146
|
}
|
|
147
147
|
async setInput(input, options, context, token) {
|
|
148
148
|
await super.setInput(input, options, context, token);
|
|
@@ -202,13 +202,13 @@ let NotebookOutputEditor = class NotebookOutputEditor extends EditorPane {
|
|
|
202
202
|
}
|
|
203
203
|
_renderMissingRenderer(viewModel, preferredMimeType) {
|
|
204
204
|
if (!viewModel.model.outputs.length) {
|
|
205
|
-
return this._renderMessage(viewModel, ( localize(
|
|
205
|
+
return this._renderMessage(viewModel, ( localize(16945, "Cell has no output")));
|
|
206
206
|
}
|
|
207
207
|
if (!preferredMimeType) {
|
|
208
|
-
const mimeTypes =
|
|
208
|
+
const mimeTypes = viewModel.model.outputs.map(op => op.mime);
|
|
209
209
|
const mimeTypesMessage = mimeTypes.join(", ");
|
|
210
210
|
return this._renderMessage(viewModel, ( localize(
|
|
211
|
-
|
|
211
|
+
16946,
|
|
212
212
|
"No renderer could be found for output. It has the following mimetypes: {0}",
|
|
213
213
|
mimeTypesMessage
|
|
214
214
|
)));
|
package/vscode/src/vs/workbench/contrib/notebook/browser/outputEditor/notebookOutputEditorInput.js
CHANGED
|
@@ -81,7 +81,7 @@ let NotebookOutputEditorInput = class NotebookOutputEditorInput extends EditorIn
|
|
|
81
81
|
};
|
|
82
82
|
}
|
|
83
83
|
getName() {
|
|
84
|
-
return localize(
|
|
84
|
+
return localize(16947, "Notebook Output Preview");
|
|
85
85
|
}
|
|
86
86
|
get editorId() {
|
|
87
87
|
return "notebookOutputEditor";
|
|
@@ -3,7 +3,7 @@ import { AccessibleViewType, AccessibleContentProvider, AccessibleViewProviderId
|
|
|
3
3
|
import { ContextKeyExpr } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey';
|
|
4
4
|
import { IEditorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service';
|
|
5
5
|
import { AccessibilityVerbositySettingId } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/accessibility/browser/accessibilityConfiguration';
|
|
6
|
-
import { isReplEditorControl } from '@codingame/monaco-vscode-
|
|
6
|
+
import { isReplEditorControl } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/replNotebook/browser/replEditor';
|
|
7
7
|
import { IS_COMPOSITE_NOTEBOOK, NOTEBOOK_CELL_LIST_FOCUSED } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookContextKeys';
|
|
8
8
|
import { getAllOutputsText } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/browser/viewModel/cellOutputTextHelper';
|
|
9
9
|
|
|
@@ -27,7 +27,7 @@ class NotebookCellStatusBarService extends Disposable {
|
|
|
27
27
|
}
|
|
28
28
|
async getStatusBarItemsForCell(docUri, cellIndex, viewType, token) {
|
|
29
29
|
const providers = this._providers.filter(p => p.viewType === viewType || p.viewType === "*");
|
|
30
|
-
return await Promise.all(
|
|
30
|
+
return await Promise.all(providers.map(async p => {
|
|
31
31
|
try {
|
|
32
32
|
return (await p.provideCellStatusBarItems(docUri, cellIndex, token)) ?? {
|
|
33
33
|
items: []
|
|
@@ -38,7 +38,7 @@ class NotebookCellStatusBarService extends Disposable {
|
|
|
38
38
|
items: []
|
|
39
39
|
};
|
|
40
40
|
}
|
|
41
|
-
}))
|
|
41
|
+
}));
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
|
package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookEditorServiceImpl.js
CHANGED
|
@@ -245,7 +245,7 @@ let NotebookEditorWidgetService = class NotebookEditorWidgetService {
|
|
|
245
245
|
return this._notebookEditors.get(editorId);
|
|
246
246
|
}
|
|
247
247
|
listNotebookEditors() {
|
|
248
|
-
return
|
|
248
|
+
return [...this._notebookEditors].map(e => e[1]);
|
|
249
249
|
}
|
|
250
250
|
getNotebookForPossibleCell(candidate) {
|
|
251
251
|
for (const editor of ( this._notebookEditors.values())) {
|
package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookExecutionServiceImpl.js
CHANGED
|
@@ -32,8 +32,8 @@ let NotebookExecutionService = class NotebookExecutionService {
|
|
|
32
32
|
if (!cellsArr.length) {
|
|
33
33
|
return;
|
|
34
34
|
}
|
|
35
|
-
this._logService.debug(`Execution`, `${JSON.stringify(
|
|
36
|
-
const message = ( localize(
|
|
35
|
+
this._logService.debug(`Execution`, `${JSON.stringify(cellsArr.map(c => c.handle))}`);
|
|
36
|
+
const message = ( localize(16948, "Executing a notebook cell will run code from this workspace."));
|
|
37
37
|
const trust = await this._workspaceTrustRequestService.requestWorkspaceTrust({
|
|
38
38
|
message
|
|
39
39
|
});
|
|
@@ -73,16 +73,19 @@ let NotebookExecutionService = class NotebookExecutionService {
|
|
|
73
73
|
if (validCellExecutions.length > 0) {
|
|
74
74
|
await this.runExecutionParticipants(validCellExecutions);
|
|
75
75
|
this._notebookKernelService.selectKernelForNotebook(kernel, notebook);
|
|
76
|
-
await kernel.executeNotebookCellsRequest(notebook.uri,
|
|
76
|
+
await kernel.executeNotebookCellsRequest(notebook.uri, validCellExecutions.map(c => c.cellHandle));
|
|
77
77
|
const unconfirmed = validCellExecutions.filter(exe => exe.state === NotebookCellExecutionState.Unconfirmed);
|
|
78
78
|
if (unconfirmed.length) {
|
|
79
79
|
this._logService.debug(
|
|
80
80
|
`Execution`,
|
|
81
|
-
`Completing unconfirmed executions ${JSON.stringify(
|
|
81
|
+
`Completing unconfirmed executions ${JSON.stringify(unconfirmed.map(exe => exe.cellHandle))}`
|
|
82
82
|
);
|
|
83
83
|
unconfirmed.forEach(exe => exe.complete({}));
|
|
84
84
|
}
|
|
85
|
-
this._logService.debug(
|
|
85
|
+
this._logService.debug(
|
|
86
|
+
`Execution`,
|
|
87
|
+
`Completed executions ${JSON.stringify(validCellExecutions.map(exe => exe.cellHandle))}`
|
|
88
|
+
);
|
|
86
89
|
}
|
|
87
90
|
}
|
|
88
91
|
async cancelNotebookCellHandles(notebook, cells) {
|
|
@@ -320,7 +320,7 @@ let NotebookExecutionListeners = class NotebookExecutionListeners extends Dispos
|
|
|
320
320
|
cancelAll() {
|
|
321
321
|
this._logService.debug(`NotebookExecutionListeners#cancelAll`);
|
|
322
322
|
const exes = this._notebookExecutionStateService.getCellExecutionsForNotebook(this._notebookModel.uri);
|
|
323
|
-
this._notebookExecutionService.cancelNotebookCellHandles(this._notebookModel,
|
|
323
|
+
this._notebookExecutionService.cancelNotebookCellHandles(this._notebookModel, exes.map(exe => exe.cellHandle));
|
|
324
324
|
}
|
|
325
325
|
onWillDisposeDocument() {
|
|
326
326
|
this._logService.debug(`NotebookExecution#onWillDisposeDocument`);
|
|
@@ -333,7 +333,7 @@ let NotebookExecutionListeners = class NotebookExecutionListeners extends Dispos
|
|
|
333
333
|
if (notebookExes) {
|
|
334
334
|
e.rawEvent.changes.forEach(([start, deleteCount]) => {
|
|
335
335
|
if (deleteCount) {
|
|
336
|
-
const deletedHandles =
|
|
336
|
+
const deletedHandles = this._notebookModel.cells.slice(start, start + deleteCount).map(c => c.handle);
|
|
337
337
|
deletedHandles.forEach(h => {
|
|
338
338
|
const exe = notebookExes.get(h);
|
|
339
339
|
if (exe?.state === NotebookCellExecutionState.Executing) {
|
|
@@ -438,7 +438,7 @@ let CellExecution = class CellExecution extends Disposable {
|
|
|
438
438
|
return `${( this._notebookModel.uri.toString())}, ${this.cellHandle}`;
|
|
439
439
|
}
|
|
440
440
|
logUpdates(updates) {
|
|
441
|
-
const updateTypes =
|
|
441
|
+
const updateTypes = updates.map(u => CellExecutionUpdateType[u.editType]).join(", ");
|
|
442
442
|
this._logService.debug(`CellExecution#updateExecution ${this.getCellLog()}, [${updateTypes}]`);
|
|
443
443
|
}
|
|
444
444
|
confirm() {
|
|
@@ -464,7 +464,7 @@ let CellExecution = class CellExecution extends Disposable {
|
|
|
464
464
|
if (!cellModel) {
|
|
465
465
|
this._logService.debug(`CellExecution#update, updating cell not in notebook: ${( this._notebookModel.uri.toString())}, ${this.cellHandle}`);
|
|
466
466
|
} else {
|
|
467
|
-
const edits =
|
|
467
|
+
const edits = updates.map(update => updateToEdit(update, this.cellHandle));
|
|
468
468
|
this._applyExecutionEdits(edits);
|
|
469
469
|
}
|
|
470
470
|
if (( updates.some(u => u.editType === CellExecutionUpdateType.ExecutionState))) {
|
|
@@ -45,7 +45,7 @@ let NotebookKernelHistoryService = class NotebookKernelHistoryService extends Di
|
|
|
45
45
|
`getMatchingKernels: ${allAvailableKernels.all.length} kernels available for ${notebook.uri.path}. Selected: ${allAvailableKernels.selected?.label}. Suggested: ${suggested?.label}`
|
|
46
46
|
);
|
|
47
47
|
const mostRecentKernelIds = this._mostRecentKernelsMap[notebook.notebookType] ? [...( this._mostRecentKernelsMap[notebook.notebookType].values())] : [];
|
|
48
|
-
const all =
|
|
48
|
+
const all = mostRecentKernelIds.map(kernelId => allKernels.find(kernel => kernel.id === kernelId)).filter(kernel => !!kernel);
|
|
49
49
|
this._notebookLoggingService.debug(
|
|
50
50
|
"History",
|
|
51
51
|
`mru: ${mostRecentKernelIds.length} kernels in history, ${all.length} registered already.`
|
|
@@ -126,7 +126,7 @@ registerAction2(class extends Action2 {
|
|
|
126
126
|
constructor() {
|
|
127
127
|
super({
|
|
128
128
|
id: "notebook.clearNotebookKernelsMRUCache",
|
|
129
|
-
title: ( localize2(
|
|
129
|
+
title: ( localize2(16949, "Clear Notebook Kernels MRU Cache")),
|
|
130
130
|
category: Categories.Developer,
|
|
131
131
|
f1: true
|
|
132
132
|
});
|
package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKernelServiceImpl.js
CHANGED
|
@@ -211,11 +211,11 @@ let NotebookKernelService = class NotebookKernelService extends Disposable {
|
|
|
211
211
|
kernels.sort(
|
|
212
212
|
(a, b) => b.instanceAffinity - a.instanceAffinity || a.score - b.score || a.kernel.label.localeCompare(b.kernel.label)
|
|
213
213
|
);
|
|
214
|
-
const all =
|
|
214
|
+
const all = kernels.map(obj => obj.kernel);
|
|
215
215
|
const selectedId = this._notebookBindings.get(NotebookTextModelLikeId.str(notebook));
|
|
216
216
|
const selected = selectedId ? this._kernels.get(selectedId)?.kernel : undefined;
|
|
217
|
-
const suggestions =
|
|
218
|
-
const hidden =
|
|
217
|
+
const suggestions = kernels.filter(item => item.instanceAffinity > 1).map(item => item.kernel);
|
|
218
|
+
const hidden = kernels.filter(item => item.instanceAffinity < 0).map(item => item.kernel);
|
|
219
219
|
return {
|
|
220
220
|
all,
|
|
221
221
|
selected,
|
|
@@ -277,7 +277,7 @@ let NotebookKernelService = class NotebookKernelService extends Disposable {
|
|
|
277
277
|
const id = NotebookTextModelLikeId.str(notebook);
|
|
278
278
|
const existingInfo = this._kernelSources.get(id);
|
|
279
279
|
if (existingInfo) {
|
|
280
|
-
return
|
|
280
|
+
return existingInfo.actions.filter(action => action[0].execution).map(action => action[0]);
|
|
281
281
|
}
|
|
282
282
|
return [];
|
|
283
283
|
}
|
|
@@ -286,7 +286,7 @@ let NotebookKernelService = class NotebookKernelService extends Disposable {
|
|
|
286
286
|
const id = NotebookTextModelLikeId.str(notebook);
|
|
287
287
|
const existingInfo = this._kernelSources.get(id);
|
|
288
288
|
if (existingInfo) {
|
|
289
|
-
return
|
|
289
|
+
return existingInfo.actions.map(a => a[0]);
|
|
290
290
|
}
|
|
291
291
|
const sourceMenu = this._register(
|
|
292
292
|
this._menuService.createMenu(MenuId.NotebookKernelSource, contextKeyService)
|
|
@@ -325,7 +325,7 @@ let NotebookKernelService = class NotebookKernelService extends Disposable {
|
|
|
325
325
|
loadActionsFromMenu(sourceMenu, notebook);
|
|
326
326
|
}));
|
|
327
327
|
loadActionsFromMenu(sourceMenu, notebook);
|
|
328
|
-
return
|
|
328
|
+
return info.actions.map(a => a[0]);
|
|
329
329
|
}
|
|
330
330
|
registerNotebookKernelDetectionTask(task) {
|
|
331
331
|
const notebookType = task.notebookType;
|
|
@@ -371,7 +371,7 @@ let NotebookKernelService = class NotebookKernelService extends Disposable {
|
|
|
371
371
|
getKernelSourceActions2(notebook) {
|
|
372
372
|
const viewType = notebook.notebookType;
|
|
373
373
|
const providers = this._kernelSourceActionProviders.get(viewType) ?? [];
|
|
374
|
-
const promises =
|
|
374
|
+
const promises = providers.map(provider => provider.provideKernelSourceActions());
|
|
375
375
|
return Promise.all(promises).then(actions => {
|
|
376
376
|
return actions.reduce((a, b) => a.concat(b), []);
|
|
377
377
|
});
|
package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKeymapServiceImpl.js
CHANGED
|
@@ -23,19 +23,22 @@ import Severity from '@codingame/monaco-vscode-api/vscode/vs/base/common/severit
|
|
|
23
23
|
function onExtensionChanged(accessor) {
|
|
24
24
|
const extensionService = accessor.get(IExtensionManagementService);
|
|
25
25
|
const extensionEnablementService = accessor.get(IWorkbenchExtensionEnablementService);
|
|
26
|
-
const onDidInstallExtensions = Event.chain(extensionService.onDidInstallExtensions, $ =>
|
|
26
|
+
const onDidInstallExtensions = Event.chain(extensionService.onDidInstallExtensions, $ => $.filter(e => ( e.some((
|
|
27
27
|
{
|
|
28
28
|
operation
|
|
29
29
|
}
|
|
30
|
-
) => operation === InstallOperation.Install))).map(e =>
|
|
30
|
+
) => operation === InstallOperation.Install))).map(e => e.map((
|
|
31
31
|
{
|
|
32
32
|
identifier
|
|
33
33
|
}
|
|
34
|
-
) => identifier)))
|
|
35
|
-
return Event.debounce(Event.any(Event.any(
|
|
34
|
+
) => identifier)));
|
|
35
|
+
return Event.debounce(Event.any(Event.any(
|
|
36
|
+
onDidInstallExtensions,
|
|
37
|
+
Event.map(extensionService.onDidUninstallExtension, e => [e.identifier])
|
|
38
|
+
), Event.map(
|
|
36
39
|
extensionEnablementService.onEnablementChanged,
|
|
37
|
-
extensions =>
|
|
38
|
-
))
|
|
40
|
+
extensions => extensions.map(e => e.identifier)
|
|
41
|
+
)), (result, identifiers) => {
|
|
39
42
|
result = result || (identifiers.length ? [identifiers[0]] : []);
|
|
40
43
|
for (const identifier of identifiers) {
|
|
41
44
|
if (( result.some(l => !areSameExtensions(l, identifier)))) {
|
|
@@ -63,7 +66,7 @@ let NotebookKeymapService = class NotebookKeymapService extends Disposable {
|
|
|
63
66
|
this._register(lifecycleService.onDidShutdown(() => this.dispose()));
|
|
64
67
|
this._register(
|
|
65
68
|
this.instantiationService.invokeFunction(onExtensionChanged)((identifiers => {
|
|
66
|
-
Promise.all(
|
|
69
|
+
Promise.all(identifiers.map(identifier => this.checkForOtherKeymaps(identifier))).then(undefined, onUnexpectedError);
|
|
67
70
|
}))
|
|
68
71
|
);
|
|
69
72
|
}
|
|
@@ -87,18 +90,18 @@ let NotebookKeymapService = class NotebookKeymapService extends Disposable {
|
|
|
87
90
|
promptForDisablingOtherKeymaps(newKeymap, oldKeymaps) {
|
|
88
91
|
const onPrompt = confirmed => {
|
|
89
92
|
if (confirmed) {
|
|
90
|
-
this.extensionEnablementService.setEnablement(
|
|
93
|
+
this.extensionEnablementService.setEnablement(oldKeymaps.map(keymap => keymap.local), EnablementState.DisabledGlobally);
|
|
91
94
|
}
|
|
92
95
|
};
|
|
93
96
|
this.notificationService.prompt(Severity.Info, ( localize(
|
|
94
|
-
|
|
97
|
+
16950,
|
|
95
98
|
"Disable other keymaps ({0}) to avoid conflicts between keybindings?",
|
|
96
|
-
|
|
99
|
+
distinct(oldKeymaps.map(k => k.local.manifest.displayName)).map(name => `'${name}'`).join(", ")
|
|
97
100
|
)), [{
|
|
98
|
-
label: ( localize(
|
|
101
|
+
label: ( localize(16951, "Yes")),
|
|
99
102
|
run: () => onPrompt(true)
|
|
100
103
|
}, {
|
|
101
|
-
label: ( localize(
|
|
104
|
+
label: ( localize(16952, "No")),
|
|
102
105
|
run: () => onPrompt(false)
|
|
103
106
|
}]);
|
|
104
107
|
}
|
package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookLoggingServiceImpl.js
CHANGED
|
@@ -13,7 +13,7 @@ let NotebookLoggingService = class NotebookLoggingService extends Disposable {
|
|
|
13
13
|
constructor(loggerService) {
|
|
14
14
|
super();
|
|
15
15
|
this._logger = this._register(loggerService.createLogger(logChannelId, {
|
|
16
|
-
name: ( localize(
|
|
16
|
+
name: ( localize(16953, "Notebook")),
|
|
17
17
|
group: windowLogGroup
|
|
18
18
|
}));
|
|
19
19
|
}
|
|
@@ -15,7 +15,7 @@ let NotebookRendererMessagingService = class NotebookRendererMessagingService ex
|
|
|
15
15
|
}
|
|
16
16
|
receiveMessage(editorId, rendererId, message) {
|
|
17
17
|
if (editorId === undefined) {
|
|
18
|
-
const sends =
|
|
18
|
+
const sends = [...( this.scopedMessaging.values())].map(e => e.receiveMessageHandler?.(rendererId, message));
|
|
19
19
|
return Promise.all(sends).then(s => ( s.some(s => !!s)));
|
|
20
20
|
}
|
|
21
21
|
return this.scopedMessaging.get(editorId)?.receiveMessageHandler?.(rendererId, message) ?? Promise.resolve(false);
|
|
@@ -446,7 +446,7 @@ let NotebookOutputRendererInfoStore = class NotebookOutputRendererInfoStore {
|
|
|
446
446
|
const preferred = notebookProviderInfo && this.preferredMimetype.value[notebookProviderInfo.id]?.[mimeType];
|
|
447
447
|
const notebookExtId = notebookProviderInfo?.extension?.value;
|
|
448
448
|
const notebookId = notebookProviderInfo?.id;
|
|
449
|
-
const renderers =
|
|
449
|
+
const renderers = Array.from(( this.contributedRenderers.values())).map(renderer => {
|
|
450
450
|
const ownScore = kernelProvides === undefined ? renderer.matchesWithoutKernel(mimeType) : renderer.matches(mimeType, kernelProvides);
|
|
451
451
|
if (ownScore === NotebookRendererMatch.Never) {
|
|
452
452
|
return undefined;
|
|
@@ -461,7 +461,7 @@ let NotebookOutputRendererInfoStore = class NotebookOutputRendererInfoStore {
|
|
|
461
461
|
},
|
|
462
462
|
score: reuseScore | ownScore
|
|
463
463
|
};
|
|
464
|
-
})
|
|
464
|
+
}).filter(isDefined);
|
|
465
465
|
if (renderers.length === 0) {
|
|
466
466
|
return [{
|
|
467
467
|
mimeType,
|
|
@@ -469,7 +469,7 @@ let NotebookOutputRendererInfoStore = class NotebookOutputRendererInfoStore {
|
|
|
469
469
|
isTrusted: true
|
|
470
470
|
}];
|
|
471
471
|
}
|
|
472
|
-
return
|
|
472
|
+
return renderers.sort((a, b) => a.score - b.score).map(r => r.ordered);
|
|
473
473
|
}
|
|
474
474
|
};
|
|
475
475
|
NotebookOutputRendererInfoStore = ( __decorate([( __param(0, IStorageService))], NotebookOutputRendererInfoStore));
|
|
@@ -610,11 +610,11 @@ let NotebookService = class NotebookService extends Disposable {
|
|
|
610
610
|
this._viewTypeCache = this._memento.getMemento(StorageScope.WORKSPACE, StorageTarget.MACHINE);
|
|
611
611
|
}
|
|
612
612
|
getEditorTypes() {
|
|
613
|
-
return
|
|
613
|
+
return [...this.notebookProviderInfoStore].map(info => ({
|
|
614
614
|
id: info.id,
|
|
615
615
|
displayName: info.displayName,
|
|
616
616
|
providerDisplayName: info.providerDisplayName
|
|
617
|
-
}))
|
|
617
|
+
}));
|
|
618
618
|
}
|
|
619
619
|
clearEditorCache() {
|
|
620
620
|
this.notebookProviderInfoStore.clearEditorCache();
|
|
@@ -675,7 +675,7 @@ let NotebookService = class NotebookService extends Disposable {
|
|
|
675
675
|
const knownProvider = this.getViewTypeProvider(viewType);
|
|
676
676
|
const actions = knownProvider ? [toAction({
|
|
677
677
|
id: "workbench.notebook.action.installMissingViewType",
|
|
678
|
-
label: ( localize(
|
|
678
|
+
label: ( localize(16954, "Install extension for '{0}'", viewType)),
|
|
679
679
|
run: async () => {
|
|
680
680
|
await this._instantiationService.createInstance(InstallRecommendedExtensionAction, knownProvider).run();
|
|
681
681
|
}
|
|
@@ -796,10 +796,10 @@ let NotebookService = class NotebookService extends Disposable {
|
|
|
796
796
|
return this._models.get(uri)?.model;
|
|
797
797
|
}
|
|
798
798
|
getNotebookTextModels() {
|
|
799
|
-
return
|
|
799
|
+
return Iterable.map(( this._models.values()), data => data.model);
|
|
800
800
|
}
|
|
801
801
|
listNotebookDocuments() {
|
|
802
|
-
return
|
|
802
|
+
return [...this._models].map(e => e[1].model);
|
|
803
803
|
}
|
|
804
804
|
_onWillDisposeDocument(model) {
|
|
805
805
|
const modelData = this._models.get(model.uri);
|
|
@@ -812,7 +812,7 @@ let NotebookService = class NotebookService extends Disposable {
|
|
|
812
812
|
}
|
|
813
813
|
}
|
|
814
814
|
getOutputMimeTypeInfo(textModel, kernelProvides, output) {
|
|
815
|
-
const sorted = this._displayOrder.sort(( new Set(
|
|
815
|
+
const sorted = this._displayOrder.sort(( new Set(output.outputs.map(op => op.mime))));
|
|
816
816
|
const notebookProviderInfo = this.notebookProviderInfoStore.get(textModel.viewType);
|
|
817
817
|
return sorted.flatMap(
|
|
818
818
|
mimeType => this._notebookRenderersInfoStore.findBestRenderers(notebookProviderInfo, mimeType, kernelProvides)
|