@codingame/monaco-vscode-chat-service-override 4.5.0 → 4.5.2
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.d.ts +1 -1
- package/package.json +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatClearActions.js +6 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.js +26 -39
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCopyActions.js +5 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatFileTreeActions.js +3 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatImportExport.js +6 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatMoveActions.js +9 -28
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatTitleActions.js +19 -34
- package/vscode/src/vs/workbench/contrib/chat/browser/chat.contribution.js +35 -58
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContributionServiceImpl.js +57 -100
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditor.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatQuick.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatVariables.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatViewPane.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorContrib.js +66 -69
- package/vscode/src/vs/workbench/contrib/chat/common/chatServiceImpl.js +96 -93
- package/vscode/src/vs/workbench/contrib/chat/common/chatSlashCommands.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/common/languageModels.js +4 -2
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSavingServiceImpl.js +35 -34
- package/chat.d.ts +0 -5
package/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default } from '
|
|
1
|
+
export { default } from 'vscode/service-override/chat';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-chat-service-override",
|
|
3
|
-
"version": "4.5.
|
|
3
|
+
"version": "4.5.2",
|
|
4
4
|
"keywords": [],
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "CodinGame",
|
|
@@ -26,6 +26,6 @@
|
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"vscode": "npm:@codingame/monaco-vscode-api@4.5.
|
|
29
|
+
"vscode": "npm:@codingame/monaco-vscode-api@4.5.2"
|
|
30
30
|
}
|
|
31
31
|
}
|
|
@@ -12,17 +12,14 @@ import { IChatWidgetService } from 'vscode/vscode/vs/workbench/contrib/chat/brow
|
|
|
12
12
|
import { ChatEditorInput } from 'vscode/vscode/vs/workbench/contrib/chat/browser/chatEditorInput';
|
|
13
13
|
import { CONTEXT_PROVIDER_EXISTS, CONTEXT_IN_CHAT_SESSION } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatContextKeys';
|
|
14
14
|
|
|
15
|
+
const _moduleId = "vs/workbench/contrib/chat/browser/actions/chatClearActions";
|
|
15
16
|
const ACTION_ID_NEW_CHAT = `workbench.action.chat.newChat`;
|
|
16
17
|
function registerNewChatActions() {
|
|
17
18
|
registerAction2(class NewChatEditorAction extends Action2 {
|
|
18
19
|
constructor() {
|
|
19
20
|
super({
|
|
20
21
|
id: 'workbench.action.chatEditor.newChat',
|
|
21
|
-
title: ( localize2WithPath(
|
|
22
|
-
'vs/workbench/contrib/chat/browser/actions/chatClearActions',
|
|
23
|
-
'chat.newChat.label',
|
|
24
|
-
"New Chat"
|
|
25
|
-
)),
|
|
22
|
+
title: ( localize2WithPath(_moduleId, 0, "New Chat")),
|
|
26
23
|
icon: Codicon.plus,
|
|
27
24
|
f1: false,
|
|
28
25
|
precondition: CONTEXT_PROVIDER_EXISTS,
|
|
@@ -30,7 +27,7 @@ function registerNewChatActions() {
|
|
|
30
27
|
id: MenuId.EditorTitle,
|
|
31
28
|
group: 'navigation',
|
|
32
29
|
order: 0,
|
|
33
|
-
when: ( ActiveEditorContext.isEqualTo(ChatEditorInput.EditorID)),
|
|
30
|
+
when: ( (ActiveEditorContext.isEqualTo(ChatEditorInput.EditorID))),
|
|
34
31
|
}]
|
|
35
32
|
});
|
|
36
33
|
}
|
|
@@ -43,11 +40,7 @@ function registerNewChatActions() {
|
|
|
43
40
|
constructor() {
|
|
44
41
|
super({
|
|
45
42
|
id: ACTION_ID_NEW_CHAT,
|
|
46
|
-
title: ( localize2WithPath(
|
|
47
|
-
'vs/workbench/contrib/chat/browser/actions/chatClearActions',
|
|
48
|
-
'chat.newChat.label',
|
|
49
|
-
"New Chat"
|
|
50
|
-
)),
|
|
43
|
+
title: ( localize2WithPath(_moduleId, 0, "New Chat")),
|
|
51
44
|
category: CHAT_CATEGORY,
|
|
52
45
|
icon: Codicon.plus,
|
|
53
46
|
precondition: CONTEXT_PROVIDER_EXISTS,
|
|
@@ -81,14 +74,10 @@ function registerNewChatActions() {
|
|
|
81
74
|
const getNewChatActionDescriptorForViewTitle = (viewId, providerId) => ({
|
|
82
75
|
viewId,
|
|
83
76
|
id: `workbench.action.chat.${providerId}.newChat`,
|
|
84
|
-
title: ( localize2WithPath(
|
|
85
|
-
'vs/workbench/contrib/chat/browser/actions/chatClearActions',
|
|
86
|
-
'chat.newChat.label',
|
|
87
|
-
"New Chat"
|
|
88
|
-
)),
|
|
77
|
+
title: ( localize2WithPath(_moduleId, 0, "New Chat")),
|
|
89
78
|
menu: {
|
|
90
79
|
id: MenuId.ViewTitle,
|
|
91
|
-
when: ( ContextKeyExpr.equals('view', viewId)),
|
|
80
|
+
when: ( (ContextKeyExpr.equals('view', viewId))),
|
|
92
81
|
group: 'navigation',
|
|
93
82
|
order: -1
|
|
94
83
|
},
|
|
@@ -26,6 +26,7 @@ import { ITerminalService, ITerminalEditorService, ITerminalGroupService } from
|
|
|
26
26
|
import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService.service';
|
|
27
27
|
import { ITextFileService } from 'vscode/vscode/vs/workbench/services/textfile/common/textfiles.service';
|
|
28
28
|
|
|
29
|
+
const _moduleId = "vs/workbench/contrib/chat/browser/actions/chatCodeblockActions";
|
|
29
30
|
function isCodeBlockActionContext(thing) {
|
|
30
31
|
return typeof thing === 'object' && thing !== null && 'code' in thing && 'element' in thing;
|
|
31
32
|
}
|
|
@@ -57,11 +58,7 @@ function registerChatCodeBlockActions() {
|
|
|
57
58
|
constructor() {
|
|
58
59
|
super({
|
|
59
60
|
id: 'workbench.action.chat.copyCodeBlock',
|
|
60
|
-
title: ( localize2WithPath(
|
|
61
|
-
'vs/workbench/contrib/chat/browser/actions/chatCodeblockActions',
|
|
62
|
-
'interactive.copyCodeBlock.label',
|
|
63
|
-
"Copy"
|
|
64
|
-
)),
|
|
61
|
+
title: ( localize2WithPath(_moduleId, 0, "Copy")),
|
|
65
62
|
f1: false,
|
|
66
63
|
category: CHAT_CATEGORY,
|
|
67
64
|
icon: Codicon.copy,
|
|
@@ -145,11 +142,7 @@ function registerChatCodeBlockActions() {
|
|
|
145
142
|
constructor() {
|
|
146
143
|
super({
|
|
147
144
|
id: 'workbench.action.chat.insertCodeBlock',
|
|
148
|
-
title: ( localize2WithPath(
|
|
149
|
-
'vs/workbench/contrib/chat/browser/actions/chatCodeblockActions',
|
|
150
|
-
'interactive.insertCodeBlock.label',
|
|
151
|
-
"Insert at Cursor"
|
|
152
|
-
)),
|
|
145
|
+
title: ( localize2WithPath(_moduleId, 1, "Insert at Cursor")),
|
|
153
146
|
precondition: CONTEXT_PROVIDER_EXISTS,
|
|
154
147
|
f1: true,
|
|
155
148
|
category: CHAT_CATEGORY,
|
|
@@ -160,7 +153,10 @@ function registerChatCodeBlockActions() {
|
|
|
160
153
|
when: CONTEXT_IN_CHAT_SESSION
|
|
161
154
|
},
|
|
162
155
|
keybinding: {
|
|
163
|
-
when: ( ContextKeyExpr.or(
|
|
156
|
+
when: ( (ContextKeyExpr.or(
|
|
157
|
+
(ContextKeyExpr.and(CONTEXT_IN_CHAT_SESSION, (CONTEXT_IN_CHAT_INPUT.negate()))),
|
|
158
|
+
accessibleViewInCodeBlock
|
|
159
|
+
))),
|
|
164
160
|
primary: 2048 | 3 ,
|
|
165
161
|
mac: { primary: 256 | 3 },
|
|
166
162
|
weight: 400 + 1
|
|
@@ -241,22 +237,22 @@ function registerChatCodeBlockActions() {
|
|
|
241
237
|
if (usedDocuments) {
|
|
242
238
|
docRefs.push(usedDocuments);
|
|
243
239
|
}
|
|
244
|
-
const cancellationTokenSource = ( new CancellationTokenSource());
|
|
240
|
+
const cancellationTokenSource = ( (new CancellationTokenSource()));
|
|
245
241
|
mappedEdits = await mostRelevantProvider.provideMappedEdits(activeModel, [codeBlockActionContext.code], { documents: docRefs }, cancellationTokenSource.token);
|
|
246
242
|
}
|
|
247
243
|
if (mappedEdits) {
|
|
248
244
|
await bulkEditService.apply(mappedEdits);
|
|
249
245
|
}
|
|
250
246
|
else {
|
|
251
|
-
const activeSelection = codeEditor.getSelection() ?? ( new Range(activeModel.getLineCount(), 1, activeModel.getLineCount(), 1));
|
|
247
|
+
const activeSelection = codeEditor.getSelection() ?? ( (new Range(activeModel.getLineCount(), 1, activeModel.getLineCount(), 1)));
|
|
252
248
|
await bulkEditService.apply([
|
|
253
|
-
( new ResourceTextEdit(activeModel.uri, {
|
|
249
|
+
( (new ResourceTextEdit(activeModel.uri, {
|
|
254
250
|
range: activeSelection,
|
|
255
251
|
text: codeBlockActionContext.code,
|
|
256
|
-
})),
|
|
252
|
+
}))),
|
|
257
253
|
]);
|
|
258
254
|
}
|
|
259
|
-
codeEditorService.listCodeEditors().find(editor => editor.getModel()?.uri.toString() === ( activeModel.uri.toString()))?.focus();
|
|
255
|
+
codeEditorService.listCodeEditors().find(editor => editor.getModel()?.uri.toString() === ( (activeModel.uri.toString())))?.focus();
|
|
260
256
|
}
|
|
261
257
|
notifyUserAction(accessor, context) {
|
|
262
258
|
if (isResponseVM(context.element)) {
|
|
@@ -280,11 +276,7 @@ function registerChatCodeBlockActions() {
|
|
|
280
276
|
constructor() {
|
|
281
277
|
super({
|
|
282
278
|
id: 'workbench.action.chat.insertIntoNewFile',
|
|
283
|
-
title: ( localize2WithPath(
|
|
284
|
-
'vs/workbench/contrib/chat/browser/actions/chatCodeblockActions',
|
|
285
|
-
'interactive.insertIntoNewFile.label',
|
|
286
|
-
"Insert into New File"
|
|
287
|
-
)),
|
|
279
|
+
title: ( localize2WithPath(_moduleId, 2, "Insert into New File")),
|
|
288
280
|
precondition: CONTEXT_PROVIDER_EXISTS,
|
|
289
281
|
f1: true,
|
|
290
282
|
category: CHAT_CATEGORY,
|
|
@@ -333,11 +325,7 @@ function registerChatCodeBlockActions() {
|
|
|
333
325
|
constructor() {
|
|
334
326
|
super({
|
|
335
327
|
id: 'workbench.action.chat.runInTerminal',
|
|
336
|
-
title: ( localize2WithPath(
|
|
337
|
-
'vs/workbench/contrib/chat/browser/actions/chatCodeblockActions',
|
|
338
|
-
'interactive.runInTerminal.label',
|
|
339
|
-
"Insert into Terminal"
|
|
340
|
-
)),
|
|
328
|
+
title: ( localize2WithPath(_moduleId, 3, "Insert into Terminal")),
|
|
341
329
|
precondition: CONTEXT_PROVIDER_EXISTS,
|
|
342
330
|
f1: true,
|
|
343
331
|
category: CHAT_CATEGORY,
|
|
@@ -345,13 +333,20 @@ function registerChatCodeBlockActions() {
|
|
|
345
333
|
menu: [{
|
|
346
334
|
id: MenuId.ChatCodeBlock,
|
|
347
335
|
group: 'navigation',
|
|
348
|
-
when: ( ContextKeyExpr.and(
|
|
336
|
+
when: ( (ContextKeyExpr.and(
|
|
337
|
+
CONTEXT_IN_CHAT_SESSION,
|
|
338
|
+
(ContextKeyExpr.or(...( (shellLangIds.map(
|
|
339
|
+
e => ( (ContextKeyExpr.equals(EditorContextKeys.languageId.key, e)))
|
|
340
|
+
)))))
|
|
341
|
+
))),
|
|
349
342
|
},
|
|
350
343
|
{
|
|
351
344
|
id: MenuId.ChatCodeBlock,
|
|
352
345
|
group: 'navigation',
|
|
353
346
|
isHiddenByDefault: true,
|
|
354
|
-
when: ( ContextKeyExpr.and(CONTEXT_IN_CHAT_SESSION, ...( shellLangIds.map(
|
|
347
|
+
when: ( (ContextKeyExpr.and(CONTEXT_IN_CHAT_SESSION, ...( (shellLangIds.map(
|
|
348
|
+
e => ( (ContextKeyExpr.notEquals(EditorContextKeys.languageId.key, e)))
|
|
349
|
+
))))))
|
|
355
350
|
}],
|
|
356
351
|
keybinding: [{
|
|
357
352
|
primary: 2048 | 512 | 3 ,
|
|
@@ -359,7 +354,7 @@ function registerChatCodeBlockActions() {
|
|
|
359
354
|
primary: 256 | 512 | 3
|
|
360
355
|
},
|
|
361
356
|
weight: 100 ,
|
|
362
|
-
when: ( ContextKeyExpr.or(CONTEXT_IN_CHAT_SESSION, accessibleViewInCodeBlock)),
|
|
357
|
+
when: ( (ContextKeyExpr.or(CONTEXT_IN_CHAT_SESSION, accessibleViewInCodeBlock))),
|
|
363
358
|
}]
|
|
364
359
|
});
|
|
365
360
|
}
|
|
@@ -430,11 +425,7 @@ function registerChatCodeBlockActions() {
|
|
|
430
425
|
constructor() {
|
|
431
426
|
super({
|
|
432
427
|
id: 'workbench.action.chat.nextCodeBlock',
|
|
433
|
-
title: ( localize2WithPath(
|
|
434
|
-
'vs/workbench/contrib/chat/browser/actions/chatCodeblockActions',
|
|
435
|
-
'interactive.nextCodeBlock.label',
|
|
436
|
-
"Next Code Block"
|
|
437
|
-
)),
|
|
428
|
+
title: ( localize2WithPath(_moduleId, 4, "Next Code Block")),
|
|
438
429
|
keybinding: {
|
|
439
430
|
primary: 2048 | 512 | 12 ,
|
|
440
431
|
mac: { primary: 2048 | 512 | 12 , },
|
|
@@ -454,11 +445,7 @@ function registerChatCodeBlockActions() {
|
|
|
454
445
|
constructor() {
|
|
455
446
|
super({
|
|
456
447
|
id: 'workbench.action.chat.previousCodeBlock',
|
|
457
|
-
title: ( localize2WithPath(
|
|
458
|
-
'vs/workbench/contrib/chat/browser/actions/chatCodeblockActions',
|
|
459
|
-
'interactive.previousCodeBlock.label',
|
|
460
|
-
"Previous Code Block"
|
|
461
|
-
)),
|
|
448
|
+
title: ( localize2WithPath(_moduleId, 5, "Previous Code Block")),
|
|
462
449
|
keybinding: {
|
|
463
450
|
primary: 2048 | 512 | 11 ,
|
|
464
451
|
mac: { primary: 2048 | 512 | 11 , },
|
|
@@ -6,21 +6,18 @@ import { IChatWidgetService } from 'vscode/vscode/vs/workbench/contrib/chat/brow
|
|
|
6
6
|
import { CONTEXT_RESPONSE_FILTERED } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatContextKeys';
|
|
7
7
|
import { isRequestVM, isResponseVM } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatViewModel';
|
|
8
8
|
|
|
9
|
+
const _moduleId = "vs/workbench/contrib/chat/browser/actions/chatCopyActions";
|
|
9
10
|
function registerChatCopyActions() {
|
|
10
11
|
registerAction2(class CopyAllAction extends Action2 {
|
|
11
12
|
constructor() {
|
|
12
13
|
super({
|
|
13
14
|
id: 'workbench.action.chat.copyAll',
|
|
14
|
-
title: ( localize2WithPath(
|
|
15
|
-
'vs/workbench/contrib/chat/browser/actions/chatCopyActions',
|
|
16
|
-
'interactive.copyAll.label',
|
|
17
|
-
"Copy All"
|
|
18
|
-
)),
|
|
15
|
+
title: ( localize2WithPath(_moduleId, 0, "Copy All")),
|
|
19
16
|
f1: false,
|
|
20
17
|
category: CHAT_CATEGORY,
|
|
21
18
|
menu: {
|
|
22
19
|
id: MenuId.ChatContext,
|
|
23
|
-
when: ( CONTEXT_RESPONSE_FILTERED.toNegated()),
|
|
20
|
+
when: ( (CONTEXT_RESPONSE_FILTERED.toNegated())),
|
|
24
21
|
group: 'copy',
|
|
25
22
|
}
|
|
26
23
|
});
|
|
@@ -45,16 +42,12 @@ function registerChatCopyActions() {
|
|
|
45
42
|
constructor() {
|
|
46
43
|
super({
|
|
47
44
|
id: 'workbench.action.chat.copyItem',
|
|
48
|
-
title: ( localize2WithPath(
|
|
49
|
-
'vs/workbench/contrib/chat/browser/actions/chatCopyActions',
|
|
50
|
-
'interactive.copyItem.label',
|
|
51
|
-
"Copy"
|
|
52
|
-
)),
|
|
45
|
+
title: ( localize2WithPath(_moduleId, 1, "Copy")),
|
|
53
46
|
f1: false,
|
|
54
47
|
category: CHAT_CATEGORY,
|
|
55
48
|
menu: {
|
|
56
49
|
id: MenuId.ChatContext,
|
|
57
|
-
when: ( CONTEXT_RESPONSE_FILTERED.toNegated()),
|
|
50
|
+
when: ( (CONTEXT_RESPONSE_FILTERED.toNegated())),
|
|
58
51
|
group: 'copy',
|
|
59
52
|
}
|
|
60
53
|
});
|
|
@@ -5,16 +5,13 @@ import { IChatWidgetService } from 'vscode/vscode/vs/workbench/contrib/chat/brow
|
|
|
5
5
|
import { CONTEXT_IN_CHAT_SESSION, CONTEXT_PROVIDER_EXISTS } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatContextKeys';
|
|
6
6
|
import { isResponseVM } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatViewModel';
|
|
7
7
|
|
|
8
|
+
const _moduleId = "vs/workbench/contrib/chat/browser/actions/chatFileTreeActions";
|
|
8
9
|
function registerChatFileTreeActions() {
|
|
9
10
|
registerAction2(class NextFileTreeAction extends Action2 {
|
|
10
11
|
constructor() {
|
|
11
12
|
super({
|
|
12
13
|
id: 'workbench.action.chat.nextFileTree',
|
|
13
|
-
title: ( localize2WithPath(
|
|
14
|
-
'vs/workbench/contrib/chat/browser/actions/chatFileTreeActions',
|
|
15
|
-
'interactive.nextFileTree.label',
|
|
16
|
-
"Next File Tree"
|
|
17
|
-
)),
|
|
14
|
+
title: ( localize2WithPath(_moduleId, 0, "Next File Tree")),
|
|
18
15
|
keybinding: {
|
|
19
16
|
primary: 2048 | 67 ,
|
|
20
17
|
weight: 200 ,
|
|
@@ -33,11 +30,7 @@ function registerChatFileTreeActions() {
|
|
|
33
30
|
constructor() {
|
|
34
31
|
super({
|
|
35
32
|
id: 'workbench.action.chat.previousFileTree',
|
|
36
|
-
title: ( localize2WithPath(
|
|
37
|
-
'vs/workbench/contrib/chat/browser/actions/chatFileTreeActions',
|
|
38
|
-
'interactive.previousFileTree.label',
|
|
39
|
-
"Previous File Tree"
|
|
40
|
-
)),
|
|
33
|
+
title: ( localize2WithPath(_moduleId, 1, "Previous File Tree")),
|
|
41
34
|
keybinding: {
|
|
42
35
|
primary: 2048 | 1024 | 67 ,
|
|
43
36
|
weight: 200 ,
|
|
@@ -12,12 +12,9 @@ import { isExportableSessionData } from 'vscode/vscode/vs/workbench/contrib/chat
|
|
|
12
12
|
import { IChatService } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatService.service';
|
|
13
13
|
import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService.service';
|
|
14
14
|
|
|
15
|
+
const _moduleId = "vs/workbench/contrib/chat/browser/actions/chatImportExport";
|
|
15
16
|
const defaultFileName = 'chat.json';
|
|
16
|
-
const filters = [{ name: ( localizeWithPath(
|
|
17
|
-
'vs/workbench/contrib/chat/browser/actions/chatImportExport',
|
|
18
|
-
'chat.file.label',
|
|
19
|
-
"Chat Session"
|
|
20
|
-
)), extensions: ['json'] }];
|
|
17
|
+
const filters = [{ name: ( localizeWithPath(_moduleId, 0, "Chat Session")), extensions: ['json'] }];
|
|
21
18
|
function registerChatExportActions() {
|
|
22
19
|
registerAction2(class ExportChatAction extends Action2 {
|
|
23
20
|
constructor() {
|
|
@@ -25,11 +22,7 @@ function registerChatExportActions() {
|
|
|
25
22
|
id: 'workbench.action.chat.export',
|
|
26
23
|
category: CHAT_CATEGORY,
|
|
27
24
|
title: {
|
|
28
|
-
value: ( localizeWithPath(
|
|
29
|
-
'vs/workbench/contrib/chat/browser/actions/chatImportExport',
|
|
30
|
-
'chat.export.label',
|
|
31
|
-
"Export Session"
|
|
32
|
-
)) + '...',
|
|
25
|
+
value: ( localizeWithPath(_moduleId, 1, "Export Session")) + '...',
|
|
33
26
|
original: 'Export Session...'
|
|
34
27
|
},
|
|
35
28
|
precondition: CONTEXT_PROVIDER_EXISTS,
|
|
@@ -66,11 +59,7 @@ function registerChatExportActions() {
|
|
|
66
59
|
super({
|
|
67
60
|
id: 'workbench.action.chat.import',
|
|
68
61
|
title: {
|
|
69
|
-
value: ( localizeWithPath(
|
|
70
|
-
'vs/workbench/contrib/chat/browser/actions/chatImportExport',
|
|
71
|
-
'chat.import.label',
|
|
72
|
-
"Import Session"
|
|
73
|
-
)) + '...',
|
|
62
|
+
value: ( localizeWithPath(_moduleId, 2, "Import Session")) + '...',
|
|
74
63
|
original: 'Import Session...'
|
|
75
64
|
},
|
|
76
65
|
category: CHAT_CATEGORY,
|
|
@@ -93,9 +82,9 @@ function registerChatExportActions() {
|
|
|
93
82
|
}
|
|
94
83
|
const content = await fileService.readFile(result[0]);
|
|
95
84
|
try {
|
|
96
|
-
const data = JSON.parse(( content.value.toString()));
|
|
85
|
+
const data = JSON.parse(( (content.value.toString())));
|
|
97
86
|
if (!isExportableSessionData(data)) {
|
|
98
|
-
throw new Error('Invalid chat session data');
|
|
87
|
+
throw ( (new Error('Invalid chat session data')));
|
|
99
88
|
}
|
|
100
89
|
await editorService.openEditor({ resource: ChatEditorInput.getNewEditorUri(), options: { target: { data }, pinned: true } });
|
|
101
90
|
}
|
|
@@ -14,23 +14,16 @@ import { IEditorGroupsService } from 'vscode/vscode/vs/workbench/services/editor
|
|
|
14
14
|
import { AUX_WINDOW_GROUP, ACTIVE_GROUP } from 'vscode/vscode/vs/workbench/services/editor/common/editorService';
|
|
15
15
|
import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService.service';
|
|
16
16
|
|
|
17
|
+
const _moduleId = "vs/workbench/contrib/chat/browser/actions/chatMoveActions";
|
|
17
18
|
var MoveToNewLocation;
|
|
18
|
-
( (function(MoveToNewLocation) {
|
|
19
|
+
( ((function(MoveToNewLocation) {
|
|
19
20
|
MoveToNewLocation["Editor"] = "Editor";
|
|
20
21
|
MoveToNewLocation["Window"] = "Window";
|
|
21
|
-
})(MoveToNewLocation || (MoveToNewLocation = {})));
|
|
22
|
+
})(MoveToNewLocation || (MoveToNewLocation = {}))));
|
|
22
23
|
const getMoveToChatActionDescriptorForViewTitle = (viewId, providerId, moveTo) => ({
|
|
23
24
|
id: `workbench.action.chat.${providerId}.openIn${moveTo}`,
|
|
24
25
|
title: {
|
|
25
|
-
value: moveTo === MoveToNewLocation.Editor ? ( localizeWithPath(
|
|
26
|
-
'vs/workbench/contrib/chat/browser/actions/chatMoveActions',
|
|
27
|
-
'chat.openInEditor.label',
|
|
28
|
-
"Open Chat in Editor"
|
|
29
|
-
)) : ( localizeWithPath(
|
|
30
|
-
'vs/workbench/contrib/chat/browser/actions/chatMoveActions',
|
|
31
|
-
'chat.openInNewWindow.label',
|
|
32
|
-
"Open Chat in New Window"
|
|
33
|
-
)),
|
|
26
|
+
value: moveTo === MoveToNewLocation.Editor ? ( localizeWithPath(_moduleId, 0, "Open Chat in Editor")) : ( localizeWithPath(_moduleId, 1, "Open Chat in New Window")),
|
|
34
27
|
original: moveTo === MoveToNewLocation.Editor ? 'Open Chat in Editor' : 'Open Chat in New Window',
|
|
35
28
|
},
|
|
36
29
|
category: CHAT_CATEGORY,
|
|
@@ -39,7 +32,7 @@ const getMoveToChatActionDescriptorForViewTitle = (viewId, providerId, moveTo) =
|
|
|
39
32
|
viewId,
|
|
40
33
|
menu: {
|
|
41
34
|
id: MenuId.ViewTitle,
|
|
42
|
-
when: ( ContextKeyExpr.equals('view', viewId)),
|
|
35
|
+
when: ( (ContextKeyExpr.equals('view', viewId))),
|
|
43
36
|
order: 0
|
|
44
37
|
},
|
|
45
38
|
});
|
|
@@ -72,11 +65,7 @@ function registerMoveActions() {
|
|
|
72
65
|
constructor() {
|
|
73
66
|
super({
|
|
74
67
|
id: `workbench.action.chat.openInEditor`,
|
|
75
|
-
title: ( localize2WithPath(
|
|
76
|
-
'vs/workbench/contrib/chat/browser/actions/chatMoveActions',
|
|
77
|
-
'interactiveSession.openInEditor.label',
|
|
78
|
-
"Open Chat in Editor"
|
|
79
|
-
)),
|
|
68
|
+
title: ( localize2WithPath(_moduleId, 2, "Open Chat in Editor")),
|
|
80
69
|
category: CHAT_CATEGORY,
|
|
81
70
|
precondition: CONTEXT_PROVIDER_EXISTS,
|
|
82
71
|
f1: true
|
|
@@ -90,11 +79,7 @@ function registerMoveActions() {
|
|
|
90
79
|
constructor() {
|
|
91
80
|
super({
|
|
92
81
|
id: `workbench.action.chat.openInNewWindow`,
|
|
93
|
-
title: ( localize2WithPath(
|
|
94
|
-
'vs/workbench/contrib/chat/browser/actions/chatMoveActions',
|
|
95
|
-
'interactiveSession.openInNewWindow.label',
|
|
96
|
-
"Open Chat in New Window"
|
|
97
|
-
)),
|
|
82
|
+
title: ( localize2WithPath(_moduleId, 3, "Open Chat in New Window")),
|
|
98
83
|
category: CHAT_CATEGORY,
|
|
99
84
|
precondition: CONTEXT_PROVIDER_EXISTS,
|
|
100
85
|
f1: true
|
|
@@ -108,18 +93,14 @@ function registerMoveActions() {
|
|
|
108
93
|
constructor() {
|
|
109
94
|
super({
|
|
110
95
|
id: `workbench.action.chat.openInSidebar`,
|
|
111
|
-
title: ( localize2WithPath(
|
|
112
|
-
'vs/workbench/contrib/chat/browser/actions/chatMoveActions',
|
|
113
|
-
'interactiveSession.openInSidebar.label',
|
|
114
|
-
"Open Chat in Side Bar"
|
|
115
|
-
)),
|
|
96
|
+
title: ( localize2WithPath(_moduleId, 4, "Open Chat in Side Bar")),
|
|
116
97
|
category: CHAT_CATEGORY,
|
|
117
98
|
precondition: CONTEXT_PROVIDER_EXISTS,
|
|
118
99
|
f1: true,
|
|
119
100
|
menu: [{
|
|
120
101
|
id: MenuId.EditorTitle,
|
|
121
102
|
order: 0,
|
|
122
|
-
when: ( ActiveEditorContext.isEqualTo(ChatEditorInput.EditorID)),
|
|
103
|
+
when: ( (ActiveEditorContext.isEqualTo(ChatEditorInput.EditorID))),
|
|
123
104
|
}]
|
|
124
105
|
});
|
|
125
106
|
}
|
|
@@ -15,20 +15,17 @@ import { NOTEBOOK_EDITOR_ID, CellKind } from 'vscode/vscode/vs/workbench/contrib
|
|
|
15
15
|
import { NOTEBOOK_IS_ACTIVE_EDITOR } from 'vscode/vscode/vs/workbench/contrib/notebook/common/notebookContextKeys';
|
|
16
16
|
import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService.service';
|
|
17
17
|
|
|
18
|
+
const _moduleId = "vs/workbench/contrib/chat/browser/actions/chatTitleActions";
|
|
18
19
|
function registerChatTitleActions() {
|
|
19
20
|
registerAction2(class MarkHelpfulAction extends Action2 {
|
|
20
21
|
constructor() {
|
|
21
22
|
super({
|
|
22
23
|
id: 'workbench.action.chat.markHelpful',
|
|
23
|
-
title: ( localize2WithPath(
|
|
24
|
-
'vs/workbench/contrib/chat/browser/actions/chatTitleActions',
|
|
25
|
-
'interactive.helpful.label',
|
|
26
|
-
"Helpful"
|
|
27
|
-
)),
|
|
24
|
+
title: ( localize2WithPath(_moduleId, 0, "Helpful")),
|
|
28
25
|
f1: false,
|
|
29
26
|
category: CHAT_CATEGORY,
|
|
30
27
|
icon: Codicon.thumbsup,
|
|
31
|
-
toggled: ( CONTEXT_RESPONSE_VOTE.isEqualTo('up')),
|
|
28
|
+
toggled: ( (CONTEXT_RESPONSE_VOTE.isEqualTo('up'))),
|
|
32
29
|
menu: {
|
|
33
30
|
id: MenuId.ChatMessageTitle,
|
|
34
31
|
group: 'navigation',
|
|
@@ -61,15 +58,11 @@ function registerChatTitleActions() {
|
|
|
61
58
|
constructor() {
|
|
62
59
|
super({
|
|
63
60
|
id: 'workbench.action.chat.markUnhelpful',
|
|
64
|
-
title: ( localize2WithPath(
|
|
65
|
-
'vs/workbench/contrib/chat/browser/actions/chatTitleActions',
|
|
66
|
-
'interactive.unhelpful.label',
|
|
67
|
-
"Unhelpful"
|
|
68
|
-
)),
|
|
61
|
+
title: ( localize2WithPath(_moduleId, 1, "Unhelpful")),
|
|
69
62
|
f1: false,
|
|
70
63
|
category: CHAT_CATEGORY,
|
|
71
64
|
icon: Codicon.thumbsdown,
|
|
72
|
-
toggled: ( CONTEXT_RESPONSE_VOTE.isEqualTo('down')),
|
|
65
|
+
toggled: ( (CONTEXT_RESPONSE_VOTE.isEqualTo('down'))),
|
|
73
66
|
menu: {
|
|
74
67
|
id: MenuId.ChatMessageTitle,
|
|
75
68
|
group: 'navigation',
|
|
@@ -102,11 +95,7 @@ function registerChatTitleActions() {
|
|
|
102
95
|
constructor() {
|
|
103
96
|
super({
|
|
104
97
|
id: 'workbench.action.chat.reportIssueForBug',
|
|
105
|
-
title: ( localize2WithPath(
|
|
106
|
-
'vs/workbench/contrib/chat/browser/actions/chatTitleActions',
|
|
107
|
-
'interactive.reportIssueForBug.label',
|
|
108
|
-
"Report Issue"
|
|
109
|
-
)),
|
|
98
|
+
title: ( localize2WithPath(_moduleId, 2, "Report Issue")),
|
|
110
99
|
f1: false,
|
|
111
100
|
category: CHAT_CATEGORY,
|
|
112
101
|
icon: Codicon.report,
|
|
@@ -114,7 +103,7 @@ function registerChatTitleActions() {
|
|
|
114
103
|
id: MenuId.ChatMessageTitle,
|
|
115
104
|
group: 'navigation',
|
|
116
105
|
order: 3,
|
|
117
|
-
when: ( ContextKeyExpr.and(CONTEXT_CHAT_RESPONSE_SUPPORT_ISSUE_REPORTING, CONTEXT_RESPONSE))
|
|
106
|
+
when: ( (ContextKeyExpr.and(CONTEXT_CHAT_RESPONSE_SUPPORT_ISSUE_REPORTING, CONTEXT_RESPONSE)))
|
|
118
107
|
}
|
|
119
108
|
});
|
|
120
109
|
}
|
|
@@ -140,11 +129,7 @@ function registerChatTitleActions() {
|
|
|
140
129
|
constructor() {
|
|
141
130
|
super({
|
|
142
131
|
id: 'workbench.action.chat.insertIntoNotebook',
|
|
143
|
-
title: ( localize2WithPath(
|
|
144
|
-
'vs/workbench/contrib/chat/browser/actions/chatTitleActions',
|
|
145
|
-
'interactive.insertIntoNotebook.label',
|
|
146
|
-
"Insert into Notebook"
|
|
147
|
-
)),
|
|
132
|
+
title: ( localize2WithPath(_moduleId, 3, "Insert into Notebook")),
|
|
148
133
|
f1: false,
|
|
149
134
|
category: CHAT_CATEGORY,
|
|
150
135
|
icon: Codicon.insert,
|
|
@@ -152,7 +137,11 @@ function registerChatTitleActions() {
|
|
|
152
137
|
id: MenuId.ChatMessageTitle,
|
|
153
138
|
group: 'navigation',
|
|
154
139
|
isHiddenByDefault: true,
|
|
155
|
-
when: ( ContextKeyExpr.and(
|
|
140
|
+
when: ( (ContextKeyExpr.and(
|
|
141
|
+
NOTEBOOK_IS_ACTIVE_EDITOR,
|
|
142
|
+
CONTEXT_RESPONSE,
|
|
143
|
+
(CONTEXT_RESPONSE_FILTERED.negate())
|
|
144
|
+
)))
|
|
156
145
|
}
|
|
157
146
|
});
|
|
158
147
|
}
|
|
@@ -176,11 +165,11 @@ function registerChatTitleActions() {
|
|
|
176
165
|
const index = Math.max(focusRange.end, 0);
|
|
177
166
|
const bulkEditService = accessor.get(IBulkEditService);
|
|
178
167
|
await bulkEditService.apply([
|
|
179
|
-
( new ResourceNotebookCellEdit(notebookEditor.textModel.uri, {
|
|
168
|
+
( (new ResourceNotebookCellEdit(notebookEditor.textModel.uri, {
|
|
180
169
|
editType: 1 ,
|
|
181
170
|
index: index,
|
|
182
171
|
count: 0,
|
|
183
|
-
cells: ( splitContents.map(content => {
|
|
172
|
+
cells: ( (splitContents.map(content => {
|
|
184
173
|
const kind = content.type === 'markdown' ? CellKind.Markup : CellKind.Code;
|
|
185
174
|
const language = content.type === 'markdown' ? 'markdown' : content.language;
|
|
186
175
|
const mime = content.type === 'markdown' ? 'text/markdown' : `text/x-${content.language}`;
|
|
@@ -192,8 +181,8 @@ function registerChatTitleActions() {
|
|
|
192
181
|
outputs: [],
|
|
193
182
|
metadata: {}
|
|
194
183
|
};
|
|
195
|
-
}))
|
|
196
|
-
}))
|
|
184
|
+
})))
|
|
185
|
+
})))
|
|
197
186
|
], { quotableLabel: 'Insert into Notebook' });
|
|
198
187
|
}
|
|
199
188
|
}
|
|
@@ -202,11 +191,7 @@ function registerChatTitleActions() {
|
|
|
202
191
|
constructor() {
|
|
203
192
|
super({
|
|
204
193
|
id: 'workbench.action.chat.remove',
|
|
205
|
-
title: ( localize2WithPath(
|
|
206
|
-
'vs/workbench/contrib/chat/browser/actions/chatTitleActions',
|
|
207
|
-
'chat.remove.label',
|
|
208
|
-
"Remove Request and Response"
|
|
209
|
-
)),
|
|
194
|
+
title: ( localize2WithPath(_moduleId, 4, "Remove Request and Response")),
|
|
210
195
|
f1: false,
|
|
211
196
|
category: CHAT_CATEGORY,
|
|
212
197
|
icon: Codicon.x,
|
|
@@ -215,7 +200,7 @@ function registerChatTitleActions() {
|
|
|
215
200
|
mac: {
|
|
216
201
|
primary: 2048 | 1 ,
|
|
217
202
|
},
|
|
218
|
-
when: ( ContextKeyExpr.and(CONTEXT_IN_CHAT_SESSION,
|
|
203
|
+
when: ( (ContextKeyExpr.and(CONTEXT_IN_CHAT_SESSION, (CONTEXT_IN_CHAT_INPUT.negate())))),
|
|
219
204
|
weight: 200 ,
|
|
220
205
|
},
|
|
221
206
|
menu: {
|