@codingame/monaco-vscode-chat-service-override 13.1.7 → 14.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 +9 -9
- package/package.json +20 -20
- package/vscode/src/vs/base/common/objectCache.d.ts +13 -0
- package/vscode/src/vs/base/common/objectCache.js +39 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.d.ts +12 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.js +95 -23
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.d.ts +10 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.js +81 -19
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContextActions.js +144 -66
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCopyActions.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatDeveloperActions.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatFileTreeActions.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatGettingStarted.d.ts +6 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatGettingStarted.js +17 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatImportExport.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatMoveActions.js +8 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.js +10 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/codeBlockOperations.d.ts +11 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/codeBlockOperations.js +168 -167
- package/vscode/src/vs/workbench/contrib/chat/browser/chat.contribution.js +116 -54
- package/vscode/src/vs/workbench/contrib/chat/browser/chatAccessibilityService.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatMarkdownAnchorService.d.ts +11 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatMarkdownAnchorService.js +34 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingService.d.ts +11 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingService.js +105 -70
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.d.ts +17 -16
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.js +154 -83
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditor.d.ts +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditor.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/chatParticipant.contribution.d.ts +0 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/chatParticipant.contribution.js +150 -130
- package/vscode/src/vs/workbench/contrib/chat/browser/chatPasteProviders.js +13 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/chatQuick.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatQuick.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatResponseAccessibleView.d.ts +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatResponseAccessibleView.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup.d.ts +11 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup.js +449 -229
- package/vscode/src/vs/workbench/contrib/chat/browser/chatVariables.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatVariables.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatViewPane.js +7 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/codeBlockContextProviderService.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorContrib.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorHover.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputRelatedFilesContrib.js +11 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/languageModelToolsService.d.ts +7 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/languageModelToolsService.js +76 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/media/chatViewSetup.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewsWelcomeHandler.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/common/chatCodeMapperService.d.ts +5 -18
- package/vscode/src/vs/workbench/contrib/chat/common/chatCodeMapperService.js +4 -122
- package/vscode/src/vs/workbench/contrib/chat/common/chatProgressTypes/chatToolInvocation.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatProgressTypes/chatToolInvocation.js +5 -4
- package/vscode/src/vs/workbench/contrib/chat/common/chatServiceImpl.d.ts +6 -3
- package/vscode/src/vs/workbench/contrib/chat/common/chatServiceImpl.js +42 -11
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contentProviders/textModelContentsProvider.d.ts +13 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/contentProviders/textModelContentsProvider.js +49 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageFeatures/promptLinkProvider.d.ts +14 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageFeatures/promptLinkProvider.js +69 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/parsers/textModelPromptParser.d.ts +10 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/parsers/textModelPromptParser.js +24 -0
- package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsContribution.js +73 -17
- package/vscode/src/vs/workbench/contrib/chat/common/tools/tools.d.ts +11 -0
- package/vscode/src/vs/workbench/contrib/chat/common/tools/tools.js +22 -0
- package/vscode/src/vs/workbench/contrib/chat/common/voiceChatService.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/voiceChatService.js +2 -2
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChat.contribution.js +9 -6
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAccessibilityHelp.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAccessibleView.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController2.d.ts +39 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController2.js +314 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatCurrentLine.js +34 -19
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatClearActions.d.ts +0 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatClearActions.js +0 -334
- package/vscode/src/vs/workbench/contrib/chat/common/chatWidgetHistoryService.d.ts +0 -31
- package/vscode/src/vs/workbench/contrib/chat/common/chatWidgetHistoryService.js +0 -46
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSavingServiceImpl.d.ts +0 -29
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSavingServiceImpl.js +0 -168
|
@@ -1,27 +1,35 @@
|
|
|
1
1
|
|
|
2
|
+
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
|
+
import { AsyncIterableObject } from '@codingame/monaco-vscode-api/vscode/vs/base/common/async';
|
|
4
|
+
import { CancellationToken } from '@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation';
|
|
2
5
|
import { Codicon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/codicons';
|
|
3
6
|
import { KeyMod, KeyCode } from '@codingame/monaco-vscode-api/vscode/vs/base/common/keyCodes';
|
|
7
|
+
import { Disposable, markAsSingleton } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
4
8
|
import { ICodeEditorService } from '@codingame/monaco-vscode-api/vscode/vs/editor/browser/services/codeEditorService';
|
|
5
9
|
import { EditorContextKeys } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/editorContextKeys';
|
|
6
10
|
import { CopyAction } from '@codingame/monaco-vscode-api/vscode/vs/editor/contrib/clipboard/browser/clipboard';
|
|
7
|
-
import { localize2 } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
8
|
-
import {
|
|
11
|
+
import { localize, localize2 } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
12
|
+
import { IActionViewItemService } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/browser/actionViewItemService.service';
|
|
13
|
+
import { MenuEntryActionViewItem } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/browser/menuEntryActionViewItem';
|
|
14
|
+
import { Action2, MenuId, MenuItemAction, registerAction2 } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/common/actions';
|
|
9
15
|
import { IClipboardService } from '@codingame/monaco-vscode-api/vscode/vs/platform/clipboard/common/clipboardService.service';
|
|
10
16
|
import { ContextKeyExpr } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey';
|
|
11
17
|
import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
|
|
12
18
|
import { KeybindingWeight } from '@codingame/monaco-vscode-api/vscode/vs/platform/keybinding/common/keybindingsRegistry';
|
|
19
|
+
import { ILabelService } from '@codingame/monaco-vscode-api/vscode/vs/platform/label/common/label.service';
|
|
13
20
|
import { TerminalLocation } from '@codingame/monaco-vscode-api/vscode/vs/platform/terminal/common/terminal';
|
|
14
21
|
import { IEditorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service';
|
|
15
22
|
import { accessibleViewInCodeBlock } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/accessibility/browser/accessibilityConfiguration';
|
|
23
|
+
import { InlineChatController } from '@codingame/monaco-vscode-c465110a-57c0-59d7-a6b2-be0a4db7e517-common/vscode/vs/workbench/contrib/inlineChat/browser/inlineChatController';
|
|
16
24
|
import { ITerminalService, ITerminalEditorService, ITerminalGroupService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminal/browser/terminal.service';
|
|
17
25
|
import { ChatAgentLocation } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatAgents';
|
|
18
26
|
import { ChatContextKeys } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatContextKeys';
|
|
19
27
|
import { ChatCopyKind } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService';
|
|
20
28
|
import { IChatService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService.service';
|
|
21
|
-
import { isResponseVM } from '@codingame/monaco-vscode-
|
|
29
|
+
import { isResponseVM } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatViewModel';
|
|
22
30
|
import { IChatWidgetService, IChatCodeBlockContextProviderService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chat.service';
|
|
23
31
|
import { DefaultChatTextEditor } from '@codingame/monaco-vscode-c465110a-57c0-59d7-a6b2-be0a4db7e517-common/vscode/vs/workbench/contrib/chat/browser/codeBlockPart';
|
|
24
|
-
import { CHAT_CATEGORY } from '@codingame/monaco-vscode-
|
|
32
|
+
import { CHAT_CATEGORY } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/actions/chatActions';
|
|
25
33
|
import { ApplyCodeBlockOperation, InsertCodeBlockOperation } from './codeBlockOperations.js';
|
|
26
34
|
|
|
27
35
|
const shellLangIds = [
|
|
@@ -59,12 +67,44 @@ class ChatCodeBlockAction extends Action2 {
|
|
|
59
67
|
return this.runWithContext(accessor, context);
|
|
60
68
|
}
|
|
61
69
|
}
|
|
70
|
+
const APPLY_IN_EDITOR_ID = 'workbench.action.chat.applyInEditor';
|
|
71
|
+
let CodeBlockActionRendering = class CodeBlockActionRendering extends Disposable {
|
|
72
|
+
static { this.ID = 'chat.codeBlockActionRendering'; }
|
|
73
|
+
constructor(actionViewItemService, instantiationService, labelService) {
|
|
74
|
+
super();
|
|
75
|
+
const disposable = actionViewItemService.register(MenuId.ChatCodeBlock, APPLY_IN_EDITOR_ID, (action, options) => {
|
|
76
|
+
if (!(action instanceof MenuItemAction)) {
|
|
77
|
+
return undefined;
|
|
78
|
+
}
|
|
79
|
+
return instantiationService.createInstance(class extends MenuEntryActionViewItem {
|
|
80
|
+
getTooltip() {
|
|
81
|
+
const context = this._context;
|
|
82
|
+
if (isCodeBlockActionContext(context) && context.codemapperUri) {
|
|
83
|
+
const label = labelService.getUriLabel(context.codemapperUri, { relative: true });
|
|
84
|
+
return localize(4270, "Apply to {0}", label);
|
|
85
|
+
}
|
|
86
|
+
return super.getTooltip();
|
|
87
|
+
}
|
|
88
|
+
setActionContext(newContext) {
|
|
89
|
+
super.setActionContext(newContext);
|
|
90
|
+
this.updateTooltip();
|
|
91
|
+
}
|
|
92
|
+
}, action, undefined);
|
|
93
|
+
});
|
|
94
|
+
markAsSingleton(disposable);
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
CodeBlockActionRendering = ( __decorate([
|
|
98
|
+
( __param(0, IActionViewItemService)),
|
|
99
|
+
( __param(1, IInstantiationService)),
|
|
100
|
+
( __param(2, ILabelService))
|
|
101
|
+
], CodeBlockActionRendering));
|
|
62
102
|
function registerChatCodeBlockActions() {
|
|
63
103
|
registerAction2(class CopyCodeBlockAction extends Action2 {
|
|
64
104
|
constructor() {
|
|
65
105
|
super({
|
|
66
106
|
id: 'workbench.action.chat.copyCodeBlock',
|
|
67
|
-
title: ( localize2(
|
|
107
|
+
title: ( localize2(4271, "Copy")),
|
|
68
108
|
f1: false,
|
|
69
109
|
category: CHAT_CATEGORY,
|
|
70
110
|
icon: Codicon.copy,
|
|
@@ -148,8 +188,8 @@ function registerChatCodeBlockActions() {
|
|
|
148
188
|
registerAction2(class SmartApplyInEditorAction extends ChatCodeBlockAction {
|
|
149
189
|
constructor() {
|
|
150
190
|
super({
|
|
151
|
-
id:
|
|
152
|
-
title: ( localize2(
|
|
191
|
+
id: APPLY_IN_EDITOR_ID,
|
|
192
|
+
title: ( localize2(4272, "Apply in Editor")),
|
|
153
193
|
precondition: ChatContextKeys.enabled,
|
|
154
194
|
f1: true,
|
|
155
195
|
category: CHAT_CATEGORY,
|
|
@@ -181,11 +221,11 @@ function registerChatCodeBlockActions() {
|
|
|
181
221
|
return this.operation.run(context);
|
|
182
222
|
}
|
|
183
223
|
});
|
|
184
|
-
registerAction2(class
|
|
224
|
+
registerAction2(class InsertAtCursorAction extends ChatCodeBlockAction {
|
|
185
225
|
constructor() {
|
|
186
226
|
super({
|
|
187
227
|
id: 'workbench.action.chat.insertCodeBlock',
|
|
188
|
-
title: ( localize2(
|
|
228
|
+
title: ( localize2(4273, "Insert At Cursor")),
|
|
189
229
|
precondition: ChatContextKeys.enabled,
|
|
190
230
|
f1: true,
|
|
191
231
|
category: CHAT_CATEGORY,
|
|
@@ -219,7 +259,7 @@ function registerChatCodeBlockActions() {
|
|
|
219
259
|
constructor() {
|
|
220
260
|
super({
|
|
221
261
|
id: 'workbench.action.chat.insertIntoNewFile',
|
|
222
|
-
title: ( localize2(
|
|
262
|
+
title: ( localize2(4274, "Insert into New File")),
|
|
223
263
|
precondition: ChatContextKeys.enabled,
|
|
224
264
|
f1: true,
|
|
225
265
|
category: CHAT_CATEGORY,
|
|
@@ -260,7 +300,7 @@ function registerChatCodeBlockActions() {
|
|
|
260
300
|
constructor() {
|
|
261
301
|
super({
|
|
262
302
|
id: 'workbench.action.chat.runInTerminal',
|
|
263
|
-
title: ( localize2(
|
|
303
|
+
title: ( localize2(4275, "Insert into Terminal")),
|
|
264
304
|
precondition: ChatContextKeys.enabled,
|
|
265
305
|
f1: true,
|
|
266
306
|
category: CHAT_CATEGORY,
|
|
@@ -353,7 +393,7 @@ function registerChatCodeBlockActions() {
|
|
|
353
393
|
constructor() {
|
|
354
394
|
super({
|
|
355
395
|
id: 'workbench.action.chat.nextCodeBlock',
|
|
356
|
-
title: ( localize2(
|
|
396
|
+
title: ( localize2(4276, "Next Code Block")),
|
|
357
397
|
keybinding: {
|
|
358
398
|
primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.PageDown,
|
|
359
399
|
mac: { primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.PageDown, },
|
|
@@ -373,7 +413,7 @@ function registerChatCodeBlockActions() {
|
|
|
373
413
|
constructor() {
|
|
374
414
|
super({
|
|
375
415
|
id: 'workbench.action.chat.previousCodeBlock',
|
|
376
|
-
title: ( localize2(
|
|
416
|
+
title: ( localize2(4277, "Previous Code Block")),
|
|
377
417
|
keybinding: {
|
|
378
418
|
primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.PageUp,
|
|
379
419
|
mac: { primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.PageUp, },
|
|
@@ -430,7 +470,7 @@ function registerChatCodeCompareBlockActions() {
|
|
|
430
470
|
constructor() {
|
|
431
471
|
super({
|
|
432
472
|
id: 'workbench.action.chat.applyCompareEdits',
|
|
433
|
-
title: ( localize2(
|
|
473
|
+
title: ( localize2(4278, "Apply Edits")),
|
|
434
474
|
f1: false,
|
|
435
475
|
category: CHAT_CATEGORY,
|
|
436
476
|
icon: Codicon.gitPullRequestGoToChanges,
|
|
@@ -443,16 +483,38 @@ function registerChatCodeCompareBlockActions() {
|
|
|
443
483
|
});
|
|
444
484
|
}
|
|
445
485
|
async runWithContext(accessor, context) {
|
|
446
|
-
const
|
|
447
|
-
const
|
|
448
|
-
|
|
486
|
+
const editorService = accessor.get(ICodeEditorService);
|
|
487
|
+
const item = context.edit;
|
|
488
|
+
const response = context.element;
|
|
489
|
+
if (item.state?.applied) {
|
|
490
|
+
return false;
|
|
491
|
+
}
|
|
492
|
+
if (!response.response.value.includes(item)) {
|
|
493
|
+
return false;
|
|
494
|
+
}
|
|
495
|
+
const firstEdit = item.edits[0]?.[0];
|
|
496
|
+
if (!firstEdit) {
|
|
497
|
+
return false;
|
|
498
|
+
}
|
|
499
|
+
const textEdits = AsyncIterableObject.fromArray(item.edits);
|
|
500
|
+
const editorToApply = await editorService.openCodeEditor({ resource: item.uri }, null);
|
|
501
|
+
if (editorToApply) {
|
|
502
|
+
const inlineChatController = InlineChatController.get(editorToApply);
|
|
503
|
+
if (inlineChatController) {
|
|
504
|
+
editorToApply.revealLineInCenterIfOutsideViewport(firstEdit.range.startLineNumber);
|
|
505
|
+
inlineChatController.reviewEdits(textEdits, CancellationToken.None);
|
|
506
|
+
response.setEditApplied(item, 1);
|
|
507
|
+
return true;
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
return false;
|
|
449
511
|
}
|
|
450
512
|
});
|
|
451
513
|
registerAction2(class DiscardEditsCompareBlockAction extends ChatCompareCodeBlockAction {
|
|
452
514
|
constructor() {
|
|
453
515
|
super({
|
|
454
516
|
id: 'workbench.action.chat.discardCompareEdits',
|
|
455
|
-
title: ( localize2(
|
|
517
|
+
title: ( localize2(4279, "Discard Edits")),
|
|
456
518
|
f1: false,
|
|
457
519
|
category: CHAT_CATEGORY,
|
|
458
520
|
icon: Codicon.trash,
|
|
@@ -472,4 +534,4 @@ function registerChatCodeCompareBlockActions() {
|
|
|
472
534
|
});
|
|
473
535
|
}
|
|
474
536
|
|
|
475
|
-
export { isCodeBlockActionContext, isCodeCompareBlockActionContext, registerChatCodeBlockActions, registerChatCodeCompareBlockActions };
|
|
537
|
+
export { CodeBlockActionRendering, isCodeBlockActionContext, isCodeCompareBlockActionContext, registerChatCodeBlockActions, registerChatCodeCompareBlockActions };
|