@codingame/monaco-vscode-katex-common 26.2.1 → 27.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/vscode/src/vs/platform/actionWidget/browser/actionWidgetDropdown.d.ts +10 -4
- package/vscode/src/vs/platform/actionWidget/browser/actionWidgetDropdown.js +35 -11
- package/vscode/src/vs/platform/actions/browser/buttonbar.d.ts +3 -0
- package/vscode/src/vs/platform/actions/browser/buttonbar.js +15 -4
- package/vscode/src/vs/platform/mcp/common/modelContextProtocolApps.d.ts +548 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatAccessibilityProvider.js +15 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContinueInAction.d.ts +5 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContinueInAction.js +168 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatElicitationActions.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatExecuteActions.js +67 -51
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatTitleActions.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatTitleActions.js +12 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionHoverWidget.js +9 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsControl.d.ts +8 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsControl.js +42 -19
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsFilter.d.ts +12 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsFilter.js +63 -40
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsOpener.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsViewer.d.ts +7 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsViewer.js +77 -73
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/media/agentsessionsviewer.css +69 -32
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentWidgets.d.ts +23 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentWidgets.js +381 -83
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatImplicitContext.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatImplicitContext.js +28 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/implicitContextAttachment.js +38 -19
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingActions.js +109 -113
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.js +16 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationWidget.js +14 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionPickerActionItem.js +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessions.contribution.d.ts +28 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessions.contribution.js +226 -123
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/searchableOptionPickerActionItem.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewWelcomeController.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatAgentHover.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAgentCommandContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAnonymousRateLimitedPart.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAttachmentsContentPart.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAttachmentsContentPart.js +9 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatChangesSummaryPart.d.ts +1 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatChangesSummaryPart.js +7 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCodeCitationContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCollapsibleContentPart.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCollapsibleContentPart.js +22 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCollapsibleMarkdownContentPart.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCollapsibleMarkdownContentPart.js +11 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCommandContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatConfirmationContentPart.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatConfirmationWidget.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatDiffBlockPart.d.ts +0 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatDiffBlockPart.js +0 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatDisabledClaudeHooksContentPart.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatErrorConfirmationPart.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatErrorConfirmationPart.js +6 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatExtensionsContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatHookContentPart.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatHookContentPart.js +5 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatInlineAnchorWidget.d.ts +0 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatInlineAnchorWidget.js +26 -27
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownContentPart.d.ts +3 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownContentPart.js +52 -22
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMcpServersInteractionContentPart.js +8 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMultiDiffContentPart.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatProgressContentPart.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatProgressContentPart.js +20 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatPullRequestContentPart.d.ts +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatPullRequestContentPart.js +11 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuestionCarouselPart.d.ts +36 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuestionCarouselPart.js +166 -45
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuotaExceededPart.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatReferencesContentPart.d.ts +3 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatReferencesContentPart.js +16 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSubagentContentPart.d.ts +14 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSubagentContentPart.js +98 -26
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSuggestNextWidget.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTaskContentPart.js +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTextEditContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatThinkingContentPart.d.ts +10 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatThinkingContentPart.js +244 -80
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTipContentPart.d.ts +29 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTipContentPart.js +252 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTodoListWidget.d.ts +4 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTodoListWidget.js +39 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatToolInputOutputContentPart.d.ts +5 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatToolInputOutputContentPart.js +36 -23
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatToolOutputContentSubPart.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTreeContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatWorkspaceEditContentPart.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/codeBlockPart.d.ts +5 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/codeBlockPart.js +42 -37
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatCodeBlockPill.css +12 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatConfirmationWidget.css +48 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatHookContentPart.css +9 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatInlineAnchorWidget.css +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatQuestionCarousel.css +351 -422
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatTerminalToolProgressPart.css +14 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatThinkingContent.css +102 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatTipContent.css +69 -19
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/codeBlockPart.css +48 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/abstractToolConfirmationSubPart.d.ts +4 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/abstractToolConfirmationSubPart.js +47 -23
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatExtensionsInstallToolSubPart.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatInputOutputMarkdownProgressPart.d.ts +0 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatInputOutputMarkdownProgressPart.js +0 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMcpAppModel.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMcpAppSubPart.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatSimpleToolProgressPart.d.ts +18 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatSimpleToolProgressPart.js +103 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolConfirmationSubPart.js +15 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolProgressPart.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolProgressPart.js +63 -69
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolConfirmationSubPart.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolConfirmationSubPart.js +7 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolInvocationPart.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolInvocationPart.js +41 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolOutputPart.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolPartUtilities.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolPostExecuteConfirmationPart.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolPostExecuteConfirmationPart.js +6 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolProgressPart.js +13 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolStreamingSubPart.js +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatDragAndDrop.js +11 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListRenderer.d.ts +17 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListRenderer.js +310 -79
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListWidget.d.ts +6 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListWidget.js +13 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatQuestionCarouselAutoReply.d.ts +35 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatQuestionCarouselAutoReply.js +441 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidget.d.ts +24 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidget.js +392 -86
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatFollowups.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.d.ts +52 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.js +271 -187
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelPicker.d.ts +68 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatModelPicker.js +668 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/delegationSessionPickerActionItem.d.ts +12 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/delegationSessionPickerActionItem.js +57 -16
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modePickerActionItem.d.ts +2 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modePickerActionItem.js +78 -45
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modelPickerActionItem.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modelPickerActionItem2.d.ts +28 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modelPickerActionItem2.js +86 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/sessionTargetPickerActionItem.js +9 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/workspacePickerActionItem.js +4 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/media/chat.css +393 -134
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/media/chatViewWelcome.css +36 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageDetails.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageDetails.js +20 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageWidget.d.ts +25 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageWidget.js +141 -79
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/media/chatContextUsageWidget.css +18 -13
- package/vscode/src/vs/workbench/contrib/chat/common/widget/annotations.d.ts +7 -0
- package/vscode/src/vs/workbench/contrib/chat/common/widget/annotations.js +108 -27
- package/vscode/src/vs/workbench/contrib/chat/common/widget/chatColors.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/common/widget/chatColors.js +20 -14
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAffordance.d.ts +4 -6
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAffordance.js +74 -32
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.d.ts +11 -2
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.js +68 -27
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatEditorAffordance.d.ts +5 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatEditorAffordance.js +125 -13
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatGutterAffordance.d.ts +8 -11
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatGutterAffordance.js +54 -45
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatOverlayWidget.d.ts +11 -10
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatOverlayWidget.js +172 -112
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatWidget.js +5 -5
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatZoneWidget.js +1 -1
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/media/inlineChat.css +0 -42
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/media/inlineChatEditorAffordance.css +27 -3
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/media/inlineChatOverlayWidget.css +83 -2
- package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.d.ts +8 -1
- package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.js +58 -33
- package/vscode/src/vs/workbench/contrib/interactive/browser/replInputHintContentWidget.js +3 -3
- package/vscode/src/vs/workbench/contrib/mcp/common/modelContextProtocolApps.d.ts +1 -548
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/executionStatusBarItemController.js +7 -7
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindWidget.js +2 -2
- package/vscode/src/vs/workbench/contrib/replNotebook/browser/replEditor.js +1 -1
- package/vscode/src/vs/workbench/contrib/replNotebook/browser/replEditorInput.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modelPickerActionItem.js +0 -187
- /package/vscode/src/vs/{workbench/contrib → platform}/mcp/common/modelContextProtocolApps.js +0 -0
|
@@ -40,6 +40,7 @@ export declare class ChatImplicitContexts extends Disposable {
|
|
|
40
40
|
readonly onDidChangeValue: Event<void>;
|
|
41
41
|
private _values;
|
|
42
42
|
private readonly _valuesDisposables;
|
|
43
|
+
private _enabled;
|
|
43
44
|
setValues(values: ImplicitContextWithSelection[]): void;
|
|
44
45
|
get values(): ChatImplicitContext[];
|
|
45
46
|
get hasEnabled(): boolean;
|
|
@@ -251,13 +251,16 @@ let ChatImplicitContextContribution = class ChatImplicitContextContribution exte
|
|
|
251
251
|
const setting = this._implicitContextEnablement[widget.location];
|
|
252
252
|
const isFirstInteraction = widget.viewModel?.getItems().length === 0;
|
|
253
253
|
if ((setting === "always" || setting === "first" && isFirstInteraction) && !isPromptFile) {
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
254
|
+
const hasActiveEditor = !!this.editorService.activeEditor;
|
|
255
|
+
if (newValue !== undefined || !widget.input.implicitContext.hasValue || !hasActiveEditor) {
|
|
256
|
+
widget.input.implicitContext.setValues([{
|
|
257
|
+
value: newValue,
|
|
258
|
+
isSelection
|
|
259
|
+
}, {
|
|
260
|
+
value: providerContext,
|
|
261
|
+
isSelection: false
|
|
262
|
+
}]);
|
|
263
|
+
}
|
|
261
264
|
} else {
|
|
262
265
|
widget.input.implicitContext.setValues([]);
|
|
263
266
|
}
|
|
@@ -278,6 +281,7 @@ class ChatImplicitContexts extends Disposable {
|
|
|
278
281
|
this.onDidChangeValue = this._onDidChangeValue.event;
|
|
279
282
|
this._values = this._register(( new DisposableMap()));
|
|
280
283
|
this._valuesDisposables = this._register(( new DisposableStore()));
|
|
284
|
+
this._enabled = false;
|
|
281
285
|
}
|
|
282
286
|
setValues(values) {
|
|
283
287
|
this._valuesDisposables.clear();
|
|
@@ -290,6 +294,7 @@ class ChatImplicitContexts extends Disposable {
|
|
|
290
294
|
for (const value of definedValues) {
|
|
291
295
|
const implicitContext = ( new ChatImplicitContext());
|
|
292
296
|
implicitContext.setValue(value.value, value.isSelection);
|
|
297
|
+
implicitContext.enabled = this._enabled;
|
|
293
298
|
const disposableStore = ( new DisposableStore());
|
|
294
299
|
disposableStore.add(implicitContext.onDidChangeValue(() => {
|
|
295
300
|
this._onDidChangeValue.fire();
|
|
@@ -306,6 +311,7 @@ class ChatImplicitContexts extends Disposable {
|
|
|
306
311
|
return ( Array.from(( this._values.keys())).some(v => v.enabled));
|
|
307
312
|
}
|
|
308
313
|
setEnabled(enabled) {
|
|
314
|
+
this._enabled = enabled;
|
|
309
315
|
this.values.forEach(v => v.enabled = enabled);
|
|
310
316
|
}
|
|
311
317
|
get hasValue() {
|
|
@@ -362,19 +368,27 @@ class ChatImplicitContext extends Disposable {
|
|
|
362
368
|
get name() {
|
|
363
369
|
if (URI.isUri(this.value)) {
|
|
364
370
|
return `file:${basename(this.value)}`;
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
} else if (this.value) {
|
|
371
|
+
}
|
|
372
|
+
if (isLocation(this.value)) {
|
|
368
373
|
return `file:${basename(this.value.uri)}`;
|
|
369
|
-
} else {
|
|
370
|
-
return "implicit";
|
|
371
374
|
}
|
|
375
|
+
if (isStringImplicitContextValue(this.value)) {
|
|
376
|
+
if (this.value.name === undefined && this.value.resourceUri === undefined) {
|
|
377
|
+
throw ( new Error("ChatContextItem must have either a label or a resourceUri"));
|
|
378
|
+
}
|
|
379
|
+
return this.value.name ?? basename(this.value.resourceUri);
|
|
380
|
+
}
|
|
381
|
+
return "implicit";
|
|
372
382
|
}
|
|
373
383
|
get modelDescription() {
|
|
374
384
|
if (URI.isUri(this.value)) {
|
|
375
385
|
return `User's active file`;
|
|
376
386
|
} else if (isStringImplicitContextValue(this.value)) {
|
|
377
|
-
|
|
387
|
+
if (this.value.name === undefined && this.value.resourceUri === undefined) {
|
|
388
|
+
throw ( new Error("ChatContextItem must have either a label or a resourceUri"));
|
|
389
|
+
}
|
|
390
|
+
const contextName = this.value.name ?? basename(this.value.resourceUri);
|
|
391
|
+
return this.value.modelDescription ?? `User's active context from ${contextName}`;
|
|
378
392
|
} else if (this._isSelection) {
|
|
379
393
|
return `User's active selection`;
|
|
380
394
|
} else {
|
|
@@ -429,6 +443,7 @@ class ChatImplicitContext extends Disposable {
|
|
|
429
443
|
modelDescription: this.modelDescription,
|
|
430
444
|
icon: this.value.icon,
|
|
431
445
|
uri: this.value.uri,
|
|
446
|
+
resourceUri: this.value.resourceUri,
|
|
432
447
|
handle: this.value.handle,
|
|
433
448
|
commandId: this.value.commandId
|
|
434
449
|
}];
|
package/vscode/src/vs/workbench/contrib/chat/browser/attachments/implicitContextAttachment.js
CHANGED
|
@@ -5,12 +5,14 @@ import { StandardKeyboardEvent } from '@codingame/monaco-vscode-api/vscode/vs/ba
|
|
|
5
5
|
import { StandardMouseEvent } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/mouseEvent';
|
|
6
6
|
import { Button } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/button/button';
|
|
7
7
|
import { Codicon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/codicons';
|
|
8
|
+
import { ThemeIcon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/themables';
|
|
8
9
|
import { KeyCode } from '@codingame/monaco-vscode-api/vscode/vs/base/common/keyCodes';
|
|
9
10
|
import { Disposable, DisposableStore } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
10
11
|
import { Schemas } from '@codingame/monaco-vscode-api/vscode/vs/base/common/network';
|
|
11
12
|
import { basename, dirname } from '@codingame/monaco-vscode-api/vscode/vs/base/common/resources';
|
|
12
13
|
import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
|
|
13
14
|
import { isLocation } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/languages';
|
|
15
|
+
import { getIconClasses } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/services/getIconClasses';
|
|
14
16
|
import { ILanguageService } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/languages/language.service';
|
|
15
17
|
import { IModelService } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/services/model.service';
|
|
16
18
|
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
@@ -88,13 +90,14 @@ let ImplicitContextAttachmentWidget = class ImplicitContextAttachmentWidget exte
|
|
|
88
90
|
renderMainContext(context, isSelection) {
|
|
89
91
|
const contextNode = $(".chat-attached-context-attachment.show-file-icons.implicit");
|
|
90
92
|
this.domNode.appendChild(contextNode);
|
|
93
|
+
contextNode.tabIndex = 0;
|
|
91
94
|
contextNode.classList.toggle("disabled", !context.enabled);
|
|
92
95
|
const file = context.uri;
|
|
93
|
-
const attachmentTypeName = file?.scheme === Schemas.vscodeNotebookCell ? ( localize(
|
|
96
|
+
const attachmentTypeName = file?.scheme === Schemas.vscodeNotebookCell ? ( localize(5362, "cell")) : ( localize(5363, "file"));
|
|
94
97
|
const isSuggestedEnabled = this.configService.getValue("chat.implicitContext.suggestedContext");
|
|
95
98
|
if (isSuggestedEnabled) {
|
|
96
99
|
if (!isSelection) {
|
|
97
|
-
const buttonMsg = context.enabled ? ( localize(
|
|
100
|
+
const buttonMsg = context.enabled ? ( localize(5364, "Disable current {0} context", attachmentTypeName)) : "";
|
|
98
101
|
const toggleButton = this.renderDisposables.add(( new Button(contextNode, {
|
|
99
102
|
supportIcons: true,
|
|
100
103
|
title: buttonMsg
|
|
@@ -109,7 +112,7 @@ let ImplicitContextAttachmentWidget = class ImplicitContextAttachmentWidget exte
|
|
|
109
112
|
context.enabled = false;
|
|
110
113
|
}));
|
|
111
114
|
} else {
|
|
112
|
-
const pinButtonMsg = ( localize(
|
|
115
|
+
const pinButtonMsg = ( localize(5365, "Pin selection"));
|
|
113
116
|
const pinButton = this.renderDisposables.add(( new Button(contextNode, {
|
|
114
117
|
supportIcons: true,
|
|
115
118
|
title: pinButtonMsg
|
|
@@ -142,7 +145,7 @@ let ImplicitContextAttachmentWidget = class ImplicitContextAttachmentWidget exte
|
|
|
142
145
|
})
|
|
143
146
|
);
|
|
144
147
|
} else {
|
|
145
|
-
const buttonMsg = context.enabled ? ( localize(
|
|
148
|
+
const buttonMsg = context.enabled ? ( localize(5364, "Disable current {0} context", attachmentTypeName)) : ( localize(5366, "Enable current {0} context", attachmentTypeName));
|
|
146
149
|
const toggleButton = this.renderDisposables.add(( new Button(contextNode, {
|
|
147
150
|
supportIcons: true,
|
|
148
151
|
title: buttonMsg
|
|
@@ -160,9 +163,16 @@ let ImplicitContextAttachmentWidget = class ImplicitContextAttachmentWidget exte
|
|
|
160
163
|
let markdownTooltip;
|
|
161
164
|
if (isStringImplicitContextValue(context.value)) {
|
|
162
165
|
markdownTooltip = context.value.tooltip;
|
|
163
|
-
title = this.renderString(
|
|
166
|
+
title = this.renderString(
|
|
167
|
+
label,
|
|
168
|
+
context.name,
|
|
169
|
+
context.icon,
|
|
170
|
+
context.value.resourceUri,
|
|
171
|
+
markdownTooltip,
|
|
172
|
+
( localize(5367, "Current file context"))
|
|
173
|
+
);
|
|
164
174
|
} else {
|
|
165
|
-
title = this.renderResource(context.value, context.isSelection, context.enabled, label);
|
|
175
|
+
title = this.renderResource(context.value, context.isSelection, context.enabled, label, contextNode);
|
|
166
176
|
}
|
|
167
177
|
if (markdownTooltip || title) {
|
|
168
178
|
this.renderDisposables.add(this.hoverService.setupDelayedHover(contextNode, {
|
|
@@ -197,34 +207,43 @@ let ImplicitContextAttachmentWidget = class ImplicitContextAttachmentWidget exte
|
|
|
197
207
|
})
|
|
198
208
|
);
|
|
199
209
|
}
|
|
200
|
-
renderString(resourceLabel, name, icon, markdownTooltip, defaultTitle) {
|
|
210
|
+
renderString(resourceLabel, name, icon, resourceUri, markdownTooltip, defaultTitle) {
|
|
201
211
|
const title = markdownTooltip ? undefined : defaultTitle;
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
212
|
+
if (icon && (ThemeIcon.isFile(icon) || ThemeIcon.isFolder(icon)) && resourceUri) {
|
|
213
|
+
const fileKind = ThemeIcon.isFolder(icon) ? FileKind.FOLDER : FileKind.FILE;
|
|
214
|
+
const iconClasses = getIconClasses(this.modelService, this.languageService, resourceUri, fileKind);
|
|
215
|
+
resourceLabel.setLabel(name, undefined, {
|
|
216
|
+
extraClasses: iconClasses,
|
|
217
|
+
title
|
|
218
|
+
});
|
|
219
|
+
} else {
|
|
220
|
+
resourceLabel.setLabel(name, undefined, {
|
|
221
|
+
iconPath: icon,
|
|
222
|
+
title
|
|
223
|
+
});
|
|
224
|
+
}
|
|
206
225
|
return title;
|
|
207
226
|
}
|
|
208
|
-
renderResource(attachmentValue, isSelection, enabled, label) {
|
|
227
|
+
renderResource(attachmentValue, isSelection, enabled, label, contextNode) {
|
|
209
228
|
const file = URI.isUri(attachmentValue) ? attachmentValue : attachmentValue.uri;
|
|
210
229
|
const range = URI.isUri(attachmentValue) || !isSelection ? undefined : attachmentValue.range;
|
|
211
|
-
const attachmentTypeName = file.scheme === Schemas.vscodeNotebookCell ? ( localize(
|
|
230
|
+
const attachmentTypeName = file.scheme === Schemas.vscodeNotebookCell ? ( localize(5362, "cell")) : ( localize(5363, "file"));
|
|
212
231
|
const fileBasename = basename(file);
|
|
213
232
|
const fileDirname = dirname(file);
|
|
214
233
|
const friendlyName = `${fileBasename} ${fileDirname}`;
|
|
215
234
|
const ariaLabel = range ? ( localize(
|
|
216
|
-
|
|
235
|
+
5368,
|
|
217
236
|
"Attached {0}, {1}, line {2} to line {3}",
|
|
218
237
|
attachmentTypeName,
|
|
219
238
|
friendlyName,
|
|
220
239
|
range.startLineNumber,
|
|
221
240
|
range.endLineNumber
|
|
222
|
-
)) : ( localize(
|
|
241
|
+
)) : ( localize(5369, "Attached {0}, {1}", attachmentTypeName, friendlyName));
|
|
223
242
|
const uriLabel = this.labelService.getUriLabel(file, {
|
|
224
243
|
relative: true
|
|
225
244
|
});
|
|
226
|
-
const currentFile = ( localize(
|
|
227
|
-
const inactive = ( localize(
|
|
245
|
+
const currentFile = ( localize(5370, "Current {0} context", attachmentTypeName));
|
|
246
|
+
const inactive = ( localize(5371, "Enable current {0} context", attachmentTypeName));
|
|
228
247
|
const currentFileHint = enabled || isSelection ? currentFile : inactive;
|
|
229
248
|
const title = `${currentFileHint}\n${uriLabel}`;
|
|
230
249
|
label.setFile(file, {
|
|
@@ -233,8 +252,7 @@ let ImplicitContextAttachmentWidget = class ImplicitContextAttachmentWidget exte
|
|
|
233
252
|
range,
|
|
234
253
|
title
|
|
235
254
|
});
|
|
236
|
-
|
|
237
|
-
this.domNode.tabIndex = 0;
|
|
255
|
+
contextNode.ariaLabel = ariaLabel;
|
|
238
256
|
return title;
|
|
239
257
|
}
|
|
240
258
|
async convertToRegularAttachment(attachment) {
|
|
@@ -253,6 +271,7 @@ let ImplicitContextAttachmentWidget = class ImplicitContextAttachmentWidget exte
|
|
|
253
271
|
icon: attachment.value.icon,
|
|
254
272
|
modelDescription: attachment.modelDescription,
|
|
255
273
|
uri: attachment.value.uri,
|
|
274
|
+
resourceUri: attachment.value.resourceUri,
|
|
256
275
|
tooltip: attachment.value.tooltip,
|
|
257
276
|
commandId: attachment.value.commandId,
|
|
258
277
|
handle: attachment.value.handle
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { CancellationToken } from '@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation';
|
|
3
3
|
import { Codicon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/codicons';
|
|
4
4
|
import { KeyMod, KeyCode } from '@codingame/monaco-vscode-api/vscode/vs/base/common/keyCodes';
|
|
5
|
+
import { alert } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/aria/aria';
|
|
5
6
|
import { basename } from '@codingame/monaco-vscode-api/vscode/vs/base/common/resources';
|
|
6
7
|
import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
|
|
7
8
|
import { isCodeEditor } from '@codingame/monaco-vscode-api/vscode/vs/editor/browser/editorBrowser';
|
|
@@ -84,7 +85,7 @@ registerAction2(class OpenFileInDiffAction extends WorkingSetAction {
|
|
|
84
85
|
constructor() {
|
|
85
86
|
super({
|
|
86
87
|
id: "chatEditing.openFileInDiff",
|
|
87
|
-
title: ( localize2(
|
|
88
|
+
title: ( localize2(5718, "Open Changes in Diff Editor")),
|
|
88
89
|
icon: Codicon.diffSingle,
|
|
89
90
|
menu: [{
|
|
90
91
|
id: MenuId.ChatEditingWidgetModifiedFilesToolbar,
|
|
@@ -115,7 +116,7 @@ registerAction2(class AcceptAction extends WorkingSetAction {
|
|
|
115
116
|
constructor() {
|
|
116
117
|
super({
|
|
117
118
|
id: "chatEditing.acceptFile",
|
|
118
|
-
title: ( localize2(
|
|
119
|
+
title: ( localize2(5719, "Keep")),
|
|
119
120
|
icon: Codicon.check,
|
|
120
121
|
menu: [{
|
|
121
122
|
when: ( ContextKeyExpr.and(( ContextKeyExpr.equals("resourceScheme", CHAT_EDITING_MULTI_DIFF_SOURCE_RESOLVER_SCHEME)), ContextKeyExpr.notIn(
|
|
@@ -141,7 +142,7 @@ registerAction2(class DiscardAction extends WorkingSetAction {
|
|
|
141
142
|
constructor() {
|
|
142
143
|
super({
|
|
143
144
|
id: "chatEditing.discardFile",
|
|
144
|
-
title: ( localize2(
|
|
145
|
+
title: ( localize2(5720, "Undo")),
|
|
145
146
|
icon: Codicon.discard,
|
|
146
147
|
menu: [{
|
|
147
148
|
when: ( ContextKeyExpr.and(( ContextKeyExpr.equals("resourceScheme", CHAT_EDITING_MULTI_DIFF_SOURCE_RESOLVER_SCHEME)), ContextKeyExpr.notIn(
|
|
@@ -167,9 +168,9 @@ class ChatEditingAcceptAllAction extends EditingSessionAction {
|
|
|
167
168
|
constructor() {
|
|
168
169
|
super({
|
|
169
170
|
id: "chatEditing.acceptAllFiles",
|
|
170
|
-
title: ( localize(
|
|
171
|
+
title: ( localize(5721, "Keep")),
|
|
171
172
|
icon: Codicon.check,
|
|
172
|
-
tooltip: ( localize(
|
|
173
|
+
tooltip: ( localize(5722, "Keep All Edits")),
|
|
173
174
|
precondition: hasUndecidedChatEditingResourceContextKey,
|
|
174
175
|
keybinding: {
|
|
175
176
|
primary: KeyMod.CtrlCmd | KeyCode.Enter,
|
|
@@ -193,9 +194,9 @@ class ChatEditingDiscardAllAction extends EditingSessionAction {
|
|
|
193
194
|
constructor() {
|
|
194
195
|
super({
|
|
195
196
|
id: "chatEditing.discardAllFiles",
|
|
196
|
-
title: ( localize(
|
|
197
|
+
title: ( localize(5723, "Undo")),
|
|
197
198
|
icon: Codicon.discard,
|
|
198
|
-
tooltip: ( localize(
|
|
199
|
+
tooltip: ( localize(5724, "Undo All Edits")),
|
|
199
200
|
precondition: hasUndecidedChatEditingResourceContextKey,
|
|
200
201
|
menu: [{
|
|
201
202
|
id: MenuId.ChatEditingWidgetToolbar,
|
|
@@ -226,8 +227,8 @@ class ToggleExplanationWidgetAction extends EditingSessionAction {
|
|
|
226
227
|
constructor() {
|
|
227
228
|
super({
|
|
228
229
|
id: ToggleExplanationWidgetAction.ID,
|
|
229
|
-
title: ( localize(
|
|
230
|
-
tooltip: ( localize(
|
|
230
|
+
title: ( localize(5725, "Explain")),
|
|
231
|
+
tooltip: ( localize(5726, "Toggle Change Explanations")),
|
|
231
232
|
precondition: hasUndecidedChatEditingResourceContextKey,
|
|
232
233
|
menu: [{
|
|
233
234
|
id: MenuId.ChatEditingWidgetToolbar,
|
|
@@ -251,17 +252,17 @@ async function discardAllEditsWithConfirmation(accessor, currentEditingSession)
|
|
|
251
252
|
const entries = currentEditingSession.entries.get().filter(e => e.state.get() === ModifiedFileEntryState.Modified);
|
|
252
253
|
if (entries.length > 0) {
|
|
253
254
|
const confirmation = await dialogService.confirm({
|
|
254
|
-
title: ( localize(
|
|
255
|
+
title: ( localize(5727, "Undo all edits?")),
|
|
255
256
|
message: entries.length === 1 ? ( localize(
|
|
256
|
-
|
|
257
|
+
5728,
|
|
257
258
|
"This will undo changes made in {0}. Do you want to proceed?",
|
|
258
259
|
basename(entries[0].modifiedURI)
|
|
259
260
|
)) : ( localize(
|
|
260
|
-
|
|
261
|
+
5729,
|
|
261
262
|
"This will undo changes made in {0} files. Do you want to proceed?",
|
|
262
263
|
entries.length
|
|
263
264
|
)),
|
|
264
|
-
primaryButton: ( localize(
|
|
265
|
+
primaryButton: ( localize(5730, "Yes")),
|
|
265
266
|
type: "info"
|
|
266
267
|
});
|
|
267
268
|
if (!confirmation.confirmed) {
|
|
@@ -276,7 +277,7 @@ class ChatEditingShowChangesAction extends EditingSessionAction {
|
|
|
276
277
|
this.ID = "chatEditing.viewChanges";
|
|
277
278
|
}
|
|
278
279
|
static {
|
|
279
|
-
this.LABEL = ( localize(
|
|
280
|
+
this.LABEL = ( localize(5731, "View All Edits"));
|
|
280
281
|
}
|
|
281
282
|
constructor() {
|
|
282
283
|
super({
|
|
@@ -309,7 +310,7 @@ class ViewAllSessionChangesAction extends Action2 {
|
|
|
309
310
|
constructor() {
|
|
310
311
|
super({
|
|
311
312
|
id: ViewAllSessionChangesAction.ID,
|
|
312
|
-
title: ( localize2(
|
|
313
|
+
title: ( localize2(5732, "View All Changes")),
|
|
313
314
|
icon: Codicon.diffMultiple,
|
|
314
315
|
category: CHAT_CATEGORY,
|
|
315
316
|
precondition: ChatContextKeys.hasAgentSessionChanges,
|
|
@@ -351,7 +352,7 @@ class ViewAllSessionChangesAction extends Action2 {
|
|
|
351
352
|
multiDiffSourceUri: sessionResource.with({
|
|
352
353
|
scheme: sessionResource.scheme + "-worktree-changes"
|
|
353
354
|
}),
|
|
354
|
-
title: ( localize(
|
|
355
|
+
title: ( localize(5733, "All Session Changes")),
|
|
355
356
|
resources
|
|
356
357
|
});
|
|
357
358
|
session?.setRead(true);
|
|
@@ -363,13 +364,13 @@ class ViewAllSessionChangesAction extends Action2 {
|
|
|
363
364
|
}
|
|
364
365
|
}
|
|
365
366
|
registerAction2(ViewAllSessionChangesAction);
|
|
366
|
-
async function
|
|
367
|
+
async function restoreSnapshotWithConfirmationByRequestId(accessor, sessionResource, requestId) {
|
|
367
368
|
const configurationService = accessor.get(IConfigurationService);
|
|
368
369
|
const dialogService = accessor.get(IDialogService);
|
|
369
370
|
const chatWidgetService = accessor.get(IChatWidgetService);
|
|
370
|
-
const widget = chatWidgetService.getWidgetBySessionResource(
|
|
371
|
+
const widget = chatWidgetService.getWidgetBySessionResource(sessionResource);
|
|
371
372
|
const chatService = accessor.get(IChatService);
|
|
372
|
-
const chatModel = chatService.getSession(
|
|
373
|
+
const chatModel = chatService.getSession(sessionResource);
|
|
373
374
|
if (!chatModel) {
|
|
374
375
|
return;
|
|
375
376
|
}
|
|
@@ -377,73 +378,80 @@ async function restoreSnapshotWithConfirmation(accessor, item) {
|
|
|
377
378
|
if (!session) {
|
|
378
379
|
return;
|
|
379
380
|
}
|
|
380
|
-
const
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
)
|
|
397
|
-
|
|
398
|
-
message = ( localize(
|
|
399
|
-
5303,
|
|
400
|
-
"This will remove your last request and undo edits made to {0} files in your working set. Do you want to proceed?",
|
|
401
|
-
entriesModifiedInRequestsToRemove.length
|
|
402
|
-
));
|
|
403
|
-
}
|
|
381
|
+
const chatRequests = chatModel.getRequests();
|
|
382
|
+
const itemIndex = chatRequests.findIndex(request => request.id === requestId);
|
|
383
|
+
if (itemIndex === -1) {
|
|
384
|
+
return;
|
|
385
|
+
}
|
|
386
|
+
const editsToUndo = chatRequests.length - itemIndex;
|
|
387
|
+
const requestsToRemove = chatRequests.slice(itemIndex);
|
|
388
|
+
const requestIdsToRemove = ( new Set(( requestsToRemove.map(request => request.id))));
|
|
389
|
+
const entriesModifiedInRequestsToRemove = session.entries.get().filter(entry => ( requestIdsToRemove.has(entry.lastModifyingRequestId))) ?? [];
|
|
390
|
+
const shouldPrompt = entriesModifiedInRequestsToRemove.length > 0 && configurationService.getValue("chat.editing.confirmEditRequestRemoval") === true;
|
|
391
|
+
let message;
|
|
392
|
+
if (editsToUndo === 1) {
|
|
393
|
+
if (entriesModifiedInRequestsToRemove.length === 1) {
|
|
394
|
+
message = ( localize(
|
|
395
|
+
5734,
|
|
396
|
+
"This will remove your last request and undo the edits made to {0}. Do you want to proceed?",
|
|
397
|
+
basename(entriesModifiedInRequestsToRemove[0].modifiedURI)
|
|
398
|
+
));
|
|
404
399
|
} else {
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
)
|
|
417
|
-
|
|
418
|
-
}
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
400
|
+
message = ( localize(
|
|
401
|
+
5735,
|
|
402
|
+
"This will remove your last request and undo edits made to {0} files in your working set. Do you want to proceed?",
|
|
403
|
+
entriesModifiedInRequestsToRemove.length
|
|
404
|
+
));
|
|
405
|
+
}
|
|
406
|
+
} else {
|
|
407
|
+
if (entriesModifiedInRequestsToRemove.length === 1) {
|
|
408
|
+
message = ( localize(
|
|
409
|
+
5736,
|
|
410
|
+
"This will remove all subsequent requests and undo edits made to {0}. Do you want to proceed?",
|
|
411
|
+
basename(entriesModifiedInRequestsToRemove[0].modifiedURI)
|
|
412
|
+
));
|
|
413
|
+
} else {
|
|
414
|
+
message = ( localize(
|
|
415
|
+
5737,
|
|
416
|
+
"This will remove all subsequent requests and undo edits made to {0} files in your working set. Do you want to proceed?",
|
|
417
|
+
entriesModifiedInRequestsToRemove.length
|
|
418
|
+
));
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
const confirmation = shouldPrompt ? await dialogService.confirm({
|
|
422
|
+
title: editsToUndo === 1 ? ( localize(5738, "Do you want to undo your last edit?")) : ( localize(5739, "Do you want to undo {0} edits?", editsToUndo)),
|
|
423
|
+
message: message,
|
|
424
|
+
primaryButton: ( localize(5740, "Yes")),
|
|
425
|
+
checkbox: {
|
|
426
|
+
label: ( localize(5741, "Don't ask again")),
|
|
427
|
+
checked: false
|
|
428
|
+
},
|
|
429
|
+
type: "info"
|
|
430
|
+
}) : {
|
|
431
|
+
confirmed: true
|
|
432
|
+
};
|
|
433
|
+
if (!confirmation.confirmed) {
|
|
434
|
+
widget?.viewModel?.model.setCheckpoint(undefined);
|
|
435
|
+
return;
|
|
436
|
+
}
|
|
437
|
+
if (confirmation.checkboxChecked) {
|
|
438
|
+
await configurationService.updateValue("chat.editing.confirmEditRequestRemoval", false);
|
|
440
439
|
}
|
|
440
|
+
const snapshotRequestId = chatRequests[itemIndex].id;
|
|
441
|
+
await session.restoreSnapshot(snapshotRequestId, undefined);
|
|
442
|
+
}
|
|
443
|
+
async function restoreSnapshotWithConfirmation(accessor, item) {
|
|
444
|
+
const requestId = isRequestVM(item) ? item.id : isResponseVM(item) ? item.requestId : undefined;
|
|
445
|
+
if (!requestId) {
|
|
446
|
+
return;
|
|
447
|
+
}
|
|
448
|
+
await restoreSnapshotWithConfirmationByRequestId(accessor, item.sessionResource, requestId);
|
|
441
449
|
}
|
|
442
450
|
registerAction2(class RemoveAction extends Action2 {
|
|
443
451
|
constructor() {
|
|
444
452
|
super({
|
|
445
453
|
id: "workbench.action.chat.undoEdits",
|
|
446
|
-
title: ( localize2(
|
|
454
|
+
title: ( localize2(5742, "Undo Requests")),
|
|
447
455
|
f1: false,
|
|
448
456
|
category: CHAT_CATEGORY,
|
|
449
457
|
icon: Codicon.discard,
|
|
@@ -485,8 +493,8 @@ registerAction2(class RestoreCheckpointAction extends Action2 {
|
|
|
485
493
|
constructor() {
|
|
486
494
|
super({
|
|
487
495
|
id: "workbench.action.chat.restoreCheckpoint",
|
|
488
|
-
title: ( localize2(
|
|
489
|
-
tooltip: ( localize2(
|
|
496
|
+
title: ( localize2(5743, "Restore Checkpoint")),
|
|
497
|
+
tooltip: ( localize2(5744, "Restores workspace and chat to this point")),
|
|
490
498
|
f1: false,
|
|
491
499
|
category: CHAT_CATEGORY,
|
|
492
500
|
keybinding: {
|
|
@@ -527,20 +535,11 @@ registerAction2(class RestoreLastCheckpoint extends Action2 {
|
|
|
527
535
|
constructor() {
|
|
528
536
|
super({
|
|
529
537
|
id: "workbench.action.chat.restoreLastCheckpoint",
|
|
530
|
-
title: ( localize2(
|
|
531
|
-
f1:
|
|
538
|
+
title: ( localize2(5745, "Restore to Last Checkpoint")),
|
|
539
|
+
f1: true,
|
|
532
540
|
category: CHAT_CATEGORY,
|
|
533
541
|
icon: Codicon.discard,
|
|
534
|
-
|
|
535
|
-
id: MenuId.ChatMessageFooter,
|
|
536
|
-
group: "navigation",
|
|
537
|
-
order: 1,
|
|
538
|
-
when: ( ContextKeyExpr.and(
|
|
539
|
-
ContextKeyExpr.in(ChatContextKeys.itemId.key, ChatContextKeys.lastItemId.key),
|
|
540
|
-
( ContextKeyExpr.equals(`config.${ChatConfiguration.CheckpointsEnabled}`, true)),
|
|
541
|
-
( ChatContextKeys.lockedToCodingAgent.negate())
|
|
542
|
-
))
|
|
543
|
-
}]
|
|
542
|
+
precondition: ( ContextKeyExpr.and(ChatContextKeys.inChatSession, ( ContextKeyExpr.equals(`config.${ChatConfiguration.CheckpointsEnabled}`, true)), ( ChatContextKeys.lockedToCodingAgent.negate())))
|
|
544
543
|
});
|
|
545
544
|
}
|
|
546
545
|
async run(accessor, ...args) {
|
|
@@ -551,33 +550,30 @@ registerAction2(class RestoreLastCheckpoint extends Action2 {
|
|
|
551
550
|
if (!isResponseVM(item) && !isRequestVM(item)) {
|
|
552
551
|
item = widget?.getFocus();
|
|
553
552
|
}
|
|
554
|
-
|
|
553
|
+
const sessionResource = widget?.viewModel?.sessionResource ?? (isChatTreeItem(item) ? item.sessionResource : undefined);
|
|
554
|
+
if (!sessionResource) {
|
|
555
555
|
return;
|
|
556
556
|
}
|
|
557
|
-
const chatModel = chatService.getSession(
|
|
558
|
-
if (!chatModel) {
|
|
557
|
+
const chatModel = chatService.getSession(sessionResource);
|
|
558
|
+
if (!chatModel?.editingSession) {
|
|
559
559
|
return;
|
|
560
560
|
}
|
|
561
|
-
const
|
|
562
|
-
if (!
|
|
561
|
+
const checkpointRequest = chatModel.checkpoint;
|
|
562
|
+
if (!checkpointRequest) {
|
|
563
|
+
alert(( localize(5746, "There is no checkpoint to restore.")));
|
|
563
564
|
return;
|
|
564
565
|
}
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
if (request) {
|
|
570
|
-
widget?.focusInput();
|
|
571
|
-
widget?.input.setValue(request.message.text, false);
|
|
572
|
-
}
|
|
573
|
-
}
|
|
566
|
+
widget?.viewModel?.model.setCheckpoint(checkpointRequest.id);
|
|
567
|
+
widget?.focusInput();
|
|
568
|
+
widget?.input.setValue(checkpointRequest.message.text, false);
|
|
569
|
+
await restoreSnapshotWithConfirmationByRequestId(accessor, sessionResource, checkpointRequest.id);
|
|
574
570
|
}
|
|
575
571
|
});
|
|
576
572
|
registerAction2(class EditAction extends Action2 {
|
|
577
573
|
constructor() {
|
|
578
574
|
super({
|
|
579
575
|
id: "workbench.action.chat.editRequests",
|
|
580
|
-
title: ( localize2(
|
|
576
|
+
title: ( localize2(5747, "Edit Request")),
|
|
581
577
|
f1: false,
|
|
582
578
|
category: CHAT_CATEGORY,
|
|
583
579
|
icon: Codicon.edit,
|
|
@@ -616,7 +612,7 @@ registerAction2(class OpenWorkingSetHistoryAction extends Action2 {
|
|
|
616
612
|
constructor() {
|
|
617
613
|
super({
|
|
618
614
|
id: OpenWorkingSetHistoryAction.id,
|
|
619
|
-
title: ( localize(
|
|
615
|
+
title: ( localize(5748, "Open File")),
|
|
620
616
|
menu: [{
|
|
621
617
|
id: MenuId.ChatEditingCodeBlockContext,
|
|
622
618
|
group: "navigation",
|
|
@@ -642,7 +638,7 @@ registerAction2(class OpenWorkingSetHistoryAction extends Action2 {
|
|
|
642
638
|
constructor() {
|
|
643
639
|
super({
|
|
644
640
|
id: OpenWorkingSetHistoryAction.id,
|
|
645
|
-
title: ( localize(
|
|
641
|
+
title: ( localize(5749, "Open File Snapshot")),
|
|
646
642
|
menu: [{
|
|
647
643
|
id: MenuId.ChatEditingCodeBlockContext,
|
|
648
644
|
group: "navigation",
|
|
@@ -666,7 +662,7 @@ registerAction2(class OpenWorkingSetHistoryAction extends Action2 {
|
|
|
666
662
|
if (snapshot) {
|
|
667
663
|
const editor = await editorService.openEditor({
|
|
668
664
|
resource: snapshot,
|
|
669
|
-
label: ( localize(
|
|
665
|
+
label: ( localize(5750, "{0} (Snapshot)", basename(context.uri))),
|
|
670
666
|
options: {
|
|
671
667
|
activation: EditorActivation.ACTIVATE
|
|
672
668
|
}
|
|
@@ -683,7 +679,7 @@ registerAction2(class ResolveSymbolsContextAction extends EditingSessionAction {
|
|
|
683
679
|
constructor() {
|
|
684
680
|
super({
|
|
685
681
|
id: "workbench.action.edits.addFilesFromReferences",
|
|
686
|
-
title: ( localize2(
|
|
682
|
+
title: ( localize2(5751, "Add Files From References")),
|
|
687
683
|
f1: false,
|
|
688
684
|
category: CHAT_CATEGORY,
|
|
689
685
|
menu: {
|
|
@@ -747,7 +743,7 @@ class ViewPreviousEditsAction extends EditingSessionAction {
|
|
|
747
743
|
this.Id = "chatEditing.viewPreviousEdits";
|
|
748
744
|
}
|
|
749
745
|
static {
|
|
750
|
-
this.Label = ( localize(
|
|
746
|
+
this.Label = ( localize(5752, "View Previous Edits"));
|
|
751
747
|
}
|
|
752
748
|
constructor() {
|
|
753
749
|
super({
|