@codingame/monaco-vscode-notebook-service-override 17.2.0 → 18.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 +1 -1
- package/package.json +30 -26
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/emptyTextEditorHint/emptyTextEditorHint.js +11 -8
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellCommands/cellCommands.js +26 -26
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellDiagnostics/cellDiagnosticEditorContrib.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellDiagnostics/cellDiagnosticEditorContrib.js +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellDiagnostics/cellDiagnosticsActions.js +8 -8
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellDiagnostics/diagnosticCellStatusBarContrib.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellDiagnostics/diagnosticCellStatusBarContrib.js +3 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/contributedStatusBarItemController.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/contributedStatusBarItemController.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/statusBarProviders.js +4 -4
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/clipboard/notebookClipboard.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/clipboard/notebookClipboard.js +9 -9
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/debug/notebookBreakpoints.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/debug/notebookDebugDecorations.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/debug/notebookDebugDecorations.js +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/editorHint/emptyCellEditorHint.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/editorStatusBar/editorStatusBar.js +12 -12
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/execute/executionEditorProgress.d.ts +1 -1
- 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 +7 -7
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/gettingStarted/notebookGettingStarted.js +4 -4
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/layout/layoutActions.js +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/marker/markerProvider.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/multicursor/notebookMulticursor.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/multicursor/notebookMulticursor.js +9 -9
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/navigation/arrow.js +17 -17
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookInlineVariables.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookInlineVariables.js +3 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariables.js +3 -3
- 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.d.ts +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/notebookVariables/notebookVariablesView.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesView.js +5 -5
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/outline/notebookOutline.d.ts +3 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/outline/notebookOutline.js +19 -19
- 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 +13 -13
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/troubleshoot/layout.d.ts +8 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/troubleshoot/layout.js +173 -4
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/undoRedo/notebookUndoRedo.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/viewportWarmup/viewportWarmup.js +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions.js +31 -31
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebook.chat.contribution.js +67 -12
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/editActions.js +29 -29
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/executeActions.js +89 -38
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/insertCellActions.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/insertCellActions.js +26 -26
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/layoutActions.js +20 -20
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/notebookIndentationActions.js +8 -8
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/sectionActions.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/sectionActions.js +16 -16
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/variablesActions.js +4 -4
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffActions.js +22 -22
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebook.contribution.js +76 -75
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookAccessibilityHelp.js +11 -11
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookAccessibleView.js +3 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookExtensionPoint.js +33 -33
- package/vscode/src/vs/workbench/contrib/notebook/browser/outputEditor/notebookOutputEditor.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/outputEditor/notebookOutputEditor.js +6 -6
- package/vscode/src/vs/workbench/contrib/notebook/browser/outputEditor/notebookOutputEditorInput.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookEditorServiceImpl.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookEditorServiceImpl.js +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookExecutionServiceImpl.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookExecutionStateServiceImpl.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookExecutionStateServiceImpl.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKernelHistoryServiceImpl.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKeymapServiceImpl.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKeymapServiceImpl.js +5 -5
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookLoggingServiceImpl.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookServiceImpl.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookServiceImpl.js +5 -5
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookOutlineEntryFactory.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookOutlineEntryFactory.js +2 -1
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorModelResolverServiceImpl.js +6 -1
- package/vscode/src/vs/workbench/services/workingCopy/common/fileWorkingCopyManager.js +12 -12
- package/vscode/src/vs/workbench/services/workingCopy/common/storedFileWorkingCopyManager.js +1 -1
- package/vscode/src/vs/workbench/services/workingCopy/common/untitledFileWorkingCopy.d.ts +1 -1
- package/vscode/src/vs/workbench/services/workingCopy/common/untitledFileWorkingCopy.js +1 -1
|
@@ -3,11 +3,13 @@ import { Disposable, DisposableStore, dispose } from '@codingame/monaco-vscode-a
|
|
|
3
3
|
import { localize2 } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
4
4
|
import { Categories } from '@codingame/monaco-vscode-api/vscode/vs/platform/action/common/actionCommonCategories';
|
|
5
5
|
import { registerAction2, Action2 } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/common/actions';
|
|
6
|
-
import { getNotebookEditorFromEditorPane } from '@codingame/monaco-vscode-
|
|
6
|
+
import { getNotebookEditorFromEditorPane } from '@codingame/monaco-vscode-4372ad43-a220-5e78-83e6-95a9cfd64384-common/vscode/vs/workbench/contrib/notebook/browser/notebookBrowser';
|
|
7
7
|
import { registerNotebookContribution } from '@codingame/monaco-vscode-e28ac690-06d5-5ee9-92d1-02df70296354-common/vscode/vs/workbench/contrib/notebook/browser/notebookEditorExtensions';
|
|
8
8
|
import { CellStatusbarAlignment } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
|
|
9
9
|
import { INotebookService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookService.service';
|
|
10
10
|
import { IEditorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service';
|
|
11
|
+
import '@codingame/monaco-vscode-api/vscode/vs/base/browser/dom';
|
|
12
|
+
import { n } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/domImpl/n';
|
|
11
13
|
|
|
12
14
|
class TroubleshootController extends Disposable {
|
|
13
15
|
static { this.id = 'workbench.notebook.troubleshoot'; }
|
|
@@ -18,6 +20,7 @@ class TroubleshootController extends Disposable {
|
|
|
18
20
|
this._cellStateListeners = [];
|
|
19
21
|
this._enabled = false;
|
|
20
22
|
this._cellStatusItems = [];
|
|
23
|
+
this._cellOverlayIds = [];
|
|
21
24
|
this._register(this._notebookEditor.onDidChangeModel(() => {
|
|
22
25
|
this._update();
|
|
23
26
|
}));
|
|
@@ -30,10 +33,16 @@ class TroubleshootController extends Disposable {
|
|
|
30
33
|
_update() {
|
|
31
34
|
this._localStore.clear();
|
|
32
35
|
this._cellStateListeners.forEach(listener => listener.dispose());
|
|
36
|
+
this._removeCellOverlays();
|
|
37
|
+
this._removeNotebookOverlay();
|
|
33
38
|
if (!this._notebookEditor.hasModel()) {
|
|
34
39
|
return;
|
|
35
40
|
}
|
|
36
41
|
this._updateListener();
|
|
42
|
+
if (this._enabled) {
|
|
43
|
+
this._createNotebookOverlay();
|
|
44
|
+
this._createCellOverlays();
|
|
45
|
+
}
|
|
37
46
|
}
|
|
38
47
|
_log(cell, e) {
|
|
39
48
|
if (this._enabled) {
|
|
@@ -41,6 +50,163 @@ class TroubleshootController extends Disposable {
|
|
|
41
50
|
console.log(`cell#${cell.handle}`, e, `${oldHeight} -> ${cell.layoutInfo.totalHeight}`);
|
|
42
51
|
}
|
|
43
52
|
}
|
|
53
|
+
_createCellOverlays() {
|
|
54
|
+
if (!this._notebookEditor.hasModel()) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
for (let i = 0; i < this._notebookEditor.getLength(); i++) {
|
|
58
|
+
const cell = this._notebookEditor.cellAt(i);
|
|
59
|
+
this._createCellOverlay(cell, i);
|
|
60
|
+
}
|
|
61
|
+
this._localStore.add(this._notebookEditor.onDidChangeViewCells(e => {
|
|
62
|
+
const addedCells = e.splices.reduce((acc, [, , newCells]) => [...acc, ...newCells], []);
|
|
63
|
+
for (let i = 0; i < addedCells.length; i++) {
|
|
64
|
+
const cellIndex = this._notebookEditor.getCellIndex(addedCells[i]);
|
|
65
|
+
if (cellIndex !== undefined) {
|
|
66
|
+
this._createCellOverlay(addedCells[i], cellIndex);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}));
|
|
70
|
+
}
|
|
71
|
+
_createNotebookOverlay() {
|
|
72
|
+
if (!this._notebookEditor.hasModel()) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
const listViewTop = this._notebookEditor.getLayoutInfo().listViewOffsetTop;
|
|
76
|
+
const scrollTop = this._notebookEditor.scrollTop;
|
|
77
|
+
const overlay = n.div({
|
|
78
|
+
style: {
|
|
79
|
+
position: 'absolute',
|
|
80
|
+
top: '0',
|
|
81
|
+
left: '0',
|
|
82
|
+
width: '100%',
|
|
83
|
+
height: '100%',
|
|
84
|
+
pointerEvents: 'none',
|
|
85
|
+
zIndex: '1000'
|
|
86
|
+
}
|
|
87
|
+
}, [
|
|
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`])
|
|
114
|
+
]).keepUpdated(this._store);
|
|
115
|
+
this._notebookOverlayDomNode = overlay.element;
|
|
116
|
+
if (this._notebookOverlayDomNode) {
|
|
117
|
+
this._notebookEditor.getDomNode().appendChild(this._notebookOverlayDomNode);
|
|
118
|
+
}
|
|
119
|
+
this._localStore.add(this._notebookEditor.onDidScroll(() => {
|
|
120
|
+
const scrollTop = this._notebookEditor.scrollTop;
|
|
121
|
+
const listViewTop = this._notebookEditor.getLayoutInfo().listViewOffsetTop;
|
|
122
|
+
if (this._notebookOverlayDomNode) {
|
|
123
|
+
const labelElement = this._notebookOverlayDomNode.querySelector('div:nth-child(2)');
|
|
124
|
+
if (labelElement) {
|
|
125
|
+
labelElement.textContent = `ScrollTop: ${scrollTop}px`;
|
|
126
|
+
labelElement.style.top = `${listViewTop}px`;
|
|
127
|
+
}
|
|
128
|
+
const topLineElement = this._notebookOverlayDomNode.querySelector('div:first-child');
|
|
129
|
+
if (topLineElement) {
|
|
130
|
+
topLineElement.style.top = `${listViewTop}px`;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}));
|
|
134
|
+
}
|
|
135
|
+
_createCellOverlay(cell, index) {
|
|
136
|
+
const overlayContainer = document.createElement('div');
|
|
137
|
+
overlayContainer.style.position = 'absolute';
|
|
138
|
+
overlayContainer.style.top = '0';
|
|
139
|
+
overlayContainer.style.left = '0';
|
|
140
|
+
overlayContainer.style.width = '100%';
|
|
141
|
+
overlayContainer.style.height = '100%';
|
|
142
|
+
overlayContainer.style.pointerEvents = 'none';
|
|
143
|
+
overlayContainer.style.zIndex = '1000';
|
|
144
|
+
const topLine = document.createElement('div');
|
|
145
|
+
topLine.style.position = 'absolute';
|
|
146
|
+
topLine.style.top = '0';
|
|
147
|
+
topLine.style.left = '0';
|
|
148
|
+
topLine.style.width = '100%';
|
|
149
|
+
topLine.style.height = '2px';
|
|
150
|
+
topLine.style.backgroundColor = 'rgba(255, 0, 0, 0.7)';
|
|
151
|
+
overlayContainer.appendChild(topLine);
|
|
152
|
+
const cellTop = this._notebookEditor.getAbsoluteTopOfElement(cell);
|
|
153
|
+
const label = document.createElement('div');
|
|
154
|
+
label.textContent = `cell #${index} (handle: ${cell.handle}) | AbsoluteTopOfElement: ${cellTop}px`;
|
|
155
|
+
label.style.position = 'absolute';
|
|
156
|
+
label.style.top = '0px';
|
|
157
|
+
label.style.right = '10px';
|
|
158
|
+
label.style.backgroundColor = 'rgba(255, 0, 0, 0.5)';
|
|
159
|
+
label.style.color = 'white';
|
|
160
|
+
label.style.fontSize = '11px';
|
|
161
|
+
label.style.fontWeight = 'bold';
|
|
162
|
+
label.style.padding = '2px 6px';
|
|
163
|
+
label.style.borderRadius = '3px';
|
|
164
|
+
label.style.whiteSpace = 'nowrap';
|
|
165
|
+
label.style.pointerEvents = 'none';
|
|
166
|
+
label.style.zIndex = '1001';
|
|
167
|
+
overlayContainer.appendChild(label);
|
|
168
|
+
let overlayId = undefined;
|
|
169
|
+
this._notebookEditor.changeCellOverlays((accessor) => {
|
|
170
|
+
overlayId = accessor.addOverlay({
|
|
171
|
+
cell,
|
|
172
|
+
domNode: overlayContainer
|
|
173
|
+
});
|
|
174
|
+
});
|
|
175
|
+
if (overlayId) {
|
|
176
|
+
this._cellOverlayIds.push(overlayId);
|
|
177
|
+
const updateLayout = () => {
|
|
178
|
+
const scrollTop = this._notebookEditor.getAbsoluteTopOfElement(cell);
|
|
179
|
+
label.textContent = `cell #${index} (handle: ${cell.handle}) | AbsoluteTopOfElement: ${scrollTop}px`;
|
|
180
|
+
if (overlayId) {
|
|
181
|
+
this._notebookEditor.changeCellOverlays((accessor) => {
|
|
182
|
+
accessor.layoutOverlay(overlayId);
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
};
|
|
186
|
+
this._localStore.add(cell.onDidChangeLayout((e) => {
|
|
187
|
+
updateLayout();
|
|
188
|
+
}));
|
|
189
|
+
this._localStore.add(this._notebookEditor.onDidChangeLayout(() => {
|
|
190
|
+
updateLayout();
|
|
191
|
+
}));
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
_removeCellOverlays() {
|
|
195
|
+
if (this._cellOverlayIds.length > 0) {
|
|
196
|
+
this._notebookEditor.changeCellOverlays((accessor) => {
|
|
197
|
+
for (const id of this._cellOverlayIds) {
|
|
198
|
+
accessor.removeOverlay(id);
|
|
199
|
+
}
|
|
200
|
+
});
|
|
201
|
+
this._cellOverlayIds = [];
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
_removeNotebookOverlay() {
|
|
205
|
+
if (this._notebookOverlayDomNode) {
|
|
206
|
+
this._notebookOverlayDomNode.remove();
|
|
207
|
+
this._notebookOverlayDomNode = undefined;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
44
210
|
_updateListener() {
|
|
45
211
|
if (!this._notebookEditor.hasModel()) {
|
|
46
212
|
return;
|
|
@@ -87,6 +253,9 @@ class TroubleshootController extends Disposable {
|
|
|
87
253
|
}
|
|
88
254
|
dispose() {
|
|
89
255
|
dispose(this._cellStateListeners);
|
|
256
|
+
this._removeCellOverlays();
|
|
257
|
+
this._removeNotebookOverlay();
|
|
258
|
+
this._localStore.clear();
|
|
90
259
|
super.dispose();
|
|
91
260
|
}
|
|
92
261
|
}
|
|
@@ -95,7 +264,7 @@ registerAction2(class extends Action2 {
|
|
|
95
264
|
constructor() {
|
|
96
265
|
super({
|
|
97
266
|
id: 'notebook.toggleLayoutTroubleshoot',
|
|
98
|
-
title: ( localize2(
|
|
267
|
+
title: ( localize2(8265, "Toggle Notebook Layout Troubleshoot")),
|
|
99
268
|
category: Categories.Developer,
|
|
100
269
|
f1: true
|
|
101
270
|
});
|
|
@@ -114,7 +283,7 @@ registerAction2(class extends Action2 {
|
|
|
114
283
|
constructor() {
|
|
115
284
|
super({
|
|
116
285
|
id: 'notebook.inspectLayout',
|
|
117
|
-
title: ( localize2(
|
|
286
|
+
title: ( localize2(8266, "Inspect Notebook Layout")),
|
|
118
287
|
category: Categories.Developer,
|
|
119
288
|
f1: true
|
|
120
289
|
});
|
|
@@ -135,7 +304,7 @@ registerAction2(class extends Action2 {
|
|
|
135
304
|
constructor() {
|
|
136
305
|
super({
|
|
137
306
|
id: 'notebook.clearNotebookEdtitorTypeCache',
|
|
138
|
-
title: ( localize2(
|
|
307
|
+
title: ( localize2(8267, "Clear Notebook Editor Type Cache")),
|
|
139
308
|
category: Categories.Developer,
|
|
140
309
|
f1: true
|
|
141
310
|
});
|
package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/undoRedo/notebookUndoRedo.js
CHANGED
|
@@ -4,7 +4,7 @@ import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/l
|
|
|
4
4
|
import { registerWorkbenchContribution2, WorkbenchPhase } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/contributions';
|
|
5
5
|
import { CellKind } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
|
|
6
6
|
import { IEditorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service';
|
|
7
|
-
import { getNotebookEditorFromEditorPane, CellEditState } from '@codingame/monaco-vscode-
|
|
7
|
+
import { getNotebookEditorFromEditorPane, CellEditState } from '@codingame/monaco-vscode-4372ad43-a220-5e78-83e6-95a9cfd64384-common/vscode/vs/workbench/contrib/notebook/browser/notebookBrowser';
|
|
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 {
|
package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/viewportWarmup/viewportWarmup.js
CHANGED
|
@@ -3,11 +3,11 @@ import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib
|
|
|
3
3
|
import { RunOnceScheduler } from '@codingame/monaco-vscode-api/vscode/vs/base/common/async';
|
|
4
4
|
import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
5
5
|
import { IAccessibilityService } from '@codingame/monaco-vscode-api/vscode/vs/platform/accessibility/common/accessibility.service';
|
|
6
|
-
import { CellEditState, RenderOutputType } from '@codingame/monaco-vscode-
|
|
6
|
+
import { CellEditState, RenderOutputType } from '@codingame/monaco-vscode-4372ad43-a220-5e78-83e6-95a9cfd64384-common/vscode/vs/workbench/contrib/notebook/browser/notebookBrowser';
|
|
7
7
|
import { registerNotebookContribution } from '@codingame/monaco-vscode-e28ac690-06d5-5ee9-92d1-02df70296354-common/vscode/vs/workbench/contrib/notebook/browser/notebookEditorExtensions';
|
|
8
8
|
import { outputDisplayLimit } from '@codingame/monaco-vscode-e28ac690-06d5-5ee9-92d1-02df70296354-common/vscode/vs/workbench/contrib/notebook/browser/viewModel/codeCellViewModel';
|
|
9
9
|
import { CellKind } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
|
|
10
|
-
import { cellRangesToIndexes } from '@codingame/monaco-vscode-
|
|
10
|
+
import { cellRangesToIndexes } from '@codingame/monaco-vscode-4372ad43-a220-5e78-83e6-95a9cfd64384-common/vscode/vs/workbench/contrib/notebook/common/notebookRange';
|
|
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 {
|
|
@@ -13,22 +13,22 @@ import { KeybindingWeight } from '@codingame/monaco-vscode-api/vscode/vs/platfor
|
|
|
13
13
|
import { CTX_INLINE_CHAT_FOCUSED, CTX_INLINE_CHAT_INNER_CURSOR_FIRST, CTX_INLINE_CHAT_INNER_CURSOR_LAST, CTX_INLINE_CHAT_RESPONSE_TYPE, InlineChatResponseType, MENU_INLINE_CHAT_WIDGET_STATUS, CTX_INLINE_CHAT_REQUEST_IN_PROGRESS, CTX_INLINE_CHAT_VISIBLE } from '@codingame/monaco-vscode-c465110a-57c0-59d7-a6b2-be0a4db7e517-common/vscode/vs/workbench/contrib/inlineChat/common/inlineChat';
|
|
14
14
|
import { CTX_NOTEBOOK_CHAT_HAS_ACTIVE_REQUEST, MENU_CELL_CHAT_INPUT, CTX_NOTEBOOK_CELL_CHAT_FOCUSED, MENU_CELL_CHAT_WIDGET, MENU_CELL_CHAT_WIDGET_STATUS, CTX_NOTEBOOK_CHAT_USER_DID_EDIT, CTX_NOTEBOOK_CHAT_OUTER_FOCUS_POSITION, CTX_NOTEBOOK_CHAT_HAS_AGENT } from '@codingame/monaco-vscode-e28ac690-06d5-5ee9-92d1-02df70296354-common/vscode/vs/workbench/contrib/notebook/browser/controller/chat/notebookChatContext';
|
|
15
15
|
import { NotebookChatController } from '@codingame/monaco-vscode-e28ac690-06d5-5ee9-92d1-02df70296354-common/vscode/vs/workbench/contrib/notebook/browser/controller/chat/notebookChatController';
|
|
16
|
-
import { NotebookAction, NotebookCellAction, getEditorFromArgsOrActivePane, CELL_TITLE_CELL_GROUP_ID, getContextFromActiveEditor } from '@codingame/monaco-vscode-
|
|
16
|
+
import { NotebookAction, NotebookCellAction, getEditorFromArgsOrActivePane, CELL_TITLE_CELL_GROUP_ID, getContextFromActiveEditor } from '@codingame/monaco-vscode-1cb11a73-359e-5a2f-9e95-6989cc9858ee-common/vscode/vs/workbench/contrib/notebook/browser/controller/coreActions';
|
|
17
17
|
import { insertNewCell } from '../insertCellActions.js';
|
|
18
|
-
import { CellEditState } from '@codingame/monaco-vscode-
|
|
18
|
+
import { CellEditState } from '@codingame/monaco-vscode-4372ad43-a220-5e78-83e6-95a9cfd64384-common/vscode/vs/workbench/contrib/notebook/browser/notebookBrowser';
|
|
19
19
|
import { CellKind, NOTEBOOK_EDITOR_CURSOR_BOUNDARY, NotebookSetting } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
|
|
20
|
-
import { NOTEBOOK_CELL_EDITOR_FOCUSED, NOTEBOOK_EDITOR_FOCUSED, IS_COMPOSITE_NOTEBOOK, NOTEBOOK_EDITOR_EDITABLE, NOTEBOOK_CELL_GENERATED_BY_CHAT } from '@codingame/monaco-vscode-
|
|
20
|
+
import { NOTEBOOK_CELL_EDITOR_FOCUSED, NOTEBOOK_EDITOR_FOCUSED, IS_COMPOSITE_NOTEBOOK, NOTEBOOK_EDITOR_EDITABLE, NOTEBOOK_CELL_GENERATED_BY_CHAT } from '@codingame/monaco-vscode-c87fff3a-2aa9-52ab-ba4d-17e8d1e5e185-common/vscode/vs/workbench/contrib/notebook/common/notebookContextKeys';
|
|
21
21
|
import { Iterable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/iterator';
|
|
22
22
|
import { IEditorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service';
|
|
23
23
|
import { ChatContextKeys } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatContextKeys';
|
|
24
|
-
import { InlineChatController } from '@codingame/monaco-vscode-
|
|
24
|
+
import { InlineChatController } from '@codingame/monaco-vscode-6c0f93b9-169c-58c3-a9cb-7d60698eb52c-common/vscode/vs/workbench/contrib/inlineChat/browser/inlineChatController';
|
|
25
25
|
import { EditorAction2 } from '@codingame/monaco-vscode-api/vscode/vs/editor/browser/editorExtensions';
|
|
26
26
|
|
|
27
27
|
registerAction2(class extends NotebookAction {
|
|
28
28
|
constructor() {
|
|
29
29
|
super({
|
|
30
30
|
id: 'notebook.cell.chat.accept',
|
|
31
|
-
title: ( localize2(
|
|
31
|
+
title: ( localize2(8274, "Make Request")),
|
|
32
32
|
icon: Codicon.send,
|
|
33
33
|
keybinding: {
|
|
34
34
|
when: ( ContextKeyExpr.and(CTX_NOTEBOOK_CELL_CHAT_FOCUSED, CTX_INLINE_CHAT_FOCUSED, ( NOTEBOOK_CELL_EDITOR_FOCUSED.negate()))),
|
|
@@ -52,7 +52,7 @@ registerAction2(class extends NotebookCellAction {
|
|
|
52
52
|
constructor() {
|
|
53
53
|
super({
|
|
54
54
|
id: 'notebook.cell.chat.arrowOutUp',
|
|
55
|
-
title: ( localize(
|
|
55
|
+
title: ( localize(8275, 'Cursor Up')),
|
|
56
56
|
keybinding: {
|
|
57
57
|
when: ( ContextKeyExpr.and(
|
|
58
58
|
CTX_NOTEBOOK_CELL_CHAT_FOCUSED,
|
|
@@ -87,7 +87,7 @@ registerAction2(class extends NotebookAction {
|
|
|
87
87
|
constructor() {
|
|
88
88
|
super({
|
|
89
89
|
id: 'notebook.cell.chat.arrowOutDown',
|
|
90
|
-
title: ( localize(
|
|
90
|
+
title: ( localize(8276, 'Cursor Down')),
|
|
91
91
|
keybinding: {
|
|
92
92
|
when: ( ContextKeyExpr.and(
|
|
93
93
|
CTX_NOTEBOOK_CELL_CHAT_FOCUSED,
|
|
@@ -110,7 +110,7 @@ registerAction2(class extends NotebookCellAction {
|
|
|
110
110
|
constructor() {
|
|
111
111
|
super({
|
|
112
112
|
id: 'notebook.cell.focusChatWidget',
|
|
113
|
-
title: ( localize(
|
|
113
|
+
title: ( localize(8277, 'Focus Chat Widget')),
|
|
114
114
|
keybinding: {
|
|
115
115
|
when: ( ContextKeyExpr.and(NOTEBOOK_EDITOR_FOCUSED, ( CONTEXT_ACCESSIBILITY_MODE_ENABLED.negate()), ( ContextKeyExpr.and(( ContextKeyExpr.has(InputFocusedContextKey)), EditorContextKeys.editorTextFocus, ( NOTEBOOK_EDITOR_CURSOR_BOUNDARY.notEqualsTo('bottom')), ( NOTEBOOK_EDITOR_CURSOR_BOUNDARY.notEqualsTo('none')))), ( EditorContextKeys.isEmbeddedDiffEditor.negate()))),
|
|
116
116
|
weight: KeybindingWeight.EditorCore + 7,
|
|
@@ -128,7 +128,7 @@ registerAction2(class extends NotebookCellAction {
|
|
|
128
128
|
constructor() {
|
|
129
129
|
super({
|
|
130
130
|
id: 'notebook.cell.focusNextChatWidget',
|
|
131
|
-
title: ( localize(
|
|
131
|
+
title: ( localize(8278, 'Focus Next Cell Chat Widget')),
|
|
132
132
|
keybinding: {
|
|
133
133
|
when: ( ContextKeyExpr.and(( CONTEXT_ACCESSIBILITY_MODE_ENABLED.negate()), ( ContextKeyExpr.and(( ContextKeyExpr.has(InputFocusedContextKey)), EditorContextKeys.editorTextFocus, ( NOTEBOOK_EDITOR_CURSOR_BOUNDARY.notEqualsTo('top')), ( NOTEBOOK_EDITOR_CURSOR_BOUNDARY.notEqualsTo('none')))), ( EditorContextKeys.isEmbeddedDiffEditor.negate()))),
|
|
134
134
|
weight: KeybindingWeight.EditorCore + 7,
|
|
@@ -147,7 +147,7 @@ registerAction2(class extends NotebookAction {
|
|
|
147
147
|
constructor() {
|
|
148
148
|
super({
|
|
149
149
|
id: 'notebook.cell.chat.stop',
|
|
150
|
-
title: ( localize2(
|
|
150
|
+
title: ( localize2(8279, "Stop Request")),
|
|
151
151
|
icon: Codicon.debugStop,
|
|
152
152
|
menu: {
|
|
153
153
|
id: MENU_CELL_CHAT_INPUT,
|
|
@@ -166,7 +166,7 @@ registerAction2(class extends NotebookAction {
|
|
|
166
166
|
constructor() {
|
|
167
167
|
super({
|
|
168
168
|
id: 'notebook.cell.chat.close',
|
|
169
|
-
title: ( localize2(
|
|
169
|
+
title: ( localize2(8280, "Close Chat")),
|
|
170
170
|
icon: Codicon.close,
|
|
171
171
|
menu: {
|
|
172
172
|
id: MENU_CELL_CHAT_WIDGET,
|
|
@@ -184,10 +184,10 @@ registerAction2(class extends NotebookAction {
|
|
|
184
184
|
constructor() {
|
|
185
185
|
super({
|
|
186
186
|
id: 'notebook.cell.chat.acceptChanges',
|
|
187
|
-
title: ( localize2(
|
|
188
|
-
shortTitle: ( localize(
|
|
187
|
+
title: ( localize2(8281, "Accept Changes")),
|
|
188
|
+
shortTitle: ( localize(8282, 'Accept')),
|
|
189
189
|
icon: Codicon.check,
|
|
190
|
-
tooltip: ( localize(
|
|
190
|
+
tooltip: ( localize(8283, 'Accept Changes')),
|
|
191
191
|
keybinding: [
|
|
192
192
|
{
|
|
193
193
|
when: ( ContextKeyExpr.and(CTX_NOTEBOOK_CELL_CHAT_FOCUSED, CTX_INLINE_CHAT_FOCUSED, ( NOTEBOOK_CELL_EDITOR_FOCUSED.negate()))),
|
|
@@ -234,7 +234,7 @@ registerAction2(class extends NotebookAction {
|
|
|
234
234
|
constructor() {
|
|
235
235
|
super({
|
|
236
236
|
id: 'notebook.cell.chat.discard',
|
|
237
|
-
title: ( localize(
|
|
237
|
+
title: ( localize(8284, 'Discard')),
|
|
238
238
|
icon: Codicon.discard,
|
|
239
239
|
keybinding: {
|
|
240
240
|
when: ( ContextKeyExpr.and(CTX_NOTEBOOK_CELL_CHAT_FOCUSED, CTX_INLINE_CHAT_FOCUSED, ( CTX_NOTEBOOK_CHAT_USER_DID_EDIT.negate()), ( NOTEBOOK_CELL_EDITOR_FOCUSED.negate()))),
|
|
@@ -275,12 +275,12 @@ registerAction2(class extends NotebookAction {
|
|
|
275
275
|
super({
|
|
276
276
|
id: 'notebook.cell.chat.start',
|
|
277
277
|
title: {
|
|
278
|
-
value: '$(sparkle) ' + ( localize(
|
|
278
|
+
value: '$(sparkle) ' + ( localize(8285, "Generate")),
|
|
279
279
|
original: '$(sparkle) Generate',
|
|
280
280
|
},
|
|
281
|
-
tooltip: ( localize(
|
|
281
|
+
tooltip: ( localize(8286, "Start Chat to Generate Code")),
|
|
282
282
|
metadata: {
|
|
283
|
-
description: ( localize(
|
|
283
|
+
description: ( localize(8286, "Start Chat to Generate Code")),
|
|
284
284
|
args: [
|
|
285
285
|
{
|
|
286
286
|
name: 'args',
|
|
@@ -362,10 +362,10 @@ registerAction2(class extends NotebookAction {
|
|
|
362
362
|
super({
|
|
363
363
|
id: 'notebook.cell.chat.startAtTop',
|
|
364
364
|
title: {
|
|
365
|
-
value: '$(sparkle) ' + ( localize(
|
|
365
|
+
value: '$(sparkle) ' + ( localize(8285, "Generate")),
|
|
366
366
|
original: '$(sparkle) Generate',
|
|
367
367
|
},
|
|
368
|
-
tooltip: ( localize(
|
|
368
|
+
tooltip: ( localize(8286, "Start Chat to Generate Code")),
|
|
369
369
|
f1: false,
|
|
370
370
|
menu: [
|
|
371
371
|
{
|
|
@@ -385,8 +385,8 @@ MenuRegistry.appendMenuItem(MenuId.NotebookToolbar, {
|
|
|
385
385
|
command: {
|
|
386
386
|
id: 'notebook.cell.chat.start',
|
|
387
387
|
icon: Codicon.sparkle,
|
|
388
|
-
title: ( localize(
|
|
389
|
-
tooltip: ( localize(
|
|
388
|
+
title: ( localize(8287, "Generate")),
|
|
389
|
+
tooltip: ( localize(8288, "Start Chat to Generate Code"))
|
|
390
390
|
},
|
|
391
391
|
order: -10,
|
|
392
392
|
group: 'navigation/add',
|
|
@@ -396,7 +396,7 @@ registerAction2(class extends NotebookAction {
|
|
|
396
396
|
constructor() {
|
|
397
397
|
super({
|
|
398
398
|
id: 'notebook.cell.chat.focus',
|
|
399
|
-
title: ( localize(
|
|
399
|
+
title: ( localize(8289, 'Focus Chat')),
|
|
400
400
|
keybinding: [
|
|
401
401
|
{
|
|
402
402
|
when: ( ContextKeyExpr.and(
|
|
@@ -428,7 +428,7 @@ registerAction2(class extends NotebookAction {
|
|
|
428
428
|
constructor() {
|
|
429
429
|
super({
|
|
430
430
|
id: 'notebook.cell.chat.focusNextCell',
|
|
431
|
-
title: ( localize(
|
|
431
|
+
title: ( localize(8290, 'Focus Next Cell')),
|
|
432
432
|
keybinding: [
|
|
433
433
|
{
|
|
434
434
|
when: ( ContextKeyExpr.and(CTX_NOTEBOOK_CELL_CHAT_FOCUSED, CTX_INLINE_CHAT_FOCUSED)),
|
|
@@ -447,7 +447,7 @@ registerAction2(class extends NotebookAction {
|
|
|
447
447
|
constructor() {
|
|
448
448
|
super({
|
|
449
449
|
id: 'notebook.cell.chat.focusPreviousCell',
|
|
450
|
-
title: ( localize(
|
|
450
|
+
title: ( localize(8291, 'Focus Previous Cell')),
|
|
451
451
|
keybinding: [
|
|
452
452
|
{
|
|
453
453
|
when: ( ContextKeyExpr.and(CTX_NOTEBOOK_CELL_CHAT_FOCUSED, CTX_INLINE_CHAT_FOCUSED)),
|
|
@@ -466,7 +466,7 @@ registerAction2(class extends NotebookAction {
|
|
|
466
466
|
constructor() {
|
|
467
467
|
super({
|
|
468
468
|
id: 'notebook.cell.chat.previousFromHistory',
|
|
469
|
-
title: ( localize2(
|
|
469
|
+
title: ( localize2(8292, "Previous From History")),
|
|
470
470
|
precondition: ( ContextKeyExpr.and(CTX_NOTEBOOK_CELL_CHAT_FOCUSED, CTX_INLINE_CHAT_FOCUSED)),
|
|
471
471
|
keybinding: {
|
|
472
472
|
when: ( ContextKeyExpr.and(CTX_NOTEBOOK_CELL_CHAT_FOCUSED, CTX_INLINE_CHAT_FOCUSED)),
|
|
@@ -484,7 +484,7 @@ registerAction2(class extends NotebookAction {
|
|
|
484
484
|
constructor() {
|
|
485
485
|
super({
|
|
486
486
|
id: 'notebook.cell.chat.nextFromHistory',
|
|
487
|
-
title: ( localize2(
|
|
487
|
+
title: ( localize2(8293, "Next From History")),
|
|
488
488
|
precondition: ( ContextKeyExpr.and(CTX_NOTEBOOK_CELL_CHAT_FOCUSED, CTX_INLINE_CHAT_FOCUSED)),
|
|
489
489
|
keybinding: {
|
|
490
490
|
when: ( ContextKeyExpr.and(CTX_NOTEBOOK_CELL_CHAT_FOCUSED, CTX_INLINE_CHAT_FOCUSED)),
|
|
@@ -502,7 +502,7 @@ registerAction2(class extends NotebookCellAction {
|
|
|
502
502
|
constructor() {
|
|
503
503
|
super({
|
|
504
504
|
id: 'notebook.cell.chat.restore',
|
|
505
|
-
title: ( localize2(
|
|
505
|
+
title: ( localize2(8294, "Generate")),
|
|
506
506
|
icon: Codicon.sparkle,
|
|
507
507
|
menu: {
|
|
508
508
|
id: MenuId.NotebookCellTitle,
|
|
@@ -533,9 +533,9 @@ class AcceptChangesAndRun extends EditorAction2 {
|
|
|
533
533
|
constructor() {
|
|
534
534
|
super({
|
|
535
535
|
id: 'notebook.inlineChat.acceptChangesAndRun',
|
|
536
|
-
title: ( localize2(
|
|
537
|
-
shortTitle: ( localize(
|
|
538
|
-
tooltip: ( localize(
|
|
536
|
+
title: ( localize2(8295, "Accept and Run")),
|
|
537
|
+
shortTitle: ( localize(8296, 'Accept & Run')),
|
|
538
|
+
tooltip: ( localize(8297, 'Accept the changes and run the cell')),
|
|
539
539
|
icon: Codicon.check,
|
|
540
540
|
f1: true,
|
|
541
541
|
precondition: ( ContextKeyExpr.and(( NOTEBOOK_EDITOR_EDITABLE.isEqualTo(true)), CTX_INLINE_CHAT_VISIBLE)),
|
|
@@ -13,7 +13,7 @@ import { IContextKeyService } from '@codingame/monaco-vscode-api/vscode/vs/platf
|
|
|
13
13
|
import { IQuickInputService } from '@codingame/monaco-vscode-api/vscode/vs/platform/quickinput/common/quickInput.service';
|
|
14
14
|
import { registerWorkbenchContribution2, WorkbenchPhase } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/contributions';
|
|
15
15
|
import { IEditorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service';
|
|
16
|
-
import { showChatView } from '@codingame/monaco-vscode-
|
|
16
|
+
import { showChatView } from '@codingame/monaco-vscode-7adbeffb-8051-54a9-8c9b-b62ce9e5836f-common/vscode/vs/workbench/contrib/chat/browser/chat';
|
|
17
17
|
import { IChatWidgetService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chat.service';
|
|
18
18
|
import { ChatInputPart } from '@codingame/monaco-vscode-fab30422-b487-5f4e-8d30-8b4d266e3fcd-common/vscode/vs/workbench/contrib/chat/browser/chatInputPart';
|
|
19
19
|
import { ChatDynamicVariableModel } from '@codingame/monaco-vscode-e4d0fd26-1b26-5583-b3f7-582e08d7b389-common/vscode/vs/workbench/contrib/chat/browser/contrib/chatDynamicVariables';
|
|
@@ -22,26 +22,29 @@ import { IChatAgentService } from '@codingame/monaco-vscode-api/vscode/vs/workbe
|
|
|
22
22
|
import { ChatAgentLocation } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/constants';
|
|
23
23
|
import { ChatContextKeys } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatContextKeys';
|
|
24
24
|
import { chatVariableLeader } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatParserTypes';
|
|
25
|
-
import { NOTEBOOK_CELL_OUTPUT_MIME_TYPE_LIST_FOR_CHAT, NOTEBOOK_CELL_HAS_OUTPUTS, NOTEBOOK_CELL_OUTPUT_MIMETYPE } from '@codingame/monaco-vscode-
|
|
25
|
+
import { NOTEBOOK_CELL_OUTPUT_MIME_TYPE_LIST_FOR_CHAT, NOTEBOOK_CELL_HAS_OUTPUTS, NOTEBOOK_CELL_OUTPUT_MIMETYPE } from '@codingame/monaco-vscode-c87fff3a-2aa9-52ab-ba4d-17e8d1e5e185-common/vscode/vs/workbench/contrib/notebook/common/notebookContextKeys';
|
|
26
26
|
import { INotebookKernelService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookKernelService.service';
|
|
27
|
-
import { getNotebookEditorFromEditorPane } from '@codingame/monaco-vscode-
|
|
28
|
-
import { copyIcon } from '@codingame/monaco-vscode-
|
|
29
|
-
import { getOutputViewModelFromId } from '@codingame/monaco-vscode-
|
|
30
|
-
import { NOTEBOOK_ACTIONS_CATEGORY } from '@codingame/monaco-vscode-
|
|
27
|
+
import { getNotebookEditorFromEditorPane } from '@codingame/monaco-vscode-4372ad43-a220-5e78-83e6-95a9cfd64384-common/vscode/vs/workbench/contrib/notebook/browser/notebookBrowser';
|
|
28
|
+
import { copyIcon } from '@codingame/monaco-vscode-1cb11a73-359e-5a2f-9e95-6989cc9858ee-common/vscode/vs/workbench/contrib/notebook/browser/notebookIcons';
|
|
29
|
+
import { getOutputViewModelFromId } from '@codingame/monaco-vscode-1cb11a73-359e-5a2f-9e95-6989cc9858ee-common/vscode/vs/workbench/contrib/notebook/browser/controller/cellOutputActions';
|
|
30
|
+
import { NOTEBOOK_ACTIONS_CATEGORY } from '@codingame/monaco-vscode-1cb11a73-359e-5a2f-9e95-6989cc9858ee-common/vscode/vs/workbench/contrib/notebook/browser/controller/coreActions';
|
|
31
31
|
import './cellChatActions.js';
|
|
32
32
|
import { CTX_NOTEBOOK_CHAT_HAS_AGENT } from '@codingame/monaco-vscode-e28ac690-06d5-5ee9-92d1-02df70296354-common/vscode/vs/workbench/contrib/notebook/browser/controller/chat/notebookChatContext';
|
|
33
33
|
import { IViewsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/views/common/viewsService.service';
|
|
34
|
-
import { NOTEBOOK_CELL_OUTPUT_MIME_TYPE_LIST_FOR_CHAT_CONST, createNotebookOutputVariableEntry } from '@codingame/monaco-vscode-
|
|
34
|
+
import { NOTEBOOK_CELL_OUTPUT_MIME_TYPE_LIST_FOR_CHAT_CONST, createNotebookOutputVariableEntry } from '@codingame/monaco-vscode-1cb11a73-359e-5a2f-9e95-6989cc9858ee-common/vscode/vs/workbench/contrib/notebook/browser/contrib/chat/notebookChatUtils';
|
|
35
|
+
import { IChatContextPickService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chatContextPickService.service';
|
|
36
|
+
import { Codicon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/codicons';
|
|
35
37
|
|
|
36
38
|
const NotebookKernelVariableKey = 'kernelVariable';
|
|
37
39
|
let NotebookChatContribution = class NotebookChatContribution extends Disposable {
|
|
38
40
|
static { this.ID = 'workbench.contrib.notebookChatContribution'; }
|
|
39
|
-
constructor(contextKeyService, chatAgentService, editorService, chatWidgetService, notebookKernelService, languageFeaturesService) {
|
|
41
|
+
constructor(contextKeyService, chatAgentService, editorService, chatWidgetService, notebookKernelService, languageFeaturesService, chatContextPickService) {
|
|
40
42
|
super();
|
|
41
43
|
this.editorService = editorService;
|
|
42
44
|
this.chatWidgetService = chatWidgetService;
|
|
43
45
|
this.notebookKernelService = notebookKernelService;
|
|
44
46
|
this.languageFeaturesService = languageFeaturesService;
|
|
47
|
+
this._register(chatContextPickService.registerChatContextItem(( new KernelVariableContextPicker(this.editorService, this.notebookKernelService))));
|
|
45
48
|
this._ctxHasProvider = CTX_NOTEBOOK_CHAT_HAS_AGENT.bindTo(contextKeyService);
|
|
46
49
|
const updateNotebookAgentStatus = () => {
|
|
47
50
|
const hasNotebookAgent = Boolean(chatAgentService.getDefaultAgent(ChatAgentLocation.Notebook));
|
|
@@ -75,7 +78,7 @@ let NotebookChatContribution = class NotebookChatContribution extends Disposable
|
|
|
75
78
|
result.suggestions.push({
|
|
76
79
|
label: `${chatVariableLeader}${NotebookKernelVariableKey}`,
|
|
77
80
|
insertText: `${chatVariableLeader}${NotebookKernelVariableKey}:`,
|
|
78
|
-
detail: ( localize(
|
|
81
|
+
detail: ( localize(8298, "Pick a variable from the kernel")),
|
|
79
82
|
range,
|
|
80
83
|
kind: CompletionItemKind.Text,
|
|
81
84
|
command: { id: SelectAndInsertKernelVariableAction.ID, title: SelectAndInsertKernelVariableAction.ID, arguments: [{ widget, range: afterRange }] },
|
|
@@ -126,7 +129,8 @@ NotebookChatContribution = ( __decorate([
|
|
|
126
129
|
( __param(2, IEditorService)),
|
|
127
130
|
( __param(3, IChatWidgetService)),
|
|
128
131
|
( __param(4, INotebookKernelService)),
|
|
129
|
-
( __param(5, ILanguageFeaturesService))
|
|
132
|
+
( __param(5, ILanguageFeaturesService)),
|
|
133
|
+
( __param(6, IChatContextPickService))
|
|
130
134
|
], NotebookChatContribution));
|
|
131
135
|
class SelectAndInsertKernelVariableAction extends Action2 {
|
|
132
136
|
constructor() {
|
|
@@ -169,7 +173,7 @@ class SelectAndInsertKernelVariableAction extends Action2 {
|
|
|
169
173
|
detail: variable.type,
|
|
170
174
|
});
|
|
171
175
|
}
|
|
172
|
-
const pickedVariable = await quickInputService.pick(quickPickItems, { placeHolder:
|
|
176
|
+
const pickedVariable = await quickInputService.pick(quickPickItems, { placeHolder: ( localize(8299, "Select a kernel variable")) });
|
|
173
177
|
if (!pickedVariable) {
|
|
174
178
|
return;
|
|
175
179
|
}
|
|
@@ -204,11 +208,62 @@ class SelectAndInsertKernelVariableAction extends Action2 {
|
|
|
204
208
|
}
|
|
205
209
|
}
|
|
206
210
|
}
|
|
211
|
+
let KernelVariableContextPicker = class KernelVariableContextPicker {
|
|
212
|
+
constructor(editorService, notebookKernelService) {
|
|
213
|
+
this.editorService = editorService;
|
|
214
|
+
this.notebookKernelService = notebookKernelService;
|
|
215
|
+
this.type = 'pickerPick';
|
|
216
|
+
this.label = ( localize(8300, 'Kernel Variable...'));
|
|
217
|
+
this.icon = Codicon.serverEnvironment;
|
|
218
|
+
}
|
|
219
|
+
isEnabled(widget) {
|
|
220
|
+
return widget.location === ChatAgentLocation.Notebook && Boolean(getNotebookEditorFromEditorPane(this.editorService.activeEditorPane)?.getViewModel()?.notebookDocument);
|
|
221
|
+
}
|
|
222
|
+
asPicker() {
|
|
223
|
+
const picks = (async () => {
|
|
224
|
+
const notebook = getNotebookEditorFromEditorPane(this.editorService.activeEditorPane)?.getViewModel()?.notebookDocument;
|
|
225
|
+
if (!notebook) {
|
|
226
|
+
return [];
|
|
227
|
+
}
|
|
228
|
+
const selectedKernel = this.notebookKernelService.getMatchingKernel(notebook).selected;
|
|
229
|
+
const hasVariableProvider = selectedKernel?.hasVariableProvider;
|
|
230
|
+
if (!hasVariableProvider) {
|
|
231
|
+
return [];
|
|
232
|
+
}
|
|
233
|
+
const variables = selectedKernel.provideVariables(notebook.uri, undefined, 'named', 0, CancellationToken.None);
|
|
234
|
+
const result = [];
|
|
235
|
+
for await (const variable of variables) {
|
|
236
|
+
result.push({
|
|
237
|
+
label: variable.name,
|
|
238
|
+
description: variable.value,
|
|
239
|
+
asAttachment: () => {
|
|
240
|
+
return {
|
|
241
|
+
kind: 'generic',
|
|
242
|
+
id: 'vscode.notebook.variable',
|
|
243
|
+
name: variable.name,
|
|
244
|
+
value: variable.value,
|
|
245
|
+
icon: codiconsLibrary.variable,
|
|
246
|
+
};
|
|
247
|
+
},
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
return result;
|
|
251
|
+
})();
|
|
252
|
+
return {
|
|
253
|
+
placeholder: ( localize(8301, 'Select a kernel variable')),
|
|
254
|
+
picks
|
|
255
|
+
};
|
|
256
|
+
}
|
|
257
|
+
};
|
|
258
|
+
KernelVariableContextPicker = ( __decorate([
|
|
259
|
+
( __param(0, IEditorService)),
|
|
260
|
+
( __param(1, INotebookKernelService))
|
|
261
|
+
], KernelVariableContextPicker));
|
|
207
262
|
registerAction2(class CopyCellOutputAction extends Action2 {
|
|
208
263
|
constructor() {
|
|
209
264
|
super({
|
|
210
265
|
id: 'notebook.cellOutput.addToChat',
|
|
211
|
-
title: ( localize(
|
|
266
|
+
title: ( localize(8302, "Add Cell Output to Chat")),
|
|
212
267
|
menu: {
|
|
213
268
|
id: MenuId.NotebookOutputToolbar,
|
|
214
269
|
when: ( ContextKeyExpr.and(
|