@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
|
@@ -11,7 +11,9 @@ import { IEditorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench
|
|
|
11
11
|
import { n, createElement } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/dom';
|
|
12
12
|
|
|
13
13
|
class TroubleshootController extends Disposable {
|
|
14
|
-
static {
|
|
14
|
+
static {
|
|
15
|
+
this.id = "workbench.notebook.troubleshoot";
|
|
16
|
+
}
|
|
15
17
|
constructor(_notebookEditor) {
|
|
16
18
|
super();
|
|
17
19
|
this._notebookEditor = _notebookEditor;
|
|
@@ -57,7 +59,7 @@ class TroubleshootController extends Disposable {
|
|
|
57
59
|
this._createCellOverlay(cell, i);
|
|
58
60
|
}
|
|
59
61
|
this._localStore.add(this._notebookEditor.onDidChangeViewCells(e => {
|
|
60
|
-
const addedCells = e.splices.reduce((acc, [
|
|
62
|
+
const addedCells = e.splices.reduce((acc, [,, newCells]) => [...acc, ...newCells], []);
|
|
61
63
|
for (let i = 0; i < addedCells.length; i++) {
|
|
62
64
|
const cellIndex = this._notebookEditor.getCellIndex(addedCells[i]);
|
|
63
65
|
if (cellIndex !== undefined) {
|
|
@@ -74,42 +76,41 @@ class TroubleshootController extends Disposable {
|
|
|
74
76
|
const scrollTop = this._notebookEditor.scrollTop;
|
|
75
77
|
const overlay = n.div({
|
|
76
78
|
style: {
|
|
77
|
-
position:
|
|
78
|
-
top:
|
|
79
|
-
left:
|
|
80
|
-
width:
|
|
81
|
-
height:
|
|
82
|
-
pointerEvents:
|
|
83
|
-
zIndex:
|
|
79
|
+
position: "absolute",
|
|
80
|
+
top: "0",
|
|
81
|
+
left: "0",
|
|
82
|
+
width: "100%",
|
|
83
|
+
height: "100%",
|
|
84
|
+
pointerEvents: "none",
|
|
85
|
+
zIndex: "1000"
|
|
84
86
|
}
|
|
85
87
|
}, [
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
]).keepUpdated(this._store);
|
|
88
|
+
n.div({
|
|
89
|
+
style: {
|
|
90
|
+
position: "absolute",
|
|
91
|
+
top: `${listViewTop}px`,
|
|
92
|
+
left: "0",
|
|
93
|
+
width: "100%",
|
|
94
|
+
height: "2px",
|
|
95
|
+
backgroundColor: "rgba(0, 0, 255, 0.7)"
|
|
96
|
+
}
|
|
97
|
+
}),
|
|
98
|
+
n.div({
|
|
99
|
+
style: {
|
|
100
|
+
position: "absolute",
|
|
101
|
+
top: `${listViewTop}px`,
|
|
102
|
+
left: "10px",
|
|
103
|
+
backgroundColor: "rgba(0, 0, 255, 0.7)",
|
|
104
|
+
color: "white",
|
|
105
|
+
fontSize: "11px",
|
|
106
|
+
fontWeight: "bold",
|
|
107
|
+
padding: "2px 6px",
|
|
108
|
+
borderRadius: "3px",
|
|
109
|
+
whiteSpace: "nowrap",
|
|
110
|
+
pointerEvents: "none",
|
|
111
|
+
zIndex: "1001"
|
|
112
|
+
}
|
|
113
|
+
}, [`ScrollTop: ${scrollTop}px`])]).keepUpdated(this._store);
|
|
113
114
|
this._notebookOverlayDomNode = overlay.element;
|
|
114
115
|
if (this._notebookOverlayDomNode) {
|
|
115
116
|
this._notebookEditor.getDomNode().appendChild(this._notebookOverlayDomNode);
|
|
@@ -118,12 +119,12 @@ class TroubleshootController extends Disposable {
|
|
|
118
119
|
const scrollTop = this._notebookEditor.scrollTop;
|
|
119
120
|
const listViewTop = this._notebookEditor.getLayoutInfo().listViewOffsetTop;
|
|
120
121
|
if (this._notebookOverlayDomNode) {
|
|
121
|
-
const labelElement = this._notebookOverlayDomNode.querySelector(
|
|
122
|
+
const labelElement = this._notebookOverlayDomNode.querySelector("div:nth-child(2)");
|
|
122
123
|
if (labelElement) {
|
|
123
124
|
labelElement.textContent = `ScrollTop: ${scrollTop}px`;
|
|
124
125
|
labelElement.style.top = `${listViewTop}px`;
|
|
125
126
|
}
|
|
126
|
-
const topLineElement = this._notebookOverlayDomNode.querySelector(
|
|
127
|
+
const topLineElement = this._notebookOverlayDomNode.querySelector("div:first-child");
|
|
127
128
|
if (topLineElement) {
|
|
128
129
|
topLineElement.style.top = `${listViewTop}px`;
|
|
129
130
|
}
|
|
@@ -131,47 +132,47 @@ class TroubleshootController extends Disposable {
|
|
|
131
132
|
}));
|
|
132
133
|
}
|
|
133
134
|
_createCellOverlay(cell, index) {
|
|
134
|
-
const overlayContainer = createElement(
|
|
135
|
-
overlayContainer.style.position =
|
|
136
|
-
overlayContainer.style.top =
|
|
137
|
-
overlayContainer.style.left =
|
|
138
|
-
overlayContainer.style.width =
|
|
139
|
-
overlayContainer.style.height =
|
|
140
|
-
overlayContainer.style.pointerEvents =
|
|
141
|
-
overlayContainer.style.zIndex =
|
|
142
|
-
const topLine = createElement(
|
|
143
|
-
topLine.style.position =
|
|
144
|
-
topLine.style.top =
|
|
145
|
-
topLine.style.left =
|
|
146
|
-
topLine.style.width =
|
|
147
|
-
topLine.style.height =
|
|
148
|
-
topLine.style.backgroundColor =
|
|
135
|
+
const overlayContainer = createElement("div");
|
|
136
|
+
overlayContainer.style.position = "absolute";
|
|
137
|
+
overlayContainer.style.top = "0";
|
|
138
|
+
overlayContainer.style.left = "0";
|
|
139
|
+
overlayContainer.style.width = "100%";
|
|
140
|
+
overlayContainer.style.height = "100%";
|
|
141
|
+
overlayContainer.style.pointerEvents = "none";
|
|
142
|
+
overlayContainer.style.zIndex = "1000";
|
|
143
|
+
const topLine = createElement("div");
|
|
144
|
+
topLine.style.position = "absolute";
|
|
145
|
+
topLine.style.top = "0";
|
|
146
|
+
topLine.style.left = "0";
|
|
147
|
+
topLine.style.width = "100%";
|
|
148
|
+
topLine.style.height = "2px";
|
|
149
|
+
topLine.style.backgroundColor = "rgba(255, 0, 0, 0.7)";
|
|
149
150
|
overlayContainer.appendChild(topLine);
|
|
150
151
|
const getLayoutInfo = () => {
|
|
151
|
-
const eol = cell.textBuffer.getEOL() ===
|
|
152
|
-
let scrollTop =
|
|
152
|
+
const eol = cell.textBuffer.getEOL() === "\n" ? "LF" : "CRLF";
|
|
153
|
+
let scrollTop = "";
|
|
153
154
|
if (cell.layoutInfo.layoutState > 0) {
|
|
154
155
|
scrollTop = `| AbsoluteTopOfElement: ${this._notebookEditor.getAbsoluteTopOfElement(cell)}px`;
|
|
155
156
|
}
|
|
156
157
|
return `cell #${index} (handle: ${cell.handle}) ${scrollTop} | EOL: ${eol}`;
|
|
157
158
|
};
|
|
158
|
-
const label = createElement(
|
|
159
|
+
const label = createElement("div");
|
|
159
160
|
label.textContent = getLayoutInfo();
|
|
160
|
-
label.style.position =
|
|
161
|
-
label.style.top =
|
|
162
|
-
label.style.right =
|
|
163
|
-
label.style.backgroundColor =
|
|
164
|
-
label.style.color =
|
|
165
|
-
label.style.fontSize =
|
|
166
|
-
label.style.fontWeight =
|
|
167
|
-
label.style.padding =
|
|
168
|
-
label.style.borderRadius =
|
|
169
|
-
label.style.whiteSpace =
|
|
170
|
-
label.style.pointerEvents =
|
|
171
|
-
label.style.zIndex =
|
|
161
|
+
label.style.position = "absolute";
|
|
162
|
+
label.style.top = "0px";
|
|
163
|
+
label.style.right = "10px";
|
|
164
|
+
label.style.backgroundColor = "rgba(255, 0, 0, 0.5)";
|
|
165
|
+
label.style.color = "white";
|
|
166
|
+
label.style.fontSize = "11px";
|
|
167
|
+
label.style.fontWeight = "bold";
|
|
168
|
+
label.style.padding = "2px 6px";
|
|
169
|
+
label.style.borderRadius = "3px";
|
|
170
|
+
label.style.whiteSpace = "nowrap";
|
|
171
|
+
label.style.pointerEvents = "none";
|
|
172
|
+
label.style.zIndex = "1001";
|
|
172
173
|
overlayContainer.appendChild(label);
|
|
173
174
|
let overlayId = undefined;
|
|
174
|
-
this._notebookEditor.changeCellOverlays(
|
|
175
|
+
this._notebookEditor.changeCellOverlays(accessor => {
|
|
175
176
|
overlayId = accessor.addOverlay({
|
|
176
177
|
cell,
|
|
177
178
|
domNode: overlayContainer
|
|
@@ -181,13 +182,13 @@ class TroubleshootController extends Disposable {
|
|
|
181
182
|
const updateLayout = () => {
|
|
182
183
|
label.textContent = getLayoutInfo();
|
|
183
184
|
if (overlayId) {
|
|
184
|
-
this._notebookEditor.changeCellOverlays(
|
|
185
|
+
this._notebookEditor.changeCellOverlays(accessor => {
|
|
185
186
|
accessor.layoutOverlay(overlayId);
|
|
186
187
|
});
|
|
187
188
|
}
|
|
188
189
|
};
|
|
189
190
|
const disposables = this._cellDisposables[index];
|
|
190
|
-
disposables.add(cell.onDidChangeLayout(
|
|
191
|
+
disposables.add(cell.onDidChangeLayout(e => {
|
|
191
192
|
updateLayout();
|
|
192
193
|
}));
|
|
193
194
|
disposables.add(cell.textBuffer.onDidChangeContent(() => {
|
|
@@ -202,7 +203,7 @@ class TroubleshootController extends Disposable {
|
|
|
202
203
|
updateLayout();
|
|
203
204
|
}));
|
|
204
205
|
disposables.add(toDisposable(() => {
|
|
205
|
-
this._notebookEditor.changeCellOverlays(
|
|
206
|
+
this._notebookEditor.changeCellOverlays(accessor => {
|
|
206
207
|
if (overlayId) {
|
|
207
208
|
accessor.removeOverlay(overlayId);
|
|
208
209
|
}
|
|
@@ -240,7 +241,7 @@ class TroubleshootController extends Disposable {
|
|
|
240
241
|
})));
|
|
241
242
|
dispose(deletedCells);
|
|
242
243
|
});
|
|
243
|
-
const addedCells = e.splices.reduce((acc, [
|
|
244
|
+
const addedCells = e.splices.reduce((acc, [,, newCells]) => [...acc, ...newCells], []);
|
|
244
245
|
for (let i = 0; i < addedCells.length; i++) {
|
|
245
246
|
const cellIndex = this._notebookEditor.getCellIndex(addedCells[i]);
|
|
246
247
|
if (cellIndex !== undefined) {
|
|
@@ -260,13 +261,11 @@ class TroubleshootController extends Disposable {
|
|
|
260
261
|
for (let i = 0; i < this._notebookEditor.getLength(); i++) {
|
|
261
262
|
items.push({
|
|
262
263
|
handle: i,
|
|
263
|
-
items: [
|
|
264
|
-
{
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
}
|
|
269
|
-
]
|
|
264
|
+
items: [{
|
|
265
|
+
text: `index: ${i}`,
|
|
266
|
+
alignment: CellStatusbarAlignment.Left,
|
|
267
|
+
priority: Number.MAX_SAFE_INTEGER
|
|
268
|
+
}]
|
|
270
269
|
});
|
|
271
270
|
}
|
|
272
271
|
return items;
|
|
@@ -282,8 +281,8 @@ registerNotebookContribution(TroubleshootController.id, TroubleshootController);
|
|
|
282
281
|
registerAction2(class extends Action2 {
|
|
283
282
|
constructor() {
|
|
284
283
|
super({
|
|
285
|
-
id:
|
|
286
|
-
title: ( localize2(
|
|
284
|
+
id: "notebook.toggleLayoutTroubleshoot",
|
|
285
|
+
title: ( localize2(9665, "Toggle Notebook Layout Troubleshoot")),
|
|
287
286
|
category: Categories.Developer,
|
|
288
287
|
f1: true
|
|
289
288
|
});
|
|
@@ -301,8 +300,8 @@ registerAction2(class extends Action2 {
|
|
|
301
300
|
registerAction2(class extends Action2 {
|
|
302
301
|
constructor() {
|
|
303
302
|
super({
|
|
304
|
-
id:
|
|
305
|
-
title: ( localize2(
|
|
303
|
+
id: "notebook.inspectLayout",
|
|
304
|
+
title: ( localize2(9666, "Inspect Notebook Layout")),
|
|
306
305
|
category: Categories.Developer,
|
|
307
306
|
f1: true
|
|
308
307
|
});
|
|
@@ -322,8 +321,8 @@ registerAction2(class extends Action2 {
|
|
|
322
321
|
registerAction2(class extends Action2 {
|
|
323
322
|
constructor() {
|
|
324
323
|
super({
|
|
325
|
-
id:
|
|
326
|
-
title: ( localize2(
|
|
324
|
+
id: "notebook.clearNotebookEdtitorTypeCache",
|
|
325
|
+
title: ( localize2(9667, "Clear Notebook Editor Type Cache")),
|
|
327
326
|
category: Categories.Developer,
|
|
328
327
|
f1: true
|
|
329
328
|
});
|
package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/undoRedo/notebookUndoRedo.js
CHANGED
|
@@ -8,12 +8,14 @@ import { getNotebookEditorFromEditorPane, CellEditState } from '@codingame/monac
|
|
|
8
8
|
import { UndoCommand, RedoCommand } from '@codingame/monaco-vscode-api/vscode/vs/editor/browser/editorExtensions';
|
|
9
9
|
|
|
10
10
|
let NotebookUndoRedoContribution = class NotebookUndoRedoContribution extends Disposable {
|
|
11
|
-
static {
|
|
11
|
+
static {
|
|
12
|
+
this.ID = "workbench.contrib.notebookUndoRedo";
|
|
13
|
+
}
|
|
12
14
|
constructor(_editorService) {
|
|
13
15
|
super();
|
|
14
16
|
this._editorService = _editorService;
|
|
15
17
|
const PRIORITY = 105;
|
|
16
|
-
this._register(UndoCommand.addImplementation(PRIORITY,
|
|
18
|
+
this._register(UndoCommand.addImplementation(PRIORITY, "notebook-undo-redo", () => {
|
|
17
19
|
const editor = getNotebookEditorFromEditorPane(this._editorService.activeEditorPane);
|
|
18
20
|
const viewModel = editor?.getViewModel();
|
|
19
21
|
if (editor && editor.hasEditorFocus() && editor.hasModel() && viewModel) {
|
|
@@ -22,16 +24,21 @@ let NotebookUndoRedoContribution = class NotebookUndoRedoContribution extends Di
|
|
|
22
24
|
for (let i = 0; i < editor.getLength(); i++) {
|
|
23
25
|
const cell = editor.cellAt(i);
|
|
24
26
|
if (cell.cellKind === CellKind.Markup && cellResources.find(resource => resource.fragment === cell.model.uri.fragment)) {
|
|
25
|
-
cell.updateEditState(CellEditState.Editing,
|
|
27
|
+
cell.updateEditState(CellEditState.Editing, "undo");
|
|
26
28
|
}
|
|
27
29
|
}
|
|
28
|
-
editor?.setOptions({
|
|
30
|
+
editor?.setOptions({
|
|
31
|
+
cellOptions: {
|
|
32
|
+
resource: cellResources[0]
|
|
33
|
+
},
|
|
34
|
+
preserveFocus: true
|
|
35
|
+
});
|
|
29
36
|
}
|
|
30
37
|
});
|
|
31
38
|
}
|
|
32
39
|
return false;
|
|
33
40
|
}));
|
|
34
|
-
this._register(RedoCommand.addImplementation(PRIORITY,
|
|
41
|
+
this._register(RedoCommand.addImplementation(PRIORITY, "notebook-undo-redo", () => {
|
|
35
42
|
const editor = getNotebookEditorFromEditorPane(this._editorService.activeEditorPane);
|
|
36
43
|
const viewModel = editor?.getViewModel();
|
|
37
44
|
if (editor && editor.hasEditorFocus() && editor.hasModel() && viewModel) {
|
|
@@ -40,10 +47,15 @@ let NotebookUndoRedoContribution = class NotebookUndoRedoContribution extends Di
|
|
|
40
47
|
for (let i = 0; i < editor.getLength(); i++) {
|
|
41
48
|
const cell = editor.cellAt(i);
|
|
42
49
|
if (cell.cellKind === CellKind.Markup && cellResources.find(resource => resource.fragment === cell.model.uri.fragment)) {
|
|
43
|
-
cell.updateEditState(CellEditState.Editing,
|
|
50
|
+
cell.updateEditState(CellEditState.Editing, "redo");
|
|
44
51
|
}
|
|
45
52
|
}
|
|
46
|
-
editor?.setOptions({
|
|
53
|
+
editor?.setOptions({
|
|
54
|
+
cellOptions: {
|
|
55
|
+
resource: cellResources[0]
|
|
56
|
+
},
|
|
57
|
+
preserveFocus: true
|
|
58
|
+
});
|
|
47
59
|
}
|
|
48
60
|
});
|
|
49
61
|
}
|
|
@@ -51,7 +63,9 @@ let NotebookUndoRedoContribution = class NotebookUndoRedoContribution extends Di
|
|
|
51
63
|
}));
|
|
52
64
|
}
|
|
53
65
|
};
|
|
54
|
-
NotebookUndoRedoContribution = ( __decorate([
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
66
|
+
NotebookUndoRedoContribution = ( __decorate([( __param(0, IEditorService))], NotebookUndoRedoContribution));
|
|
67
|
+
registerWorkbenchContribution2(
|
|
68
|
+
NotebookUndoRedoContribution.ID,
|
|
69
|
+
NotebookUndoRedoContribution,
|
|
70
|
+
WorkbenchPhase.BlockRestore
|
|
71
|
+
);
|
package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/viewportWarmup/viewportWarmup.js
CHANGED
|
@@ -11,7 +11,9 @@ import { cellRangesToIndexes } from '@codingame/monaco-vscode-api/vscode/vs/work
|
|
|
11
11
|
import { INotebookService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookService.service';
|
|
12
12
|
|
|
13
13
|
let NotebookViewportContribution = class NotebookViewportContribution extends Disposable {
|
|
14
|
-
static {
|
|
14
|
+
static {
|
|
15
|
+
this.id = "workbench.notebook.viewportWarmup";
|
|
16
|
+
}
|
|
15
17
|
constructor(_notebookEditor, _notebookService, accessibilityService) {
|
|
16
18
|
super();
|
|
17
19
|
this._notebookEditor = _notebookEditor;
|
|
@@ -37,8 +39,8 @@ let NotebookViewportContribution = class NotebookViewportContribution extends Di
|
|
|
37
39
|
if (this._notebookEditor.hasModel()) {
|
|
38
40
|
for (let i = 0; i < this._notebookEditor.getLength(); i++) {
|
|
39
41
|
const cell = this._notebookEditor.cellAt(i);
|
|
40
|
-
if (cell?.cellKind === CellKind.Markup && cell?.getEditState() === CellEditState.Preview && !cell.isInputCollapsed)
|
|
41
|
-
|
|
42
|
+
if (cell?.cellKind === CellKind.Markup && cell?.getEditState() === CellEditState.Preview && !cell.isInputCollapsed)
|
|
43
|
+
; else if (cell?.cellKind === CellKind.Code) {
|
|
42
44
|
this._warmupCodeCell(cell);
|
|
43
45
|
}
|
|
44
46
|
}
|
|
@@ -56,8 +58,7 @@ let NotebookViewportContribution = class NotebookViewportContribution extends Di
|
|
|
56
58
|
const cell = this._notebookEditor.cellAt(index);
|
|
57
59
|
if (cell?.cellKind === CellKind.Markup && cell?.getEditState() === CellEditState.Preview && !cell.isInputCollapsed) {
|
|
58
60
|
this._notebookEditor.createMarkupPreview(cell);
|
|
59
|
-
}
|
|
60
|
-
else if (cell?.cellKind === CellKind.Code) {
|
|
61
|
+
} else if (cell?.cellKind === CellKind.Code) {
|
|
61
62
|
this._warmupCodeCell(cell);
|
|
62
63
|
}
|
|
63
64
|
});
|
|
@@ -83,13 +84,15 @@ let NotebookViewportContribution = class NotebookViewportContribution extends Di
|
|
|
83
84
|
if (!renderer) {
|
|
84
85
|
return;
|
|
85
86
|
}
|
|
86
|
-
const result = {
|
|
87
|
+
const result = {
|
|
88
|
+
type: RenderOutputType.Extension,
|
|
89
|
+
renderer,
|
|
90
|
+
source: output,
|
|
91
|
+
mimeType: pickedMimeTypeRenderer.mimeType
|
|
92
|
+
};
|
|
87
93
|
this._notebookEditor.createOutput(viewCell, result, 0, true);
|
|
88
94
|
}
|
|
89
95
|
}
|
|
90
96
|
};
|
|
91
|
-
NotebookViewportContribution = ( __decorate([
|
|
92
|
-
( __param(1, INotebookService)),
|
|
93
|
-
( __param(2, IAccessibilityService))
|
|
94
|
-
], NotebookViewportContribution));
|
|
97
|
+
NotebookViewportContribution = ( __decorate([( __param(1, INotebookService)), ( __param(2, IAccessibilityService))], NotebookViewportContribution));
|
|
95
98
|
registerNotebookContribution(NotebookViewportContribution.id, NotebookViewportContribution);
|
|
@@ -6,12 +6,12 @@ import { isDocumentExcludePattern } from '@codingame/monaco-vscode-api/vscode/vs
|
|
|
6
6
|
import { INotebookKernelService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookKernelService.service';
|
|
7
7
|
import { INotebookService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookService.service';
|
|
8
8
|
|
|
9
|
-
CommandsRegistry.registerCommand(
|
|
9
|
+
CommandsRegistry.registerCommand("_resolveNotebookContentProvider", accessor => {
|
|
10
10
|
const notebookService = accessor.get(INotebookService);
|
|
11
11
|
const contentProviders = notebookService.getContributedNotebookTypes();
|
|
12
12
|
return ( contentProviders.map(provider => {
|
|
13
13
|
const filenamePatterns = ( provider.selectors.map(selector => {
|
|
14
|
-
if (typeof selector ===
|
|
14
|
+
if (typeof selector === "string") {
|
|
15
15
|
return selector;
|
|
16
16
|
}
|
|
17
17
|
if (isRelativePattern(selector)) {
|
|
@@ -37,16 +37,19 @@ CommandsRegistry.registerCommand('_resolveNotebookContentProvider', (accessor) =
|
|
|
37
37
|
};
|
|
38
38
|
}));
|
|
39
39
|
});
|
|
40
|
-
CommandsRegistry.registerCommand(
|
|
40
|
+
CommandsRegistry.registerCommand("_resolveNotebookKernels", async (accessor, args) => {
|
|
41
41
|
const notebookKernelService = accessor.get(INotebookKernelService);
|
|
42
42
|
const uri = URI.revive(args.uri);
|
|
43
|
-
const kernels = notebookKernelService.getMatchingKernel({
|
|
43
|
+
const kernels = notebookKernelService.getMatchingKernel({
|
|
44
|
+
uri,
|
|
45
|
+
notebookType: args.viewType
|
|
46
|
+
});
|
|
44
47
|
return ( kernels.all.map(provider => ({
|
|
45
48
|
id: provider.id,
|
|
46
49
|
label: provider.label,
|
|
47
50
|
description: provider.description,
|
|
48
51
|
detail: provider.detail,
|
|
49
52
|
isPreferred: false,
|
|
50
|
-
preloads: provider.preloadUris
|
|
53
|
+
preloads: provider.preloadUris
|
|
51
54
|
})));
|
|
52
55
|
});
|