@codingame/monaco-vscode-chat-service-override 11.1.2 → 12.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.d.ts +2 -1
- package/index.js +64 -1
- package/package.json +32 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.d.ts +21 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.js +73 -60
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatClearActions.d.ts +3 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatClearActions.js +73 -81
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.d.ts +9 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.js +73 -112
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContextActions.d.ts +12 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContextActions.js +253 -101
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCopyActions.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCopyActions.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatDeveloperActions.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatDeveloperActions.js +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatFileTreeActions.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatFileTreeActions.js +16 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatGettingStarted.d.ts +23 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatGettingStarted.js +30 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatImportExport.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatImportExport.js +12 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatMoveActions.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatMoveActions.js +22 -20
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.js +23 -20
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/codeBlockOperations.d.ts +52 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/codeBlockOperations.js +50 -47
- package/vscode/src/vs/workbench/contrib/chat/browser/chat.contribution.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chat.contribution.js +124 -95
- package/vscode/src/vs/workbench/contrib/chat/browser/chatAccessibilityService.d.ts +17 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatAccessibilityService.js +6 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEdinputInputContentProvider.d.ts +12 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEdinputInputContentProvider.js +30 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingService.d.ts +69 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingService.js +203 -182
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.d.ts +103 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.js +458 -165
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditor.d.ts +42 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditor.js +14 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/chatParticipant.contribution.d.ts +26 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/{chatParticipantContributions.js → chatParticipant.contribution.js} +101 -92
- package/vscode/src/vs/workbench/contrib/chat/browser/chatPasteProviders.d.ts +42 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatPasteProviders.js +164 -25
- package/vscode/src/vs/workbench/contrib/chat/browser/chatQuick.d.ts +26 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatQuick.js +6 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/chatResponseAccessibleView.d.ts +30 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatResponseAccessibleView.js +10 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup.d.ts +17 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup.js +941 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatVariables.d.ts +26 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatVariables.js +9 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/chatViewPane.d.ts +54 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatViewPane.js +32 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/codeBlockContextProviderService.d.ts +9 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/codeBlockContextProviderService.js +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorContrib.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorContrib.js +8 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorHover.d.ts +26 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorHover.js +16 -19
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputRelatedFilesContrib.d.ts +15 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputRelatedFilesContrib.js +108 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/editorHoverWrapper.d.ts +7 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/editorHoverWrapper.js +3 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/media/editorHoverWrapper.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/languageModelToolsService.d.ts +31 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/languageModelToolsService.js +70 -49
- package/vscode/src/vs/workbench/contrib/chat/browser/media/chatViewSetup.css.js +6 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewsWelcomeHandler.d.ts +7 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/{chatViewsWelcomeContributions.js → chatViewsWelcomeHandler.js} +13 -13
- package/vscode/src/vs/workbench/contrib/chat/common/chatCodeMapperService.d.ts +44 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatCodeMapperService.js +3 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatProgressTypes/chatToolInvocation.d.ts +22 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatProgressTypes/chatToolInvocation.js +1 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatServiceImpl.d.ts +80 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatServiceImpl.js +152 -104
- package/vscode/src/vs/workbench/contrib/chat/common/chatServiceTelemetry.d.ts +8 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatServiceTelemetry.js +2 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatSlashCommands.d.ts +41 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatSlashCommands.js +2 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatWidgetHistoryService.d.ts +31 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatWidgetHistoryService.js +6 -4
- package/vscode/src/vs/workbench/contrib/chat/common/ignoredFiles.d.ts +13 -0
- package/vscode/src/vs/workbench/contrib/chat/common/ignoredFiles.js +1 -0
- package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsContribution.d.ts +24 -0
- package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsContribution.js +23 -21
- package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsParametersSchema.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsParametersSchema.js +1 -0
- package/vscode/src/vs/workbench/contrib/chat/common/voiceChatService.d.ts +39 -0
- package/vscode/src/vs/workbench/contrib/chat/common/voiceChatService.js +20 -19
- package/vscode/src/vs/workbench/contrib/chat/common/voiceChatService.service.d.ts +7 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChat.contribution.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChat.contribution.js +30 -33
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAccessibilityHelp.d.ts +10 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAccessibilityHelp.js +6 -4
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAccessibleView.d.ts +10 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAccessibleView.js +9 -7
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatCurrentLine.d.ts +44 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatCurrentLine.js +247 -83
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatNotebook.d.ts +8 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatNotebook.js +5 -4
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSavingServiceImpl.d.ts +29 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSavingServiceImpl.js +35 -35
- package/chat.js +0 -59
- package/vscode/src/vs/editor/common/diff/documentDiffProvider.js +0 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedFileEntry.js +0 -326
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingTextModelContentProviders.js +0 -76
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditorActions.js +0 -110
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditorController.js +0 -287
- package/vscode/src/vs/workbench/contrib/chat/common/languageModelStats.js +0 -130
- package/vscode/src/vs/workbench/contrib/chat/common/languageModels.js +0 -172
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
|
|
1
2
|
import { Codicon } from 'vscode/vscode/vs/base/common/codicons';
|
|
3
|
+
import { KeyMod, KeyCode } from 'vscode/vscode/vs/base/common/keyCodes';
|
|
2
4
|
import { ICodeEditorService } from 'vscode/vscode/vs/editor/browser/services/codeEditorService';
|
|
3
5
|
import { EditorContextKeys } from 'vscode/vscode/vs/editor/common/editorContextKeys';
|
|
4
6
|
import { CopyAction } from 'vscode/vscode/vs/editor/contrib/clipboard/browser/clipboard';
|
|
@@ -7,20 +9,20 @@ import { Action2, registerAction2, MenuId } from 'vscode/vscode/vs/platform/acti
|
|
|
7
9
|
import { IClipboardService } from 'vscode/vscode/vs/platform/clipboard/common/clipboardService.service';
|
|
8
10
|
import { ContextKeyExpr } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
|
|
9
11
|
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
12
|
+
import { KeybindingWeight } from 'vscode/vscode/vs/platform/keybinding/common/keybindingsRegistry';
|
|
10
13
|
import { TerminalLocation } from 'vscode/vscode/vs/platform/terminal/common/terminal';
|
|
11
14
|
import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService.service';
|
|
12
15
|
import { accessibleViewInCodeBlock } from 'vscode/vscode/vs/workbench/contrib/accessibility/browser/accessibilityConfiguration';
|
|
13
16
|
import { ITerminalService, ITerminalEditorService, ITerminalGroupService } from 'vscode/vscode/vs/workbench/contrib/terminal/browser/terminal.service';
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
17
|
+
import { ChatAgentLocation } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatAgents';
|
|
18
|
+
import { ChatContextKeys } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatContextKeys';
|
|
16
19
|
import { ChatCopyKind } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatService';
|
|
17
20
|
import { IChatService } from 'vscode/vscode/vs/workbench/contrib/chat/common/chatService.service';
|
|
18
|
-
import { isResponseVM } from '@codingame/monaco-vscode-
|
|
21
|
+
import { isResponseVM } from '@codingame/monaco-vscode-fab30422-b487-5f4e-8d30-8b4d266e3fcd-common/vscode/vs/workbench/contrib/chat/common/chatViewModel';
|
|
19
22
|
import { IChatWidgetService, IChatCodeBlockContextProviderService } from 'vscode/vscode/vs/workbench/contrib/chat/browser/chat.service';
|
|
20
|
-
import { DefaultChatTextEditor } from '@codingame/monaco-vscode-
|
|
21
|
-
import '@codingame/monaco-vscode-
|
|
23
|
+
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-fab30422-b487-5f4e-8d30-8b4d266e3fcd-common/vscode/vs/workbench/contrib/chat/browser/actions/chatActions';
|
|
22
25
|
import { ApplyCodeBlockOperation, InsertCodeBlockOperation } from './codeBlockOperations.js';
|
|
23
|
-
import { CHAT_CATEGORY } from 'vscode/vscode/vs/workbench/contrib/chat/browser/actions/chatConstants';
|
|
24
26
|
|
|
25
27
|
const shellLangIds = [
|
|
26
28
|
'fish',
|
|
@@ -62,7 +64,7 @@ function registerChatCodeBlockActions() {
|
|
|
62
64
|
constructor() {
|
|
63
65
|
super({
|
|
64
66
|
id: 'workbench.action.chat.copyCodeBlock',
|
|
65
|
-
title: ( localize2(
|
|
67
|
+
title: ( localize2(4187, "Copy")),
|
|
66
68
|
f1: false,
|
|
67
69
|
category: CHAT_CATEGORY,
|
|
68
70
|
icon: Codicon.copy,
|
|
@@ -147,27 +149,28 @@ function registerChatCodeBlockActions() {
|
|
|
147
149
|
constructor() {
|
|
148
150
|
super({
|
|
149
151
|
id: 'workbench.action.chat.applyInEditor',
|
|
150
|
-
title: ( localize2(
|
|
151
|
-
precondition:
|
|
152
|
+
title: ( localize2(4188, "Apply in Editor")),
|
|
153
|
+
precondition: ChatContextKeys.enabled,
|
|
152
154
|
f1: true,
|
|
153
155
|
category: CHAT_CATEGORY,
|
|
154
156
|
icon: Codicon.gitPullRequestGoToChanges,
|
|
155
|
-
menu:
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
e => (
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
157
|
+
menu: [
|
|
158
|
+
{
|
|
159
|
+
id: MenuId.ChatCodeBlock,
|
|
160
|
+
group: 'navigation',
|
|
161
|
+
when: ( ContextKeyExpr.and(...( shellLangIds.map(e => ( ContextKeyExpr.notEquals(EditorContextKeys.languageId.key, e)))))),
|
|
162
|
+
order: 10
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
id: MenuId.ChatCodeBlock,
|
|
166
|
+
when: ( ContextKeyExpr.or(...( shellLangIds.map(e => ( ContextKeyExpr.equals(EditorContextKeys.languageId.key, e))))))
|
|
167
|
+
},
|
|
168
|
+
],
|
|
163
169
|
keybinding: {
|
|
164
|
-
when: (
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
primary: 2048 | 3 ,
|
|
169
|
-
mac: { primary: 256 | 3 },
|
|
170
|
-
weight: 400 + 1
|
|
170
|
+
when: ( ContextKeyExpr.or(( ContextKeyExpr.and(ChatContextKeys.inChatSession, ( ChatContextKeys.inChatInput.negate()))), accessibleViewInCodeBlock)),
|
|
171
|
+
primary: KeyMod.CtrlCmd | KeyCode.Enter,
|
|
172
|
+
mac: { primary: KeyMod.WinCtrl | KeyCode.Enter },
|
|
173
|
+
weight: KeybindingWeight.ExternalExtension + 1
|
|
171
174
|
},
|
|
172
175
|
});
|
|
173
176
|
}
|
|
@@ -178,56 +181,32 @@ function registerChatCodeBlockActions() {
|
|
|
178
181
|
return this.operation.run(context);
|
|
179
182
|
}
|
|
180
183
|
});
|
|
181
|
-
registerAction2(class ApplyAllAction extends Action2 {
|
|
182
|
-
constructor() {
|
|
183
|
-
super({
|
|
184
|
-
id: 'workbench.action.chat.applyAll',
|
|
185
|
-
title: ( localize2(7552, "Apply All Edits")),
|
|
186
|
-
precondition: CONTEXT_CHAT_ENABLED,
|
|
187
|
-
f1: true,
|
|
188
|
-
category: CHAT_CATEGORY,
|
|
189
|
-
icon: Codicon.edit
|
|
190
|
-
});
|
|
191
|
-
}
|
|
192
|
-
async run(accessor, ...args) {
|
|
193
|
-
const chatWidgetService = accessor.get(IChatWidgetService);
|
|
194
|
-
const chatEditingService = accessor.get(IChatEditingService);
|
|
195
|
-
const widget = chatWidgetService.lastFocusedWidget;
|
|
196
|
-
if (!widget || !widget.viewModel) {
|
|
197
|
-
return;
|
|
198
|
-
}
|
|
199
|
-
const applyEditsId = args[0];
|
|
200
|
-
const chatModel = widget.viewModel.model;
|
|
201
|
-
const request = chatModel.getRequests().find(request => request.response?.result?.metadata?.applyEditsId === applyEditsId);
|
|
202
|
-
if (request && request.response) {
|
|
203
|
-
await chatEditingService.startOrContinueEditingSession(widget.viewModel.sessionId, { silent: true });
|
|
204
|
-
await chatEditingService.triggerEditComputation(request.response);
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
});
|
|
208
184
|
registerAction2(class SmartApplyInEditorAction extends ChatCodeBlockAction {
|
|
209
185
|
constructor() {
|
|
210
186
|
super({
|
|
211
187
|
id: 'workbench.action.chat.insertCodeBlock',
|
|
212
|
-
title: ( localize2(
|
|
213
|
-
precondition:
|
|
188
|
+
title: ( localize2(4189, "Insert At Cursor")),
|
|
189
|
+
precondition: ChatContextKeys.enabled,
|
|
214
190
|
f1: true,
|
|
215
191
|
category: CHAT_CATEGORY,
|
|
216
192
|
icon: Codicon.insert,
|
|
217
|
-
menu: {
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
193
|
+
menu: [{
|
|
194
|
+
id: MenuId.ChatCodeBlock,
|
|
195
|
+
group: 'navigation',
|
|
196
|
+
when: ( ContextKeyExpr.and(ChatContextKeys.inChatSession, ( ChatContextKeys.location.notEqualsTo(ChatAgentLocation.Terminal)))),
|
|
197
|
+
order: 20
|
|
198
|
+
}, {
|
|
199
|
+
id: MenuId.ChatCodeBlock,
|
|
200
|
+
group: 'navigation',
|
|
201
|
+
when: ( ContextKeyExpr.and(ChatContextKeys.inChatSession, ( ChatContextKeys.location.isEqualTo(ChatAgentLocation.Terminal)))),
|
|
202
|
+
isHiddenByDefault: true,
|
|
203
|
+
order: 20
|
|
204
|
+
}],
|
|
223
205
|
keybinding: {
|
|
224
|
-
when: (
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
primary: 2048 | 3 ,
|
|
229
|
-
mac: { primary: 256 | 3 },
|
|
230
|
-
weight: 400 + 1
|
|
206
|
+
when: ( ContextKeyExpr.or(( ContextKeyExpr.and(ChatContextKeys.inChatSession, ( ChatContextKeys.inChatInput.negate()))), accessibleViewInCodeBlock)),
|
|
207
|
+
primary: KeyMod.CtrlCmd | KeyCode.Enter,
|
|
208
|
+
mac: { primary: KeyMod.WinCtrl | KeyCode.Enter },
|
|
209
|
+
weight: KeybindingWeight.ExternalExtension + 1
|
|
231
210
|
},
|
|
232
211
|
});
|
|
233
212
|
}
|
|
@@ -240,8 +219,8 @@ function registerChatCodeBlockActions() {
|
|
|
240
219
|
constructor() {
|
|
241
220
|
super({
|
|
242
221
|
id: 'workbench.action.chat.insertIntoNewFile',
|
|
243
|
-
title: ( localize2(
|
|
244
|
-
precondition:
|
|
222
|
+
title: ( localize2(4190, "Insert into New File")),
|
|
223
|
+
precondition: ChatContextKeys.enabled,
|
|
245
224
|
f1: true,
|
|
246
225
|
category: CHAT_CATEGORY,
|
|
247
226
|
icon: Codicon.newFile,
|
|
@@ -281,36 +260,29 @@ function registerChatCodeBlockActions() {
|
|
|
281
260
|
constructor() {
|
|
282
261
|
super({
|
|
283
262
|
id: 'workbench.action.chat.runInTerminal',
|
|
284
|
-
title: ( localize2(
|
|
285
|
-
precondition:
|
|
263
|
+
title: ( localize2(4191, "Insert into Terminal")),
|
|
264
|
+
precondition: ChatContextKeys.enabled,
|
|
286
265
|
f1: true,
|
|
287
266
|
category: CHAT_CATEGORY,
|
|
288
267
|
icon: Codicon.terminal,
|
|
289
268
|
menu: [{
|
|
290
269
|
id: MenuId.ChatCodeBlock,
|
|
291
270
|
group: 'navigation',
|
|
292
|
-
when: (
|
|
293
|
-
CONTEXT_IN_CHAT_SESSION,
|
|
294
|
-
(ContextKeyExpr.or(...( (shellLangIds.map(
|
|
295
|
-
e => ( (ContextKeyExpr.equals(EditorContextKeys.languageId.key, e)))
|
|
296
|
-
)))))
|
|
297
|
-
))),
|
|
271
|
+
when: ( ContextKeyExpr.and(ChatContextKeys.inChatSession, ( ContextKeyExpr.or(...( shellLangIds.map(e => ( ContextKeyExpr.equals(EditorContextKeys.languageId.key, e)))))))),
|
|
298
272
|
},
|
|
299
273
|
{
|
|
300
274
|
id: MenuId.ChatCodeBlock,
|
|
301
275
|
group: 'navigation',
|
|
302
276
|
isHiddenByDefault: true,
|
|
303
|
-
when: (
|
|
304
|
-
e => ( (ContextKeyExpr.notEquals(EditorContextKeys.languageId.key, e)))
|
|
305
|
-
))))))
|
|
277
|
+
when: ( ContextKeyExpr.and(ChatContextKeys.inChatSession, ...( shellLangIds.map(e => ( ContextKeyExpr.notEquals(EditorContextKeys.languageId.key, e))))))
|
|
306
278
|
}],
|
|
307
279
|
keybinding: [{
|
|
308
|
-
primary:
|
|
280
|
+
primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.Enter,
|
|
309
281
|
mac: {
|
|
310
|
-
primary:
|
|
282
|
+
primary: KeyMod.WinCtrl | KeyMod.Alt | KeyCode.Enter
|
|
311
283
|
},
|
|
312
|
-
weight:
|
|
313
|
-
when: (
|
|
284
|
+
weight: KeybindingWeight.EditorContrib,
|
|
285
|
+
when: ( ContextKeyExpr.or(ChatContextKeys.inChatSession, accessibleViewInCodeBlock)),
|
|
314
286
|
}]
|
|
315
287
|
});
|
|
316
288
|
}
|
|
@@ -381,14 +353,14 @@ function registerChatCodeBlockActions() {
|
|
|
381
353
|
constructor() {
|
|
382
354
|
super({
|
|
383
355
|
id: 'workbench.action.chat.nextCodeBlock',
|
|
384
|
-
title: ( localize2(
|
|
356
|
+
title: ( localize2(4192, "Next Code Block")),
|
|
385
357
|
keybinding: {
|
|
386
|
-
primary:
|
|
387
|
-
mac: { primary:
|
|
388
|
-
weight:
|
|
389
|
-
when:
|
|
358
|
+
primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.PageDown,
|
|
359
|
+
mac: { primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.PageDown, },
|
|
360
|
+
weight: KeybindingWeight.WorkbenchContrib,
|
|
361
|
+
when: ChatContextKeys.inChatSession,
|
|
390
362
|
},
|
|
391
|
-
precondition:
|
|
363
|
+
precondition: ChatContextKeys.enabled,
|
|
392
364
|
f1: true,
|
|
393
365
|
category: CHAT_CATEGORY,
|
|
394
366
|
});
|
|
@@ -401,14 +373,14 @@ function registerChatCodeBlockActions() {
|
|
|
401
373
|
constructor() {
|
|
402
374
|
super({
|
|
403
375
|
id: 'workbench.action.chat.previousCodeBlock',
|
|
404
|
-
title: ( localize2(
|
|
376
|
+
title: ( localize2(4193, "Previous Code Block")),
|
|
405
377
|
keybinding: {
|
|
406
|
-
primary:
|
|
407
|
-
mac: { primary:
|
|
408
|
-
weight:
|
|
409
|
-
when:
|
|
378
|
+
primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.PageUp,
|
|
379
|
+
mac: { primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.PageUp, },
|
|
380
|
+
weight: KeybindingWeight.WorkbenchContrib,
|
|
381
|
+
when: ChatContextKeys.inChatSession,
|
|
410
382
|
},
|
|
411
|
-
precondition:
|
|
383
|
+
precondition: ChatContextKeys.enabled,
|
|
412
384
|
f1: true,
|
|
413
385
|
category: CHAT_CATEGORY,
|
|
414
386
|
});
|
|
@@ -458,14 +430,11 @@ function registerChatCodeCompareBlockActions() {
|
|
|
458
430
|
constructor() {
|
|
459
431
|
super({
|
|
460
432
|
id: 'workbench.action.chat.applyCompareEdits',
|
|
461
|
-
title: ( localize2(
|
|
433
|
+
title: ( localize2(4194, "Apply Edits")),
|
|
462
434
|
f1: false,
|
|
463
435
|
category: CHAT_CATEGORY,
|
|
464
|
-
icon: Codicon.
|
|
465
|
-
precondition: (
|
|
466
|
-
EditorContextKeys.hasChanges,
|
|
467
|
-
(CONTEXT_CHAT_EDIT_APPLIED.negate())
|
|
468
|
-
))),
|
|
436
|
+
icon: Codicon.gitPullRequestGoToChanges,
|
|
437
|
+
precondition: ( ContextKeyExpr.and(EditorContextKeys.hasChanges, ( ChatContextKeys.editApplied.negate()))),
|
|
469
438
|
menu: {
|
|
470
439
|
id: MenuId.ChatCompareBlock,
|
|
471
440
|
group: 'navigation',
|
|
@@ -474,28 +443,20 @@ function registerChatCodeCompareBlockActions() {
|
|
|
474
443
|
});
|
|
475
444
|
}
|
|
476
445
|
async runWithContext(accessor, context) {
|
|
477
|
-
const editorService = accessor.get(IEditorService);
|
|
478
446
|
const instaService = accessor.get(IInstantiationService);
|
|
479
447
|
const editor = instaService.createInstance(DefaultChatTextEditor);
|
|
480
|
-
await editor.
|
|
481
|
-
await editorService.openEditor({
|
|
482
|
-
resource: context.edit.uri,
|
|
483
|
-
options: { revealIfVisible: true },
|
|
484
|
-
});
|
|
448
|
+
await editor.preview(context.element, context.edit);
|
|
485
449
|
}
|
|
486
450
|
});
|
|
487
451
|
registerAction2(class DiscardEditsCompareBlockAction extends ChatCompareCodeBlockAction {
|
|
488
452
|
constructor() {
|
|
489
453
|
super({
|
|
490
454
|
id: 'workbench.action.chat.discardCompareEdits',
|
|
491
|
-
title: ( localize2(
|
|
455
|
+
title: ( localize2(4195, "Discard Edits")),
|
|
492
456
|
f1: false,
|
|
493
457
|
category: CHAT_CATEGORY,
|
|
494
458
|
icon: Codicon.trash,
|
|
495
|
-
precondition: (
|
|
496
|
-
EditorContextKeys.hasChanges,
|
|
497
|
-
(CONTEXT_CHAT_EDIT_APPLIED.negate())
|
|
498
|
-
))),
|
|
459
|
+
precondition: ( ContextKeyExpr.and(EditorContextKeys.hasChanges, ( ChatContextKeys.editApplied.negate()))),
|
|
499
460
|
menu: {
|
|
500
461
|
id: MenuId.ChatCompareBlock,
|
|
501
462
|
group: 'navigation',
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ServicesAccessor } from "vscode/vscode/vs/editor/browser/editorExtensions";
|
|
2
|
+
import { Action2, IAction2Options } from "vscode/vscode/vs/platform/actions/common/actions";
|
|
3
|
+
export declare function registerChatContextActions(): void;
|
|
4
|
+
export declare class AttachContextAction extends Action2 {
|
|
5
|
+
static readonly ID = "workbench.action.chat.attachContext";
|
|
6
|
+
protected static _cdt: import("vscode/vscode/vs/platform/contextkey/common/contextkey").ContextKeyExpression | undefined;
|
|
7
|
+
constructor(desc?: Readonly<IAction2Options>);
|
|
8
|
+
private _getFileContextId;
|
|
9
|
+
private _attachContext;
|
|
10
|
+
run(accessor: ServicesAccessor, ...args: any[]): Promise<void>;
|
|
11
|
+
private _show;
|
|
12
|
+
}
|