@codingame/monaco-vscode-notebook-service-override 4.5.1 → 5.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/package.json +2 -2
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/emptyTextEditorHint/emptyTextEditorHint.js +38 -48
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/statusBarProviders.js +24 -32
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/clipboard/notebookClipboard.js +30 -53
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/debug/notebookDebugDecorations.js +3 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/editorHint/emptyCellEditorHint.js +9 -7
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/editorStatusBar/editorStatusBar.js +43 -87
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFind.js +9 -12
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/format/formatting.js +35 -48
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/gettingStarted/notebookGettingStarted.js +13 -16
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/layout/layoutActions.js +2 -5
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/navigation/arrow.js +121 -79
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariables.js +13 -16
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesDataSource.js +8 -11
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesTree.js +25 -19
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/notebookVariables/notebookVariablesView.js +29 -30
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/outline/notebookOutline.js +107 -109
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/profile/notebookProfile.js +4 -7
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/saveParticipants/saveParticipants.js +97 -119
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/troubleshoot/layout.js +7 -18
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions.js +199 -196
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/executeActions.js +132 -145
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/insertCellActions.js +70 -130
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/layoutActions.js +32 -92
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/sectionActions.js +39 -64
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffComponents.js +13 -8
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementOutputs.js +28 -43
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementViewModel.js +7 -7
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffNestedCellViewModel.js +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffActions.js +23 -66
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditor.js +58 -57
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebook.contribution.js +200 -278
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookAccessibility.js +33 -36
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookExtensionPoint.js +58 -153
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookEditorServiceImpl.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookExecutionServiceImpl.js +15 -14
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookExecutionStateServiceImpl.js +5 -5
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKernelHistoryServiceImpl.js +13 -16
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKernelServiceImpl.js +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookKeymapServiceImpl.js +22 -29
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookLoggingServiceImpl.js +5 -8
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookServiceImpl.js +100 -92
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookWorkerServiceImpl.js +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/common/model/cellEdit.js +4 -4
- package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookTextModel.js +11 -6
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookDiffEditorInput.js +6 -2
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorModelResolverServiceImpl.js +6 -4
- package/vscode/src/vs/workbench/contrib/notebook/common/services/notebookSimpleWorker.js +1 -1
- package/vscode/src/vs/workbench/services/workingCopy/common/fileWorkingCopyManager.js +42 -77
- package/vscode/src/vs/workbench/services/workingCopy/common/storedFileWorkingCopyManager.js +43 -46
- package/vscode/src/vs/workbench/services/workingCopy/common/untitledFileWorkingCopy.js +1 -1
|
@@ -4,28 +4,32 @@ import { EditorContextKeys } from 'vscode/vscode/vs/editor/common/editorContextK
|
|
|
4
4
|
import { localize2WithPath, localizeWithPath } from 'vscode/vscode/vs/nls';
|
|
5
5
|
import { CONTEXT_ACCESSIBILITY_MODE_ENABLED } from 'vscode/vscode/vs/platform/accessibility/common/accessibility';
|
|
6
6
|
import { registerAction2, MenuId, MenuRegistry } from 'vscode/vscode/vs/platform/actions/common/actions';
|
|
7
|
+
import { ICommandService } from 'vscode/vscode/vs/platform/commands/common/commands.service';
|
|
8
|
+
import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration.service';
|
|
7
9
|
import { ContextKeyExpr } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
|
|
8
10
|
import { InputFocusedContextKey } from 'vscode/vscode/vs/platform/contextkey/common/contextkeys';
|
|
9
11
|
import { CTX_INLINE_CHAT_FOCUSED, CTX_INLINE_CHAT_INNER_CURSOR_FIRST, CTX_INLINE_CHAT_INNER_CURSOR_LAST, CTX_INLINE_CHAT_RESPONSE_TYPES, CTX_INLINE_CHAT_LAST_RESPONSE_TYPE, CTX_INLINE_CHAT_HAS_PROVIDER } from 'vscode/vscode/vs/workbench/contrib/inlineChat/common/inlineChat';
|
|
10
12
|
import { CTX_NOTEBOOK_CELL_CHAT_FOCUSED, MENU_CELL_CHAT_INPUT, CTX_NOTEBOOK_CHAT_HAS_ACTIVE_REQUEST, MENU_CELL_CHAT_WIDGET, CTX_NOTEBOOK_CHAT_USER_DID_EDIT, CTX_NOTEBOOK_CHAT_OUTER_FOCUS_POSITION, MENU_CELL_CHAT_WIDGET_STATUS, MENU_CELL_CHAT_WIDGET_FEEDBACK } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/controller/chat/notebookChatContext';
|
|
11
13
|
import { NotebookChatController } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/controller/chat/notebookChatController';
|
|
12
14
|
import { NotebookAction, NotebookCellAction, getEditorFromArgsOrActivePane, CELL_TITLE_CELL_GROUP_ID } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/controller/coreActions';
|
|
15
|
+
import { insertNewCell } from '../insertCellActions.js';
|
|
13
16
|
import { CellEditState } from 'vscode/vscode/vs/workbench/contrib/notebook/browser/notebookBrowser';
|
|
14
17
|
import { CellKind, NOTEBOOK_EDITOR_CURSOR_BOUNDARY, NotebookSetting } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
|
|
15
18
|
import { NOTEBOOK_CELL_EDITOR_FOCUSED, NOTEBOOK_EDITOR_FOCUSED, NOTEBOOK_EDITOR_EDITABLE, NOTEBOOK_CELL_GENERATED_BY_CHAT } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookContextKeys';
|
|
16
19
|
|
|
20
|
+
const _moduleId = "vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions";
|
|
17
21
|
registerAction2(class extends NotebookAction {
|
|
18
22
|
constructor() {
|
|
19
23
|
super({
|
|
20
24
|
id: 'notebook.cell.chat.accept',
|
|
21
|
-
title: ( localize2WithPath(
|
|
22
|
-
'vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions',
|
|
23
|
-
'notebook.cell.chat.accept',
|
|
24
|
-
"Make Request"
|
|
25
|
-
)),
|
|
25
|
+
title: ( localize2WithPath(_moduleId, 0, "Make Request")),
|
|
26
26
|
icon: Codicon.send,
|
|
27
27
|
keybinding: {
|
|
28
|
-
when: ( ContextKeyExpr.and(
|
|
28
|
+
when: ( (ContextKeyExpr.and(
|
|
29
|
+
CTX_NOTEBOOK_CELL_CHAT_FOCUSED,
|
|
30
|
+
CTX_INLINE_CHAT_FOCUSED,
|
|
31
|
+
(NOTEBOOK_CELL_EDITOR_FOCUSED.negate())
|
|
32
|
+
))),
|
|
29
33
|
weight: 200 ,
|
|
30
34
|
primary: 3
|
|
31
35
|
},
|
|
@@ -33,8 +37,9 @@ registerAction2(class extends NotebookAction {
|
|
|
33
37
|
id: MENU_CELL_CHAT_INPUT,
|
|
34
38
|
group: 'navigation',
|
|
35
39
|
order: 1,
|
|
36
|
-
when: ( CTX_NOTEBOOK_CHAT_HAS_ACTIVE_REQUEST.negate())
|
|
37
|
-
}
|
|
40
|
+
when: ( (CTX_NOTEBOOK_CHAT_HAS_ACTIVE_REQUEST.negate()))
|
|
41
|
+
},
|
|
42
|
+
f1: false
|
|
38
43
|
});
|
|
39
44
|
}
|
|
40
45
|
async runWithContext(accessor, context) {
|
|
@@ -45,22 +50,19 @@ registerAction2(class extends NotebookCellAction {
|
|
|
45
50
|
constructor() {
|
|
46
51
|
super({
|
|
47
52
|
id: 'notebook.cell.chat.arrowOutUp',
|
|
48
|
-
title: ( localizeWithPath(
|
|
49
|
-
'vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions',
|
|
50
|
-
'arrowUp',
|
|
51
|
-
'Cursor Up'
|
|
52
|
-
)),
|
|
53
|
+
title: ( localizeWithPath(_moduleId, 1, 'Cursor Up')),
|
|
53
54
|
keybinding: {
|
|
54
|
-
when: ( ContextKeyExpr.and(
|
|
55
|
+
when: ( (ContextKeyExpr.and(
|
|
55
56
|
CTX_NOTEBOOK_CELL_CHAT_FOCUSED,
|
|
56
57
|
CTX_INLINE_CHAT_FOCUSED,
|
|
57
58
|
CTX_INLINE_CHAT_INNER_CURSOR_FIRST,
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
)),
|
|
59
|
+
(NOTEBOOK_CELL_EDITOR_FOCUSED.negate()),
|
|
60
|
+
(CONTEXT_ACCESSIBILITY_MODE_ENABLED.negate())
|
|
61
|
+
))),
|
|
61
62
|
weight: 0 + 7,
|
|
62
63
|
primary: 2048 | 16
|
|
63
|
-
}
|
|
64
|
+
},
|
|
65
|
+
f1: false
|
|
64
66
|
});
|
|
65
67
|
}
|
|
66
68
|
async runWithContext(accessor, context) {
|
|
@@ -83,22 +85,19 @@ registerAction2(class extends NotebookAction {
|
|
|
83
85
|
constructor() {
|
|
84
86
|
super({
|
|
85
87
|
id: 'notebook.cell.chat.arrowOutDown',
|
|
86
|
-
title: ( localizeWithPath(
|
|
87
|
-
'vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions',
|
|
88
|
-
'arrowDown',
|
|
89
|
-
'Cursor Down'
|
|
90
|
-
)),
|
|
88
|
+
title: ( localizeWithPath(_moduleId, 2, 'Cursor Down')),
|
|
91
89
|
keybinding: {
|
|
92
|
-
when: ( ContextKeyExpr.and(
|
|
90
|
+
when: ( (ContextKeyExpr.and(
|
|
93
91
|
CTX_NOTEBOOK_CELL_CHAT_FOCUSED,
|
|
94
92
|
CTX_INLINE_CHAT_FOCUSED,
|
|
95
93
|
CTX_INLINE_CHAT_INNER_CURSOR_LAST,
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
)),
|
|
94
|
+
(NOTEBOOK_CELL_EDITOR_FOCUSED.negate()),
|
|
95
|
+
(CONTEXT_ACCESSIBILITY_MODE_ENABLED.negate())
|
|
96
|
+
))),
|
|
99
97
|
weight: 0 + 7,
|
|
100
98
|
primary: 2048 | 18
|
|
101
|
-
}
|
|
99
|
+
},
|
|
100
|
+
f1: false
|
|
102
101
|
});
|
|
103
102
|
}
|
|
104
103
|
async runWithContext(accessor, context) {
|
|
@@ -109,16 +108,23 @@ registerAction2(class extends NotebookCellAction {
|
|
|
109
108
|
constructor() {
|
|
110
109
|
super({
|
|
111
110
|
id: 'notebook.cell.focusChatWidget',
|
|
112
|
-
title: ( localizeWithPath(
|
|
113
|
-
'vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions',
|
|
114
|
-
'focusChatWidget',
|
|
115
|
-
'Focus Chat Widget'
|
|
116
|
-
)),
|
|
111
|
+
title: ( localizeWithPath(_moduleId, 3, 'Focus Chat Widget')),
|
|
117
112
|
keybinding: {
|
|
118
|
-
when: (
|
|
113
|
+
when: ( (ContextKeyExpr.and(
|
|
114
|
+
NOTEBOOK_EDITOR_FOCUSED,
|
|
115
|
+
(CONTEXT_ACCESSIBILITY_MODE_ENABLED.negate()),
|
|
116
|
+
(ContextKeyExpr.and(
|
|
117
|
+
(ContextKeyExpr.has(InputFocusedContextKey)),
|
|
118
|
+
EditorContextKeys.editorTextFocus,
|
|
119
|
+
(NOTEBOOK_EDITOR_CURSOR_BOUNDARY.notEqualsTo('bottom')),
|
|
120
|
+
(NOTEBOOK_EDITOR_CURSOR_BOUNDARY.notEqualsTo('none'))
|
|
121
|
+
)),
|
|
122
|
+
(EditorContextKeys.isEmbeddedDiffEditor.negate())
|
|
123
|
+
))),
|
|
119
124
|
weight: 0 + 7,
|
|
120
125
|
primary: 2048 | 16
|
|
121
|
-
}
|
|
126
|
+
},
|
|
127
|
+
f1: false
|
|
122
128
|
});
|
|
123
129
|
}
|
|
124
130
|
async runWithContext(accessor, context) {
|
|
@@ -130,16 +136,23 @@ registerAction2(class extends NotebookCellAction {
|
|
|
130
136
|
constructor() {
|
|
131
137
|
super({
|
|
132
138
|
id: 'notebook.cell.focusNextChatWidget',
|
|
133
|
-
title: ( localizeWithPath(
|
|
134
|
-
'vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions',
|
|
135
|
-
'focusNextChatWidget',
|
|
136
|
-
'Focus Next Cell Chat Widget'
|
|
137
|
-
)),
|
|
139
|
+
title: ( localizeWithPath(_moduleId, 4, 'Focus Next Cell Chat Widget')),
|
|
138
140
|
keybinding: {
|
|
139
|
-
when: (
|
|
141
|
+
when: ( (ContextKeyExpr.and(
|
|
142
|
+
NOTEBOOK_EDITOR_FOCUSED,
|
|
143
|
+
(CONTEXT_ACCESSIBILITY_MODE_ENABLED.negate()),
|
|
144
|
+
(ContextKeyExpr.and(
|
|
145
|
+
(ContextKeyExpr.has(InputFocusedContextKey)),
|
|
146
|
+
EditorContextKeys.editorTextFocus,
|
|
147
|
+
(NOTEBOOK_EDITOR_CURSOR_BOUNDARY.notEqualsTo('top')),
|
|
148
|
+
(NOTEBOOK_EDITOR_CURSOR_BOUNDARY.notEqualsTo('none'))
|
|
149
|
+
)),
|
|
150
|
+
(EditorContextKeys.isEmbeddedDiffEditor.negate())
|
|
151
|
+
))),
|
|
140
152
|
weight: 0 + 7,
|
|
141
153
|
primary: 2048 | 18
|
|
142
|
-
}
|
|
154
|
+
},
|
|
155
|
+
f1: false
|
|
143
156
|
});
|
|
144
157
|
}
|
|
145
158
|
async runWithContext(accessor, context) {
|
|
@@ -151,18 +164,15 @@ registerAction2(class extends NotebookAction {
|
|
|
151
164
|
constructor() {
|
|
152
165
|
super({
|
|
153
166
|
id: 'notebook.cell.chat.stop',
|
|
154
|
-
title: ( localize2WithPath(
|
|
155
|
-
'vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions',
|
|
156
|
-
'notebook.cell.chat.stop',
|
|
157
|
-
"Stop Request"
|
|
158
|
-
)),
|
|
167
|
+
title: ( localize2WithPath(_moduleId, 5, "Stop Request")),
|
|
159
168
|
icon: Codicon.debugStop,
|
|
160
169
|
menu: {
|
|
161
170
|
id: MENU_CELL_CHAT_INPUT,
|
|
162
171
|
group: 'navigation',
|
|
163
172
|
order: 1,
|
|
164
173
|
when: CTX_NOTEBOOK_CHAT_HAS_ACTIVE_REQUEST
|
|
165
|
-
}
|
|
174
|
+
},
|
|
175
|
+
f1: false
|
|
166
176
|
});
|
|
167
177
|
}
|
|
168
178
|
async runWithContext(accessor, context) {
|
|
@@ -173,17 +183,14 @@ registerAction2(class extends NotebookAction {
|
|
|
173
183
|
constructor() {
|
|
174
184
|
super({
|
|
175
185
|
id: 'notebook.cell.chat.close',
|
|
176
|
-
title: ( localize2WithPath(
|
|
177
|
-
'vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions',
|
|
178
|
-
'notebook.cell.chat.close',
|
|
179
|
-
"Close Chat"
|
|
180
|
-
)),
|
|
186
|
+
title: ( localize2WithPath(_moduleId, 6, "Close Chat")),
|
|
181
187
|
icon: Codicon.close,
|
|
182
188
|
menu: {
|
|
183
189
|
id: MENU_CELL_CHAT_WIDGET,
|
|
184
190
|
group: 'navigation',
|
|
185
191
|
order: 2
|
|
186
|
-
}
|
|
192
|
+
},
|
|
193
|
+
f1: false
|
|
187
194
|
});
|
|
188
195
|
}
|
|
189
196
|
async runWithContext(accessor, context) {
|
|
@@ -194,45 +201,37 @@ registerAction2(class extends NotebookAction {
|
|
|
194
201
|
constructor() {
|
|
195
202
|
super({
|
|
196
203
|
id: 'notebook.cell.chat.acceptChanges',
|
|
197
|
-
title: ( localize2WithPath(
|
|
198
|
-
|
|
199
|
-
'apply1',
|
|
200
|
-
"Accept Changes"
|
|
201
|
-
)),
|
|
202
|
-
shortTitle: ( localizeWithPath(
|
|
203
|
-
'vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions',
|
|
204
|
-
'apply2',
|
|
205
|
-
'Accept'
|
|
206
|
-
)),
|
|
204
|
+
title: ( localize2WithPath(_moduleId, 7, "Accept Changes")),
|
|
205
|
+
shortTitle: ( localizeWithPath(_moduleId, 8, 'Accept')),
|
|
207
206
|
icon: Codicon.check,
|
|
208
|
-
tooltip: ( localizeWithPath(
|
|
209
|
-
'vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions',
|
|
210
|
-
'apply3',
|
|
211
|
-
'Accept Changes'
|
|
212
|
-
)),
|
|
207
|
+
tooltip: ( localizeWithPath(_moduleId, 9, 'Accept Changes')),
|
|
213
208
|
keybinding: [
|
|
214
209
|
{
|
|
215
|
-
when: ( ContextKeyExpr.and(
|
|
210
|
+
when: ( (ContextKeyExpr.and(
|
|
211
|
+
CTX_NOTEBOOK_CELL_CHAT_FOCUSED,
|
|
212
|
+
CTX_INLINE_CHAT_FOCUSED,
|
|
213
|
+
(NOTEBOOK_CELL_EDITOR_FOCUSED.negate())
|
|
214
|
+
))),
|
|
216
215
|
weight: 100 + 10,
|
|
217
216
|
primary: 2048 | 3 ,
|
|
218
217
|
},
|
|
219
218
|
{
|
|
220
|
-
when: ( ContextKeyExpr.and(
|
|
219
|
+
when: ( (ContextKeyExpr.and(
|
|
221
220
|
CTX_NOTEBOOK_CELL_CHAT_FOCUSED,
|
|
222
221
|
CTX_INLINE_CHAT_FOCUSED,
|
|
223
222
|
CTX_NOTEBOOK_CHAT_USER_DID_EDIT,
|
|
224
|
-
|
|
225
|
-
)),
|
|
223
|
+
(NOTEBOOK_CELL_EDITOR_FOCUSED.negate())
|
|
224
|
+
))),
|
|
226
225
|
weight: 0 + 10,
|
|
227
226
|
primary: 9
|
|
228
227
|
},
|
|
229
228
|
{
|
|
230
|
-
when: ( ContextKeyExpr.and(
|
|
229
|
+
when: ( (ContextKeyExpr.and(
|
|
231
230
|
NOTEBOOK_EDITOR_FOCUSED,
|
|
232
231
|
ContextKeyExpr.not(InputFocusedContextKey),
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
)),
|
|
232
|
+
(NOTEBOOK_CELL_EDITOR_FOCUSED.negate()),
|
|
233
|
+
(CTX_NOTEBOOK_CHAT_OUTER_FOCUS_POSITION.isEqualTo('below'))
|
|
234
|
+
))),
|
|
236
235
|
primary: 2048 | 3 ,
|
|
237
236
|
weight: 200
|
|
238
237
|
}
|
|
@@ -242,9 +241,10 @@ registerAction2(class extends NotebookAction {
|
|
|
242
241
|
id: MENU_CELL_CHAT_WIDGET_STATUS,
|
|
243
242
|
group: 'inline',
|
|
244
243
|
order: 0,
|
|
245
|
-
when: ( CTX_INLINE_CHAT_RESPONSE_TYPES.notEqualsTo("onlyMessages" )),
|
|
244
|
+
when: ( (CTX_INLINE_CHAT_RESPONSE_TYPES.notEqualsTo("onlyMessages" ))),
|
|
246
245
|
}
|
|
247
|
-
]
|
|
246
|
+
],
|
|
247
|
+
f1: false
|
|
248
248
|
});
|
|
249
249
|
}
|
|
250
250
|
async runWithContext(accessor, context) {
|
|
@@ -255,14 +255,15 @@ registerAction2(class extends NotebookAction {
|
|
|
255
255
|
constructor() {
|
|
256
256
|
super({
|
|
257
257
|
id: 'notebook.cell.chat.discard',
|
|
258
|
-
title: ( localizeWithPath(
|
|
259
|
-
'vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions',
|
|
260
|
-
'discard',
|
|
261
|
-
'Discard'
|
|
262
|
-
)),
|
|
258
|
+
title: ( localizeWithPath(_moduleId, 10, 'Discard')),
|
|
263
259
|
icon: Codicon.discard,
|
|
264
260
|
keybinding: {
|
|
265
|
-
when: ( ContextKeyExpr.and(
|
|
261
|
+
when: ( (ContextKeyExpr.and(
|
|
262
|
+
CTX_NOTEBOOK_CELL_CHAT_FOCUSED,
|
|
263
|
+
CTX_INLINE_CHAT_FOCUSED,
|
|
264
|
+
(CTX_NOTEBOOK_CHAT_USER_DID_EDIT.negate()),
|
|
265
|
+
(NOTEBOOK_CELL_EDITOR_FOCUSED.negate())
|
|
266
|
+
))),
|
|
266
267
|
weight: 100 ,
|
|
267
268
|
primary: 9
|
|
268
269
|
},
|
|
@@ -270,7 +271,8 @@ registerAction2(class extends NotebookAction {
|
|
|
270
271
|
id: MENU_CELL_CHAT_WIDGET_STATUS,
|
|
271
272
|
group: 'main',
|
|
272
273
|
order: 1
|
|
273
|
-
}
|
|
274
|
+
},
|
|
275
|
+
f1: false
|
|
274
276
|
});
|
|
275
277
|
}
|
|
276
278
|
async runWithContext(accessor, context) {
|
|
@@ -281,18 +283,15 @@ registerAction2(class extends NotebookAction {
|
|
|
281
283
|
constructor() {
|
|
282
284
|
super({
|
|
283
285
|
id: 'notebook.cell.feedbackHelpful',
|
|
284
|
-
title: ( localizeWithPath(
|
|
285
|
-
'vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions',
|
|
286
|
-
'feedback.helpful',
|
|
287
|
-
'Helpful'
|
|
288
|
-
)),
|
|
286
|
+
title: ( localizeWithPath(_moduleId, 11, 'Helpful')),
|
|
289
287
|
icon: Codicon.thumbsup,
|
|
290
288
|
menu: {
|
|
291
289
|
id: MENU_CELL_CHAT_WIDGET_FEEDBACK,
|
|
292
290
|
group: 'inline',
|
|
293
291
|
order: 1,
|
|
294
|
-
when: ( CTX_INLINE_CHAT_LAST_RESPONSE_TYPE.notEqualsTo(undefined)),
|
|
295
|
-
}
|
|
292
|
+
when: ( (CTX_INLINE_CHAT_LAST_RESPONSE_TYPE.notEqualsTo(undefined))),
|
|
293
|
+
},
|
|
294
|
+
f1: false
|
|
296
295
|
});
|
|
297
296
|
}
|
|
298
297
|
async runWithContext(accessor, context) {
|
|
@@ -303,18 +302,15 @@ registerAction2(class extends NotebookAction {
|
|
|
303
302
|
constructor() {
|
|
304
303
|
super({
|
|
305
304
|
id: 'notebook.cell.feedbackUnhelpful',
|
|
306
|
-
title: ( localizeWithPath(
|
|
307
|
-
'vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions',
|
|
308
|
-
'feedback.unhelpful',
|
|
309
|
-
'Unhelpful'
|
|
310
|
-
)),
|
|
305
|
+
title: ( localizeWithPath(_moduleId, 12, 'Unhelpful')),
|
|
311
306
|
icon: Codicon.thumbsdown,
|
|
312
307
|
menu: {
|
|
313
308
|
id: MENU_CELL_CHAT_WIDGET_FEEDBACK,
|
|
314
309
|
group: 'inline',
|
|
315
310
|
order: 2,
|
|
316
|
-
when: ( CTX_INLINE_CHAT_LAST_RESPONSE_TYPE.notEqualsTo(undefined)),
|
|
317
|
-
}
|
|
311
|
+
when: ( (CTX_INLINE_CHAT_LAST_RESPONSE_TYPE.notEqualsTo(undefined))),
|
|
312
|
+
},
|
|
313
|
+
f1: false
|
|
318
314
|
});
|
|
319
315
|
}
|
|
320
316
|
async runWithContext(accessor, context) {
|
|
@@ -325,47 +321,53 @@ registerAction2(class extends NotebookAction {
|
|
|
325
321
|
constructor() {
|
|
326
322
|
super({
|
|
327
323
|
id: 'notebook.cell.reportIssueForBug',
|
|
328
|
-
title: ( localizeWithPath(
|
|
329
|
-
'vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions',
|
|
330
|
-
'feedback.reportIssueForBug',
|
|
331
|
-
'Report Issue'
|
|
332
|
-
)),
|
|
324
|
+
title: ( localizeWithPath(_moduleId, 13, 'Report Issue')),
|
|
333
325
|
icon: Codicon.report,
|
|
334
326
|
menu: {
|
|
335
327
|
id: MENU_CELL_CHAT_WIDGET_FEEDBACK,
|
|
336
328
|
group: 'inline',
|
|
337
329
|
order: 3,
|
|
338
|
-
when: ( CTX_INLINE_CHAT_LAST_RESPONSE_TYPE.notEqualsTo(undefined)),
|
|
339
|
-
}
|
|
330
|
+
when: ( (CTX_INLINE_CHAT_LAST_RESPONSE_TYPE.notEqualsTo(undefined))),
|
|
331
|
+
},
|
|
332
|
+
f1: false
|
|
340
333
|
});
|
|
341
334
|
}
|
|
342
335
|
async runWithContext(accessor, context) {
|
|
343
336
|
NotebookChatController.get(context.notebookEditor)?.feedbackLast(4 );
|
|
344
337
|
}
|
|
345
338
|
});
|
|
339
|
+
async function startChat(accessor, context, index, input, autoSend, source) {
|
|
340
|
+
const configurationService = accessor.get(IConfigurationService);
|
|
341
|
+
const commandService = accessor.get(ICommandService);
|
|
342
|
+
if (configurationService.getValue(NotebookSetting.cellChat)) {
|
|
343
|
+
context.notebookEditor.focusContainer();
|
|
344
|
+
NotebookChatController.get(context.notebookEditor)?.run(index, input, autoSend);
|
|
345
|
+
}
|
|
346
|
+
else if (configurationService.getValue(NotebookSetting.cellGenerate)) {
|
|
347
|
+
const activeCell = context.notebookEditor.getActiveCell();
|
|
348
|
+
const targetCell = activeCell?.getTextLength() === 0 && source !== 'insertToolbar' ? activeCell : (await insertNewCell(accessor, context, CellKind.Code, 'below'));
|
|
349
|
+
if (targetCell) {
|
|
350
|
+
targetCell.enableAutoLanguageDetection();
|
|
351
|
+
await context.notebookEditor.revealFirstLineIfOutsideViewport(targetCell);
|
|
352
|
+
const codeEditor = context.notebookEditor.codeEditors.find(ce => ce[0] === targetCell)?.[1];
|
|
353
|
+
if (codeEditor) {
|
|
354
|
+
codeEditor.focus();
|
|
355
|
+
commandService.executeCommand('inlineChat.start');
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
}
|
|
346
360
|
registerAction2(class extends NotebookAction {
|
|
347
361
|
constructor() {
|
|
348
362
|
super({
|
|
349
363
|
id: 'notebook.cell.chat.start',
|
|
350
364
|
title: {
|
|
351
|
-
value: '$(sparkle) ' + ( localizeWithPath(
|
|
352
|
-
'vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions',
|
|
353
|
-
'notebookActions.menu.insertCodeCellWithChat',
|
|
354
|
-
"Generate"
|
|
355
|
-
)),
|
|
365
|
+
value: '$(sparkle) ' + ( localizeWithPath(_moduleId, 14, "Generate")),
|
|
356
366
|
original: '$(sparkle) Generate',
|
|
357
367
|
},
|
|
358
|
-
tooltip: ( localizeWithPath(
|
|
359
|
-
'vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions',
|
|
360
|
-
'notebookActions.menu.insertCodeCellWithChat.tooltip',
|
|
361
|
-
"Start Chat to Generate Code"
|
|
362
|
-
)),
|
|
368
|
+
tooltip: ( localizeWithPath(_moduleId, 15, "Start Chat to Generate Code")),
|
|
363
369
|
metadata: {
|
|
364
|
-
description: ( localizeWithPath(
|
|
365
|
-
'vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions',
|
|
366
|
-
'notebookActions.menu.insertCodeCellWithChat.tooltip',
|
|
367
|
-
"Start Chat to Generate Code"
|
|
368
|
-
)),
|
|
370
|
+
description: ( localizeWithPath(_moduleId, 15, "Start Chat to Generate Code")),
|
|
369
371
|
args: [
|
|
370
372
|
{
|
|
371
373
|
name: 'args',
|
|
@@ -389,7 +391,16 @@ registerAction2(class extends NotebookAction {
|
|
|
389
391
|
},
|
|
390
392
|
f1: false,
|
|
391
393
|
keybinding: {
|
|
392
|
-
when: ( ContextKeyExpr.and(
|
|
394
|
+
when: ( (ContextKeyExpr.and(
|
|
395
|
+
NOTEBOOK_EDITOR_FOCUSED,
|
|
396
|
+
(NOTEBOOK_EDITOR_EDITABLE.isEqualTo(true)),
|
|
397
|
+
ContextKeyExpr.not(InputFocusedContextKey),
|
|
398
|
+
CTX_INLINE_CHAT_HAS_PROVIDER,
|
|
399
|
+
(ContextKeyExpr.or(
|
|
400
|
+
(ContextKeyExpr.equals(`config.${NotebookSetting.cellChat}`, true)),
|
|
401
|
+
(ContextKeyExpr.equals(`config.${NotebookSetting.cellGenerate}`, true))
|
|
402
|
+
))
|
|
403
|
+
))),
|
|
393
404
|
weight: 200 ,
|
|
394
405
|
primary: 2048 | 39 ,
|
|
395
406
|
secondary: [KeyChord(2048 | 41 , 39 )],
|
|
@@ -399,7 +410,14 @@ registerAction2(class extends NotebookAction {
|
|
|
399
410
|
id: MenuId.NotebookCellBetween,
|
|
400
411
|
group: 'inline',
|
|
401
412
|
order: -1,
|
|
402
|
-
when: ( ContextKeyExpr.and(
|
|
413
|
+
when: ( (ContextKeyExpr.and(
|
|
414
|
+
(NOTEBOOK_EDITOR_EDITABLE.isEqualTo(true)),
|
|
415
|
+
CTX_INLINE_CHAT_HAS_PROVIDER,
|
|
416
|
+
(ContextKeyExpr.or(
|
|
417
|
+
(ContextKeyExpr.equals(`config.${NotebookSetting.cellChat}`, true)),
|
|
418
|
+
(ContextKeyExpr.equals(`config.${NotebookSetting.cellGenerate}`, true))
|
|
419
|
+
))
|
|
420
|
+
)))
|
|
403
421
|
}
|
|
404
422
|
]
|
|
405
423
|
});
|
|
@@ -439,8 +457,7 @@ registerAction2(class extends NotebookAction {
|
|
|
439
457
|
}
|
|
440
458
|
async runWithContext(accessor, context) {
|
|
441
459
|
const index = Math.max(0, context.cell ? context.notebookEditor.getCellIndex(context.cell) + 1 : 0);
|
|
442
|
-
context.
|
|
443
|
-
NotebookChatController.get(context.notebookEditor)?.run(index, context.input, context.autoSend);
|
|
460
|
+
await startChat(accessor, context, index, context.input, context.autoSend, context.source);
|
|
444
461
|
}
|
|
445
462
|
});
|
|
446
463
|
registerAction2(class extends NotebookAction {
|
|
@@ -448,82 +465,78 @@ registerAction2(class extends NotebookAction {
|
|
|
448
465
|
super({
|
|
449
466
|
id: 'notebook.cell.chat.startAtTop',
|
|
450
467
|
title: {
|
|
451
|
-
value: '$(sparkle) ' + ( localizeWithPath(
|
|
452
|
-
'vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions',
|
|
453
|
-
'notebookActions.menu.insertCodeCellWithChat',
|
|
454
|
-
"Generate"
|
|
455
|
-
)),
|
|
468
|
+
value: '$(sparkle) ' + ( localizeWithPath(_moduleId, 14, "Generate")),
|
|
456
469
|
original: '$(sparkle) Generate',
|
|
457
470
|
},
|
|
458
|
-
tooltip: ( localizeWithPath(
|
|
459
|
-
'vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions',
|
|
460
|
-
'notebookActions.menu.insertCodeCellWithChat.tooltip',
|
|
461
|
-
"Start Chat to Generate Code"
|
|
462
|
-
)),
|
|
471
|
+
tooltip: ( localizeWithPath(_moduleId, 15, "Start Chat to Generate Code")),
|
|
463
472
|
f1: false,
|
|
464
473
|
menu: [
|
|
465
474
|
{
|
|
466
475
|
id: MenuId.NotebookCellListTop,
|
|
467
476
|
group: 'inline',
|
|
468
477
|
order: -1,
|
|
469
|
-
when: ( ContextKeyExpr.and(
|
|
478
|
+
when: ( (ContextKeyExpr.and(
|
|
479
|
+
(NOTEBOOK_EDITOR_EDITABLE.isEqualTo(true)),
|
|
480
|
+
CTX_INLINE_CHAT_HAS_PROVIDER,
|
|
481
|
+
(ContextKeyExpr.or(
|
|
482
|
+
(ContextKeyExpr.equals(`config.${NotebookSetting.cellChat}`, true)),
|
|
483
|
+
(ContextKeyExpr.equals(`config.${NotebookSetting.cellGenerate}`, true))
|
|
484
|
+
))
|
|
485
|
+
)))
|
|
470
486
|
},
|
|
471
487
|
]
|
|
472
488
|
});
|
|
473
489
|
}
|
|
474
490
|
async runWithContext(accessor, context) {
|
|
475
|
-
context
|
|
476
|
-
NotebookChatController.get(context.notebookEditor)?.run(0, '', false);
|
|
491
|
+
await startChat(accessor, context, 0, '', false);
|
|
477
492
|
}
|
|
478
493
|
});
|
|
479
494
|
MenuRegistry.appendMenuItem(MenuId.NotebookToolbar, {
|
|
480
495
|
command: {
|
|
481
496
|
id: 'notebook.cell.chat.start',
|
|
482
497
|
icon: Codicon.sparkle,
|
|
483
|
-
title: ( localizeWithPath(
|
|
484
|
-
|
|
485
|
-
'notebookActions.menu.insertCode.ontoolbar',
|
|
486
|
-
"Generate"
|
|
487
|
-
)),
|
|
488
|
-
tooltip: ( localizeWithPath(
|
|
489
|
-
'vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions',
|
|
490
|
-
'notebookActions.menu.insertCode.tooltip',
|
|
491
|
-
"Start Chat to Generate Code"
|
|
492
|
-
))
|
|
498
|
+
title: ( localizeWithPath(_moduleId, 16, "Generate")),
|
|
499
|
+
tooltip: ( localizeWithPath(_moduleId, 17, "Start Chat to Generate Code"))
|
|
493
500
|
},
|
|
494
501
|
order: -10,
|
|
495
502
|
group: 'navigation/add',
|
|
496
|
-
when: ( ContextKeyExpr.and(
|
|
503
|
+
when: ( (ContextKeyExpr.and(
|
|
504
|
+
(NOTEBOOK_EDITOR_EDITABLE.isEqualTo(true)),
|
|
505
|
+
(ContextKeyExpr.notEquals('config.notebook.insertToolbarLocation', 'betweenCells')),
|
|
506
|
+
(ContextKeyExpr.notEquals('config.notebook.insertToolbarLocation', 'hidden')),
|
|
507
|
+
CTX_INLINE_CHAT_HAS_PROVIDER,
|
|
508
|
+
(ContextKeyExpr.or(
|
|
509
|
+
(ContextKeyExpr.equals(`config.${NotebookSetting.cellChat}`, true)),
|
|
510
|
+
(ContextKeyExpr.equals(`config.${NotebookSetting.cellGenerate}`, true))
|
|
511
|
+
))
|
|
512
|
+
)))
|
|
497
513
|
});
|
|
498
514
|
registerAction2(class extends NotebookAction {
|
|
499
515
|
constructor() {
|
|
500
516
|
super({
|
|
501
517
|
id: 'notebook.cell.chat.focus',
|
|
502
|
-
title: ( localizeWithPath(
|
|
503
|
-
'vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions',
|
|
504
|
-
'focusNotebookChat',
|
|
505
|
-
'Focus Chat'
|
|
506
|
-
)),
|
|
518
|
+
title: ( localizeWithPath(_moduleId, 18, 'Focus Chat')),
|
|
507
519
|
keybinding: [
|
|
508
520
|
{
|
|
509
|
-
when: ( ContextKeyExpr.and(
|
|
521
|
+
when: ( (ContextKeyExpr.and(
|
|
510
522
|
NOTEBOOK_EDITOR_FOCUSED,
|
|
511
523
|
ContextKeyExpr.not(InputFocusedContextKey),
|
|
512
|
-
|
|
513
|
-
)),
|
|
524
|
+
(CTX_NOTEBOOK_CHAT_OUTER_FOCUS_POSITION.isEqualTo('above'))
|
|
525
|
+
))),
|
|
514
526
|
primary: 2048 | 18 ,
|
|
515
527
|
weight: 200
|
|
516
528
|
},
|
|
517
529
|
{
|
|
518
|
-
when: ( ContextKeyExpr.and(
|
|
530
|
+
when: ( (ContextKeyExpr.and(
|
|
519
531
|
NOTEBOOK_EDITOR_FOCUSED,
|
|
520
532
|
ContextKeyExpr.not(InputFocusedContextKey),
|
|
521
|
-
|
|
522
|
-
)),
|
|
533
|
+
(CTX_NOTEBOOK_CHAT_OUTER_FOCUS_POSITION.isEqualTo('below'))
|
|
534
|
+
))),
|
|
523
535
|
primary: 2048 | 16 ,
|
|
524
536
|
weight: 200
|
|
525
537
|
}
|
|
526
538
|
],
|
|
539
|
+
f1: false
|
|
527
540
|
});
|
|
528
541
|
}
|
|
529
542
|
async runWithContext(accessor, context) {
|
|
@@ -534,18 +547,15 @@ registerAction2(class extends NotebookAction {
|
|
|
534
547
|
constructor() {
|
|
535
548
|
super({
|
|
536
549
|
id: 'notebook.cell.chat.focusNextCell',
|
|
537
|
-
title: ( localizeWithPath(
|
|
538
|
-
'vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions',
|
|
539
|
-
'focusNextCell',
|
|
540
|
-
'Focus Next Cell'
|
|
541
|
-
)),
|
|
550
|
+
title: ( localizeWithPath(_moduleId, 19, 'Focus Next Cell')),
|
|
542
551
|
keybinding: [
|
|
543
552
|
{
|
|
544
|
-
when: ( ContextKeyExpr.and(CTX_NOTEBOOK_CELL_CHAT_FOCUSED, CTX_INLINE_CHAT_FOCUSED)),
|
|
553
|
+
when: ( (ContextKeyExpr.and(CTX_NOTEBOOK_CELL_CHAT_FOCUSED, CTX_INLINE_CHAT_FOCUSED))),
|
|
545
554
|
primary: 2048 | 18 ,
|
|
546
555
|
weight: 200
|
|
547
556
|
}
|
|
548
557
|
],
|
|
558
|
+
f1: false
|
|
549
559
|
});
|
|
550
560
|
}
|
|
551
561
|
async runWithContext(accessor, context) {
|
|
@@ -556,18 +566,15 @@ registerAction2(class extends NotebookAction {
|
|
|
556
566
|
constructor() {
|
|
557
567
|
super({
|
|
558
568
|
id: 'notebook.cell.chat.focusPreviousCell',
|
|
559
|
-
title: ( localizeWithPath(
|
|
560
|
-
'vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions',
|
|
561
|
-
'focusPreviousCell',
|
|
562
|
-
'Focus Previous Cell'
|
|
563
|
-
)),
|
|
569
|
+
title: ( localizeWithPath(_moduleId, 20, 'Focus Previous Cell')),
|
|
564
570
|
keybinding: [
|
|
565
571
|
{
|
|
566
|
-
when: ( ContextKeyExpr.and(CTX_NOTEBOOK_CELL_CHAT_FOCUSED, CTX_INLINE_CHAT_FOCUSED)),
|
|
572
|
+
when: ( (ContextKeyExpr.and(CTX_NOTEBOOK_CELL_CHAT_FOCUSED, CTX_INLINE_CHAT_FOCUSED))),
|
|
567
573
|
primary: 2048 | 16 ,
|
|
568
574
|
weight: 200
|
|
569
575
|
}
|
|
570
576
|
],
|
|
577
|
+
f1: false
|
|
571
578
|
});
|
|
572
579
|
}
|
|
573
580
|
async runWithContext(accessor, context) {
|
|
@@ -578,17 +585,14 @@ registerAction2(class extends NotebookAction {
|
|
|
578
585
|
constructor() {
|
|
579
586
|
super({
|
|
580
587
|
id: 'notebook.cell.chat.previousFromHistory',
|
|
581
|
-
title: ( localize2WithPath(
|
|
582
|
-
|
|
583
|
-
'notebook.cell.chat.previousFromHistory',
|
|
584
|
-
"Previous From History"
|
|
585
|
-
)),
|
|
586
|
-
precondition: ( ContextKeyExpr.and(CTX_NOTEBOOK_CELL_CHAT_FOCUSED, CTX_INLINE_CHAT_FOCUSED)),
|
|
588
|
+
title: ( localize2WithPath(_moduleId, 21, "Previous From History")),
|
|
589
|
+
precondition: ( (ContextKeyExpr.and(CTX_NOTEBOOK_CELL_CHAT_FOCUSED, CTX_INLINE_CHAT_FOCUSED))),
|
|
587
590
|
keybinding: {
|
|
588
|
-
when: ( ContextKeyExpr.and(CTX_NOTEBOOK_CELL_CHAT_FOCUSED, CTX_INLINE_CHAT_FOCUSED)),
|
|
591
|
+
when: ( (ContextKeyExpr.and(CTX_NOTEBOOK_CELL_CHAT_FOCUSED, CTX_INLINE_CHAT_FOCUSED))),
|
|
589
592
|
weight: 0 + 10,
|
|
590
593
|
primary: 16 ,
|
|
591
|
-
}
|
|
594
|
+
},
|
|
595
|
+
f1: false
|
|
592
596
|
});
|
|
593
597
|
}
|
|
594
598
|
async runWithContext(accessor, context) {
|
|
@@ -599,17 +603,14 @@ registerAction2(class extends NotebookAction {
|
|
|
599
603
|
constructor() {
|
|
600
604
|
super({
|
|
601
605
|
id: 'notebook.cell.chat.nextFromHistory',
|
|
602
|
-
title: ( localize2WithPath(
|
|
603
|
-
|
|
604
|
-
'notebook.cell.chat.nextFromHistory',
|
|
605
|
-
"Next From History"
|
|
606
|
-
)),
|
|
607
|
-
precondition: ( ContextKeyExpr.and(CTX_NOTEBOOK_CELL_CHAT_FOCUSED, CTX_INLINE_CHAT_FOCUSED)),
|
|
606
|
+
title: ( localize2WithPath(_moduleId, 22, "Next From History")),
|
|
607
|
+
precondition: ( (ContextKeyExpr.and(CTX_NOTEBOOK_CELL_CHAT_FOCUSED, CTX_INLINE_CHAT_FOCUSED))),
|
|
608
608
|
keybinding: {
|
|
609
|
-
when: ( ContextKeyExpr.and(CTX_NOTEBOOK_CELL_CHAT_FOCUSED, CTX_INLINE_CHAT_FOCUSED)),
|
|
609
|
+
when: ( (ContextKeyExpr.and(CTX_NOTEBOOK_CELL_CHAT_FOCUSED, CTX_INLINE_CHAT_FOCUSED))),
|
|
610
610
|
weight: 0 + 10,
|
|
611
611
|
primary: 18
|
|
612
|
-
}
|
|
612
|
+
},
|
|
613
|
+
f1: false
|
|
613
614
|
});
|
|
614
615
|
}
|
|
615
616
|
async runWithContext(accessor, context) {
|
|
@@ -620,18 +621,20 @@ registerAction2(class extends NotebookCellAction {
|
|
|
620
621
|
constructor() {
|
|
621
622
|
super({
|
|
622
623
|
id: 'notebook.cell.chat.restore',
|
|
623
|
-
title: ( localize2WithPath(
|
|
624
|
-
'vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions',
|
|
625
|
-
'notebookActions.restoreCellprompt',
|
|
626
|
-
"Generate"
|
|
627
|
-
)),
|
|
624
|
+
title: ( localize2WithPath(_moduleId, 23, "Generate")),
|
|
628
625
|
icon: Codicon.sparkle,
|
|
629
626
|
menu: {
|
|
630
627
|
id: MenuId.NotebookCellTitle,
|
|
631
628
|
group: CELL_TITLE_CELL_GROUP_ID,
|
|
632
629
|
order: 0,
|
|
633
|
-
when: ( ContextKeyExpr.and(
|
|
634
|
-
|
|
630
|
+
when: ( (ContextKeyExpr.and(
|
|
631
|
+
(NOTEBOOK_EDITOR_EDITABLE.isEqualTo(true)),
|
|
632
|
+
CTX_INLINE_CHAT_HAS_PROVIDER,
|
|
633
|
+
NOTEBOOK_CELL_GENERATED_BY_CHAT,
|
|
634
|
+
(ContextKeyExpr.equals(`config.${NotebookSetting.cellChat}`, true))
|
|
635
|
+
)))
|
|
636
|
+
},
|
|
637
|
+
f1: false
|
|
635
638
|
});
|
|
636
639
|
}
|
|
637
640
|
async runWithContext(accessor, context) {
|