@codingame/monaco-vscode-chat-service-override 9.0.3 → 10.0.1
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/chat.js +8 -2
- package/package.json +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.js +24 -25
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatClearActions.js +5 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.js +100 -293
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContextActions.js +115 -26
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCopyActions.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatDeveloperActions.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatFileTreeActions.js +6 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatImportExport.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatMoveActions.js +9 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/codeBlockOperations.js +448 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chat.contribution.js +58 -43
- package/vscode/src/vs/workbench/contrib/chat/browser/chatAccessibilityService.js +2 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditor.js +7 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatGettingStarted.js +131 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatParticipantContributions.js +88 -88
- package/vscode/src/vs/workbench/contrib/chat/browser/chatPasteProviders.js +26 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatQuick.js +4 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatResponseAccessibleView.js +6 -22
- package/vscode/src/vs/workbench/contrib/chat/browser/chatVariables.js +11 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/chatViewPane.js +21 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorHover.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/editorHoverWrapper.js +7 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatCodeMapperService.js +27 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatProgressTypes/chatToolInvocation.js +52 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatServiceImpl.js +25 -29
- package/vscode/src/vs/workbench/contrib/chat/common/chatServiceTelemetry.js +8 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatWidgetHistoryService.js +1 -2
- package/vscode/src/vs/workbench/contrib/chat/common/languageModelStats.js +7 -8
- package/vscode/src/vs/workbench/contrib/chat/common/languageModelToolsService.js +70 -20
- package/vscode/src/vs/workbench/contrib/chat/common/languageModels.js +172 -0
- package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsContribution.js +30 -12
- package/vscode/src/vs/workbench/contrib/chat/common/voiceChatService.js +1 -1
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChat.contribution.js +11 -15
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAccessibilityHelp.js +1 -2
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAccessibleView.js +5 -6
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatCurrentLine.js +5 -6
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSavingServiceImpl.js +5 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatContextAttachments.js +0 -58
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputCompletions.js +0 -412
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { CancellationToken } from 'vscode/vscode/vs/base/common/cancellation';
|
|
2
2
|
import { Codicon } from 'vscode/vscode/vs/base/common/codicons';
|
|
3
|
-
import { KeyMod, KeyCode } from 'vscode/vscode/vs/base/common/keyCodes';
|
|
4
3
|
import { Schemas } from 'vscode/vscode/vs/base/common/network';
|
|
5
4
|
import { compare } from 'vscode/vscode/vs/base/common/strings';
|
|
6
5
|
import { ThemeIcon } from 'vscode/vscode/vs/base/common/themables';
|
|
@@ -11,12 +10,12 @@ import { localize2, localize } from 'vscode/vscode/vs/nls';
|
|
|
11
10
|
import { registerAction2, Action2, MenuId } from 'vscode/vscode/vs/platform/actions/common/actions';
|
|
12
11
|
import { ICommandService } from 'vscode/vscode/vs/platform/commands/common/commands.service';
|
|
13
12
|
import { ContextKeyExpr } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
|
|
14
|
-
import { KeybindingWeight } from 'vscode/vscode/vs/platform/keybinding/common/keybindingsRegistry';
|
|
15
13
|
import { IQuickInputService } from 'vscode/vscode/vs/platform/quickinput/common/quickInput.service';
|
|
16
14
|
import { CHAT_CATEGORY } from 'vscode/vscode/vs/workbench/contrib/chat/browser/actions/chatActions';
|
|
15
|
+
import { showChatView } from 'vscode/vscode/vs/workbench/contrib/chat/browser/chat';
|
|
17
16
|
import { IChatWidgetService, IQuickChatService } from 'vscode/vscode/vs/workbench/contrib/chat/browser/chat.service';
|
|
18
17
|
import { isQuickChat } from 'vscode/vscode/vs/workbench/contrib/chat/browser/chatWidget';
|
|
19
|
-
import { ChatContextAttachments } from '
|
|
18
|
+
import { ChatContextAttachments } from 'vscode/vscode/vs/workbench/contrib/chat/browser/contrib/chatContextAttachments';
|
|
20
19
|
import { ChatAgentLocation } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatAgents';
|
|
21
20
|
import { IChatAgentService } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatAgents.service';
|
|
22
21
|
import { CONTEXT_CHAT_LOCATION, CONTEXT_IN_CHAT_INPUT } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatContextKeys';
|
|
@@ -26,6 +25,11 @@ import { ILanguageModelToolsService } from 'vscode/vscode/vs/workbench/contrib/c
|
|
|
26
25
|
import { AnythingQuickAccessProvider } from 'vscode/vscode/vs/workbench/contrib/search/browser/anythingQuickAccess';
|
|
27
26
|
import { SymbolsQuickAccessProvider } from 'vscode/vscode/vs/workbench/contrib/search/browser/symbolsQuickAccess';
|
|
28
27
|
import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService.service';
|
|
28
|
+
import { IClipboardService } from 'vscode/vscode/vs/platform/clipboard/common/clipboardService.service';
|
|
29
|
+
import { imageToHash, isImage } from 'vscode/vscode/vs/workbench/contrib/chat/browser/chatImagePaste';
|
|
30
|
+
import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration.service';
|
|
31
|
+
import { ActiveEditorContext } from 'vscode/vscode/vs/workbench/common/contextkeys';
|
|
32
|
+
import { IViewsService } from 'vscode/vscode/vs/workbench/services/views/common/viewsService.service';
|
|
29
33
|
|
|
30
34
|
function registerChatContextActions() {
|
|
31
35
|
registerAction2(AttachContextAction);
|
|
@@ -37,9 +41,15 @@ class AttachFileAction extends Action2 {
|
|
|
37
41
|
constructor() {
|
|
38
42
|
super({
|
|
39
43
|
id: AttachFileAction.ID,
|
|
40
|
-
title: ( localize2(
|
|
44
|
+
title: ( localize2(7320, "Add File to Chat")),
|
|
41
45
|
category: CHAT_CATEGORY,
|
|
42
|
-
f1: false
|
|
46
|
+
f1: false,
|
|
47
|
+
precondition: ( (ActiveEditorContext.isEqualTo('workbench.editors.files.textFileEditor'))),
|
|
48
|
+
menu: {
|
|
49
|
+
id: MenuId.ChatCommandCenter,
|
|
50
|
+
group: 'a_chat',
|
|
51
|
+
order: 10,
|
|
52
|
+
}
|
|
43
53
|
});
|
|
44
54
|
}
|
|
45
55
|
async run(accessor, ...args) {
|
|
@@ -47,6 +57,7 @@ class AttachFileAction extends Action2 {
|
|
|
47
57
|
const textEditorService = accessor.get(IEditorService);
|
|
48
58
|
const activeUri = textEditorService.activeEditor?.resource;
|
|
49
59
|
if (textEditorService.activeTextEditorControl?.getEditorType() === EditorType.ICodeEditor && activeUri && [Schemas.file, Schemas.vscodeRemote, Schemas.untitled].includes(activeUri.scheme)) {
|
|
60
|
+
(await showChatView(accessor.get(IViewsService)))?.focusInput();
|
|
50
61
|
variablesService.attachContext('file', activeUri, ChatAgentLocation.Panel);
|
|
51
62
|
}
|
|
52
63
|
}
|
|
@@ -56,9 +67,15 @@ class AttachSelectionAction extends Action2 {
|
|
|
56
67
|
constructor() {
|
|
57
68
|
super({
|
|
58
69
|
id: AttachSelectionAction.ID,
|
|
59
|
-
title: ( localize2(
|
|
70
|
+
title: ( localize2(7321, "Add Selection to Chat")),
|
|
60
71
|
category: CHAT_CATEGORY,
|
|
61
|
-
f1: false
|
|
72
|
+
f1: false,
|
|
73
|
+
precondition: ( (ActiveEditorContext.isEqualTo('workbench.editors.files.textFileEditor'))),
|
|
74
|
+
menu: {
|
|
75
|
+
id: MenuId.ChatCommandCenter,
|
|
76
|
+
group: 'a_chat',
|
|
77
|
+
order: 11,
|
|
78
|
+
}
|
|
62
79
|
});
|
|
63
80
|
}
|
|
64
81
|
async run(accessor, ...args) {
|
|
@@ -69,6 +86,7 @@ class AttachSelectionAction extends Action2 {
|
|
|
69
86
|
if (textEditorService.activeTextEditorControl?.getEditorType() === EditorType.ICodeEditor && activeUri && [Schemas.file, Schemas.vscodeRemote, Schemas.untitled].includes(activeUri.scheme)) {
|
|
70
87
|
const selection = activeEditor?.getSelection();
|
|
71
88
|
if (selection) {
|
|
89
|
+
(await showChatView(accessor.get(IViewsService)))?.focusInput();
|
|
72
90
|
variablesService.attachContext('file', { uri: activeUri, range: selection }, ChatAgentLocation.Panel);
|
|
73
91
|
}
|
|
74
92
|
}
|
|
@@ -94,20 +112,33 @@ class AttachContextAction extends Action2 {
|
|
|
94
112
|
constructor() {
|
|
95
113
|
super({
|
|
96
114
|
id: AttachContextAction.ID,
|
|
97
|
-
title: ( localize2(
|
|
115
|
+
title: ( localize2(7322, "Attach Context")),
|
|
98
116
|
icon: Codicon.attach,
|
|
99
117
|
category: CHAT_CATEGORY,
|
|
100
118
|
precondition: AttachContextAction._cdt,
|
|
101
119
|
keybinding: {
|
|
102
120
|
when: CONTEXT_IN_CHAT_INPUT,
|
|
103
|
-
primary:
|
|
104
|
-
weight:
|
|
121
|
+
primary: 2048 | 90 ,
|
|
122
|
+
weight: 100
|
|
105
123
|
},
|
|
106
124
|
menu: [
|
|
107
125
|
{
|
|
108
|
-
when:
|
|
126
|
+
when: ( (ContextKeyExpr.and(
|
|
127
|
+
(CONTEXT_CHAT_LOCATION.isEqualTo(ChatAgentLocation.Panel)),
|
|
128
|
+
AttachContextAction._cdt
|
|
129
|
+
))),
|
|
130
|
+
id: MenuId.ChatInput,
|
|
131
|
+
group: 'navigation',
|
|
132
|
+
order: 2
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
when: ( (ContextKeyExpr.and(
|
|
136
|
+
(( (CONTEXT_CHAT_LOCATION.isEqualTo(ChatAgentLocation.Panel))).negate()),
|
|
137
|
+
AttachContextAction._cdt
|
|
138
|
+
))),
|
|
109
139
|
id: MenuId.ChatExecute,
|
|
110
140
|
group: 'navigation',
|
|
141
|
+
order: 1
|
|
111
142
|
},
|
|
112
143
|
]
|
|
113
144
|
});
|
|
@@ -122,7 +153,7 @@ class AttachContextAction extends Action2 {
|
|
|
122
153
|
`:${item.range.startLineNumber}-${item.range.endLineNumber}` :
|
|
123
154
|
`:${item.range.startLineNumber}`);
|
|
124
155
|
}
|
|
125
|
-
async _attachContext(widget, commandService, ...picks) {
|
|
156
|
+
async _attachContext(widget, commandService, clipboardService, ...picks) {
|
|
126
157
|
const toAttach = [];
|
|
127
158
|
for (const pick of picks) {
|
|
128
159
|
if (pick && typeof pick === 'object' && 'command' in pick && pick.command) {
|
|
@@ -149,14 +180,26 @@ class AttachContextAction extends Action2 {
|
|
|
149
180
|
});
|
|
150
181
|
}
|
|
151
182
|
else if (pick && typeof pick === 'object' && 'resource' in pick && pick.resource) {
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
183
|
+
if (/\.(png|jpg|jpeg|bmp|gif|tiff)$/i.test(pick.resource.path)) {
|
|
184
|
+
toAttach.push({
|
|
185
|
+
id: ( (pick.resource.toString())),
|
|
186
|
+
name: pick.label,
|
|
187
|
+
fullName: pick.label,
|
|
188
|
+
value: pick.resource,
|
|
189
|
+
isDynamic: true,
|
|
190
|
+
isImage: true
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
else {
|
|
194
|
+
toAttach.push({
|
|
195
|
+
...pick,
|
|
196
|
+
id: this._getFileContextId({ resource: pick.resource }),
|
|
197
|
+
value: pick.resource,
|
|
198
|
+
name: pick.label,
|
|
199
|
+
isFile: true,
|
|
200
|
+
isDynamic: true
|
|
201
|
+
});
|
|
202
|
+
}
|
|
160
203
|
}
|
|
161
204
|
else if ('symbolName' in pick && pick.uri && pick.range) {
|
|
162
205
|
toAttach.push({
|
|
@@ -179,6 +222,17 @@ class AttachContextAction extends Action2 {
|
|
|
179
222
|
isTool: true
|
|
180
223
|
});
|
|
181
224
|
}
|
|
225
|
+
else if ('kind' in pick && pick.kind === 'image') {
|
|
226
|
+
const fileBuffer = await clipboardService.readImage();
|
|
227
|
+
toAttach.push({
|
|
228
|
+
id: await imageToHash(fileBuffer),
|
|
229
|
+
name: ( localize(7323, 'Pasted Image')),
|
|
230
|
+
fullName: ( localize(7323, 'Pasted Image')),
|
|
231
|
+
value: fileBuffer,
|
|
232
|
+
isDynamic: true,
|
|
233
|
+
isImage: true
|
|
234
|
+
});
|
|
235
|
+
}
|
|
182
236
|
else {
|
|
183
237
|
toAttach.push({
|
|
184
238
|
...pick,
|
|
@@ -201,6 +255,8 @@ class AttachContextAction extends Action2 {
|
|
|
201
255
|
const widgetService = accessor.get(IChatWidgetService);
|
|
202
256
|
const languageModelToolsService = accessor.get(ILanguageModelToolsService);
|
|
203
257
|
const quickChatService = accessor.get(IQuickChatService);
|
|
258
|
+
const clipboardService = accessor.get(IClipboardService);
|
|
259
|
+
const configurationService = accessor.get(IConfigurationService);
|
|
204
260
|
const context = args[0];
|
|
205
261
|
const widget = context?.widget ?? widgetService.lastFocusedWidget;
|
|
206
262
|
if (!widget) {
|
|
@@ -220,6 +276,17 @@ class AttachContextAction extends Action2 {
|
|
|
220
276
|
});
|
|
221
277
|
}
|
|
222
278
|
}
|
|
279
|
+
if (configurationService.getValue('chat.experimental.imageAttachments')) {
|
|
280
|
+
const imageData = await clipboardService.readImage();
|
|
281
|
+
if (isImage(imageData)) {
|
|
282
|
+
quickPickItems.push({
|
|
283
|
+
id: await imageToHash(imageData),
|
|
284
|
+
kind: 'image',
|
|
285
|
+
label: ( localize(7324, 'Image from Clipboard')),
|
|
286
|
+
iconClass: ThemeIcon.asClassName(Codicon.fileMedia),
|
|
287
|
+
});
|
|
288
|
+
}
|
|
289
|
+
}
|
|
223
290
|
if (widget.viewModel?.sessionId) {
|
|
224
291
|
const agentPart = widget.parsedInput.parts.find((part) => part instanceof ChatRequestAgentPart);
|
|
225
292
|
if (agentPart) {
|
|
@@ -260,11 +327,27 @@ class AttachContextAction extends Action2 {
|
|
|
260
327
|
}
|
|
261
328
|
}
|
|
262
329
|
quickPickItems.push({
|
|
263
|
-
label: ( localize(
|
|
330
|
+
label: ( localize(7325, 'Symbol...')),
|
|
264
331
|
icon: ThemeIcon.fromId(Codicon.symbolField.id),
|
|
265
332
|
iconClass: ThemeIcon.asClassName(Codicon.symbolField),
|
|
266
333
|
prefix: SymbolsQuickAccessProvider.PREFIX
|
|
267
334
|
});
|
|
335
|
+
if (widget.location === ChatAgentLocation.Notebook) {
|
|
336
|
+
quickPickItems.push({
|
|
337
|
+
kind: 'dynamic',
|
|
338
|
+
id: 'chatContext.notebook.kernelVariable',
|
|
339
|
+
isDynamic: true,
|
|
340
|
+
icon: ThemeIcon.fromId(Codicon.serverEnvironment.id),
|
|
341
|
+
iconClass: ThemeIcon.asClassName(Codicon.serverEnvironment),
|
|
342
|
+
value: 'kernelVariable',
|
|
343
|
+
label: ( localize(7326, 'Kernel Variable...')),
|
|
344
|
+
command: {
|
|
345
|
+
id: 'notebook.chat.selectAndInsertKernelVariable',
|
|
346
|
+
title: ( localize(7327, 'Select and Insert Kernel Variable')),
|
|
347
|
+
arguments: [{ widget, range: undefined }]
|
|
348
|
+
}
|
|
349
|
+
});
|
|
350
|
+
}
|
|
268
351
|
function extractTextFromIconLabel(label) {
|
|
269
352
|
if (!label) {
|
|
270
353
|
return '';
|
|
@@ -276,23 +359,26 @@ class AttachContextAction extends Action2 {
|
|
|
276
359
|
const first = extractTextFromIconLabel(a.label).toUpperCase();
|
|
277
360
|
const second = extractTextFromIconLabel(b.label).toUpperCase();
|
|
278
361
|
return compare(first, second);
|
|
279
|
-
}));
|
|
362
|
+
}), clipboardService, '');
|
|
280
363
|
}
|
|
281
|
-
_show(quickInputService, commandService, widget, quickChatService, quickPickItems, query = '') {
|
|
364
|
+
_show(quickInputService, commandService, widget, quickChatService, quickPickItems, clipboardService, query = '') {
|
|
282
365
|
quickInputService.quickAccess.show(query, {
|
|
283
366
|
enabledProviderPrefixes: [
|
|
284
367
|
AnythingQuickAccessProvider.PREFIX,
|
|
285
368
|
SymbolsQuickAccessProvider.PREFIX,
|
|
286
369
|
AbstractGotoSymbolQuickAccessProvider.PREFIX
|
|
287
370
|
],
|
|
288
|
-
placeholder: ( localize(
|
|
371
|
+
placeholder: ( localize(7328, 'Search attachments')),
|
|
289
372
|
providerOptions: {
|
|
290
373
|
handleAccept: (item) => {
|
|
291
374
|
if ('prefix' in item) {
|
|
292
|
-
this._show(quickInputService, commandService, widget, quickChatService, quickPickItems, item.prefix);
|
|
375
|
+
this._show(quickInputService, commandService, widget, quickChatService, quickPickItems, clipboardService, item.prefix);
|
|
293
376
|
}
|
|
294
377
|
else {
|
|
295
|
-
|
|
378
|
+
if (!clipboardService) {
|
|
379
|
+
return;
|
|
380
|
+
}
|
|
381
|
+
this._attachContext(widget, commandService, clipboardService, item);
|
|
296
382
|
if (isQuickChat(widget)) {
|
|
297
383
|
quickChatService.open();
|
|
298
384
|
}
|
|
@@ -301,6 +387,9 @@ class AttachContextAction extends Action2 {
|
|
|
301
387
|
additionPicks: quickPickItems,
|
|
302
388
|
filter: (item) => {
|
|
303
389
|
const attachedContext = widget.getContrib(ChatContextAttachments.ID)?.getContext() ?? ( (new Set()));
|
|
390
|
+
if ('kind' in item && item.kind === 'image') {
|
|
391
|
+
return !( (attachedContext.has(item.id)));
|
|
392
|
+
}
|
|
304
393
|
if ('symbol' in item && item.symbol) {
|
|
305
394
|
return !( (attachedContext.has(this._getFileContextId(item.symbol.location))));
|
|
306
395
|
}
|
|
@@ -11,7 +11,7 @@ function registerChatCopyActions() {
|
|
|
11
11
|
constructor() {
|
|
12
12
|
super({
|
|
13
13
|
id: 'workbench.action.chat.copyAll',
|
|
14
|
-
title: ( localize2(
|
|
14
|
+
title: ( localize2(7329, "Copy All")),
|
|
15
15
|
f1: false,
|
|
16
16
|
category: CHAT_CATEGORY,
|
|
17
17
|
menu: {
|
|
@@ -41,7 +41,7 @@ function registerChatCopyActions() {
|
|
|
41
41
|
constructor() {
|
|
42
42
|
super({
|
|
43
43
|
id: 'workbench.action.chat.copyItem',
|
|
44
|
-
title: ( localize2(
|
|
44
|
+
title: ( localize2(7330, "Copy")),
|
|
45
45
|
f1: false,
|
|
46
46
|
category: CHAT_CATEGORY,
|
|
47
47
|
menu: {
|
|
@@ -12,7 +12,7 @@ class LogChatInputHistoryAction extends Action2 {
|
|
|
12
12
|
constructor() {
|
|
13
13
|
super({
|
|
14
14
|
id: LogChatInputHistoryAction.ID,
|
|
15
|
-
title: ( localize2(
|
|
15
|
+
title: ( localize2(7331, "Log Chat Input History")),
|
|
16
16
|
icon: Codicon.attach,
|
|
17
17
|
category: Categories.Developer,
|
|
18
18
|
f1: true
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { KeyMod, KeyCode } from 'vscode/vscode/vs/base/common/keyCodes';
|
|
2
1
|
import { localize2 } from 'vscode/vscode/vs/nls';
|
|
3
2
|
import { registerAction2, Action2 } from 'vscode/vscode/vs/platform/actions/common/actions';
|
|
4
|
-
import { KeybindingWeight } from 'vscode/vscode/vs/platform/keybinding/common/keybindingsRegistry';
|
|
5
3
|
import { CHAT_CATEGORY } from 'vscode/vscode/vs/workbench/contrib/chat/browser/actions/chatActions';
|
|
6
4
|
import { IChatWidgetService } from 'vscode/vscode/vs/workbench/contrib/chat/browser/chat.service';
|
|
7
5
|
import { CONTEXT_IN_CHAT_SESSION, CONTEXT_CHAT_ENABLED } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatContextKeys';
|
|
@@ -12,10 +10,10 @@ function registerChatFileTreeActions() {
|
|
|
12
10
|
constructor() {
|
|
13
11
|
super({
|
|
14
12
|
id: 'workbench.action.chat.nextFileTree',
|
|
15
|
-
title: ( localize2(
|
|
13
|
+
title: ( localize2(7337, "Next File Tree")),
|
|
16
14
|
keybinding: {
|
|
17
|
-
primary:
|
|
18
|
-
weight:
|
|
15
|
+
primary: 2048 | 67 ,
|
|
16
|
+
weight: 200 ,
|
|
19
17
|
when: CONTEXT_IN_CHAT_SESSION,
|
|
20
18
|
},
|
|
21
19
|
precondition: CONTEXT_CHAT_ENABLED,
|
|
@@ -31,10 +29,10 @@ function registerChatFileTreeActions() {
|
|
|
31
29
|
constructor() {
|
|
32
30
|
super({
|
|
33
31
|
id: 'workbench.action.chat.previousFileTree',
|
|
34
|
-
title: ( localize2(
|
|
32
|
+
title: ( localize2(7338, "Previous File Tree")),
|
|
35
33
|
keybinding: {
|
|
36
|
-
primary:
|
|
37
|
-
weight:
|
|
34
|
+
primary: 2048 | 1024 | 67 ,
|
|
35
|
+
weight: 200 ,
|
|
38
36
|
when: CONTEXT_IN_CHAT_SESSION,
|
|
39
37
|
},
|
|
40
38
|
precondition: CONTEXT_CHAT_ENABLED,
|
|
@@ -13,14 +13,14 @@ import { IChatService } from 'vscode/vscode/vs/workbench/contrib/chat/common/cha
|
|
|
13
13
|
import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService.service';
|
|
14
14
|
|
|
15
15
|
const defaultFileName = 'chat.json';
|
|
16
|
-
const filters = [{ name: ( localize(
|
|
16
|
+
const filters = [{ name: ( localize(7339, "Chat Session")), extensions: ['json'] }];
|
|
17
17
|
function registerChatExportActions() {
|
|
18
18
|
registerAction2(class ExportChatAction extends Action2 {
|
|
19
19
|
constructor() {
|
|
20
20
|
super({
|
|
21
21
|
id: 'workbench.action.chat.export',
|
|
22
22
|
category: CHAT_CATEGORY,
|
|
23
|
-
title: ( localize2(
|
|
23
|
+
title: ( localize2(7340, "Export Chat...")),
|
|
24
24
|
precondition: CONTEXT_CHAT_ENABLED,
|
|
25
25
|
f1: true,
|
|
26
26
|
});
|
|
@@ -54,7 +54,7 @@ function registerChatExportActions() {
|
|
|
54
54
|
constructor() {
|
|
55
55
|
super({
|
|
56
56
|
id: 'workbench.action.chat.import',
|
|
57
|
-
title: ( localize2(
|
|
57
|
+
title: ( localize2(7341, "Import Chat...")),
|
|
58
58
|
category: CHAT_CATEGORY,
|
|
59
59
|
precondition: CONTEXT_CHAT_ENABLED,
|
|
60
60
|
f1: true,
|
|
@@ -5,6 +5,7 @@ import { ActiveEditorContext } from 'vscode/vscode/vs/workbench/common/contextke
|
|
|
5
5
|
import { CHAT_CATEGORY, isChatViewTitleActionContext } from 'vscode/vscode/vs/workbench/contrib/chat/browser/actions/chatActions';
|
|
6
6
|
import { CHAT_VIEW_ID } from 'vscode/vscode/vs/workbench/contrib/chat/browser/chat';
|
|
7
7
|
import { IChatWidgetService } from 'vscode/vscode/vs/workbench/contrib/chat/browser/chat.service';
|
|
8
|
+
import { ChatEditor } from '../chatEditor.js';
|
|
8
9
|
import { ChatEditorInput } from 'vscode/vscode/vs/workbench/contrib/chat/browser/chatEditorInput';
|
|
9
10
|
import { CONTEXT_CHAT_ENABLED } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatContextKeys';
|
|
10
11
|
import { IEditorGroupsService } from 'vscode/vscode/vs/workbench/services/editor/common/editorGroupsService.service';
|
|
@@ -22,7 +23,7 @@ function registerMoveActions() {
|
|
|
22
23
|
constructor() {
|
|
23
24
|
super({
|
|
24
25
|
id: `workbench.action.chat.openInEditor`,
|
|
25
|
-
title: ( localize2(
|
|
26
|
+
title: ( localize2(7342, "Open Chat in Editor")),
|
|
26
27
|
category: CHAT_CATEGORY,
|
|
27
28
|
precondition: CONTEXT_CHAT_ENABLED,
|
|
28
29
|
f1: true,
|
|
@@ -42,7 +43,7 @@ function registerMoveActions() {
|
|
|
42
43
|
constructor() {
|
|
43
44
|
super({
|
|
44
45
|
id: `workbench.action.chat.openInNewWindow`,
|
|
45
|
-
title: ( localize2(
|
|
46
|
+
title: ( localize2(7343, "Open Chat in New Window")),
|
|
46
47
|
category: CHAT_CATEGORY,
|
|
47
48
|
precondition: CONTEXT_CHAT_ENABLED,
|
|
48
49
|
f1: true,
|
|
@@ -62,7 +63,7 @@ function registerMoveActions() {
|
|
|
62
63
|
constructor() {
|
|
63
64
|
super({
|
|
64
65
|
id: `workbench.action.chat.openInSidebar`,
|
|
65
|
-
title: ( localize2(
|
|
66
|
+
title: ( localize2(7344, "Open Chat in Side Bar")),
|
|
66
67
|
category: CHAT_CATEGORY,
|
|
67
68
|
precondition: CONTEXT_CHAT_ENABLED,
|
|
68
69
|
f1: true,
|
|
@@ -100,12 +101,13 @@ async function moveToSidebar(accessor) {
|
|
|
100
101
|
const viewsService = accessor.get(IViewsService);
|
|
101
102
|
const editorService = accessor.get(IEditorService);
|
|
102
103
|
const editorGroupService = accessor.get(IEditorGroupsService);
|
|
103
|
-
const
|
|
104
|
+
const chatEditor = editorService.activeEditorPane;
|
|
105
|
+
const chatEditorInput = chatEditor?.input;
|
|
104
106
|
let view;
|
|
105
|
-
if (chatEditorInput instanceof ChatEditorInput && chatEditorInput.sessionId) {
|
|
106
|
-
await editorService.closeEditor({ editor:
|
|
107
|
+
if (chatEditor instanceof ChatEditor && chatEditorInput instanceof ChatEditorInput && chatEditorInput.sessionId) {
|
|
108
|
+
await editorService.closeEditor({ editor: chatEditor.input, groupId: editorGroupService.activeGroup.id });
|
|
107
109
|
view = await viewsService.openView(CHAT_VIEW_ID);
|
|
108
|
-
view.loadSession(chatEditorInput.sessionId);
|
|
110
|
+
view.loadSession(chatEditorInput.sessionId, chatEditor.getViewState());
|
|
109
111
|
}
|
|
110
112
|
else {
|
|
111
113
|
view = await viewsService.openView(CHAT_VIEW_ID);
|