@codingame/monaco-vscode-katex-common 24.1.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/empty.js +1 -0
- package/package.json +45 -0
- package/vscode/src/vs/platform/actionWidget/browser/actionWidgetDropdown.d.ts +37 -0
- package/vscode/src/vs/platform/actionWidget/browser/actionWidgetDropdown.js +127 -0
- package/vscode/src/vs/platform/actions/browser/actionWidgetDropdownActionViewItem.d.ts +27 -0
- package/vscode/src/vs/platform/actions/browser/actionWidgetDropdownActionViewItem.js +81 -0
- package/vscode/src/vs/platform/actions/browser/buttonbar.d.ts +44 -0
- package/vscode/src/vs/platform/actions/browser/buttonbar.js +172 -0
- package/vscode/src/vs/platform/editor/browser/editor.d.ts +12 -0
- package/vscode/src/vs/platform/editor/browser/editor.js +51 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContinueInAction.d.ts +41 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContinueInAction.js +295 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatElicitationActions.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatElicitationActions.js +60 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatExecuteActions.d.ts +65 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatExecuteActions.js +650 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatTitleActions.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatTitleActions.js +364 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/implicitContextAttachment.d.ts +38 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/implicitContextAttachment.js +207 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatAccessibilityProvider.d.ts +17 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatAccessibilityProvider.js +216 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatAgentHover.d.ts +24 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatAgentHover.js +114 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatAttachmentModel.d.ts +34 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatAttachmentModel.js +141 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatAttachmentWidgets.d.ts +169 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatAttachmentWidgets.js +951 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentMarkdownRenderer.d.ts +19 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentMarkdownRenderer.js +109 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatAgentCommandContentPart.d.ts +12 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatAgentCommandContentPart.js +47 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatAnonymousRateLimitedPart.d.ts +13 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatAnonymousRateLimitedPart.js +49 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatAttachmentsContentPart.d.ts +27 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatAttachmentsContentPart.js +160 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatChangesSummaryPart.d.ts +40 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatChangesSummaryPart.js +286 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatCodeCitationContentPart.d.ts +13 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatCodeCitationContentPart.js +49 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatCollapsibleContentPart.d.ts +34 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatCollapsibleContentPart.js +101 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatCollections.d.ts +14 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatCollections.js +30 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatCommandContentPart.d.ts +11 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatCommandContentPart.js +37 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatConfirmationContentPart.d.ts +17 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatConfirmationContentPart.js +69 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatConfirmationWidget.d.ts +116 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatConfirmationWidget.js +417 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatContentCodePools.d.ts +20 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatContentCodePools.js +66 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatElicitationContentPart.d.ts +25 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatElicitationContentPart.js +123 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatErrorConfirmationPart.d.ts +18 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatErrorConfirmationPart.js +60 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatErrorContentPart.d.ts +16 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatErrorContentPart.js +46 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatExtensionsContentPart.d.ts +19 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatExtensionsContentPart.js +57 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatMarkdownContentPart.d.ts +94 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatMarkdownContentPart.js +567 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatMcpServersInteractionContentPart.d.ts +34 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatMcpServersInteractionContentPart.js +224 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatMultiDiffContentPart.d.ts +34 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatMultiDiffContentPart.js +259 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatProgressContentPart.d.ts +38 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatProgressContentPart.js +160 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatPullRequestContentPart.d.ts +16 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatPullRequestContentPart.js +55 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatQuotaExceededPart.d.ts +17 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatQuotaExceededPart.js +117 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatReferencesContentPart.d.ts +66 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatReferencesContentPart.js +528 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatSuggestNextWidget.d.ts +31 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatSuggestNextWidget.js +160 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatTaskContentPart.d.ts +17 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatTaskContentPart.js +49 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatTextEditContentPart.d.ts +18 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatTextEditContentPart.js +91 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatTextEditContentPart.service.d.ts +13 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatTextEditContentPart.service.js +6 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatThinkingContentPart.d.ts +54 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatThinkingContentPart.js +429 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatTodoListWidget.d.ts +40 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatTodoListWidget.js +347 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatToolInputOutputContentPart.d.ts +56 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatToolInputOutputContentPart.js +164 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatToolOutputContentSubPart.d.ts +32 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatToolOutputContentSubPart.js +224 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatTreeContentPart.d.ts +35 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatTreeContentPart.js +173 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/media/chatConfirmationWidget.css +341 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/media/chatExtensionsContent.css +27 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/media/chatMarkdownPart.css +23 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/media/chatMcpServersInteractionContent.css +14 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/media/chatPullRequestContent.css +75 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/media/chatTerminalToolProgressPart.css +221 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/media/chatThinkingContent.css +162 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/abstractToolConfirmationSubPart.d.ts +41 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/abstractToolConfirmationSubPart.js +94 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatExtensionsInstallToolSubPart.d.ts +15 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatExtensionsInstallToolSubPart.js +96 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatInputOutputMarkdownProgressPart.d.ts +18 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatInputOutputMarkdownProgressPart.js +147 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatResultListSubPart.d.ts +14 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatResultListSubPart.js +23 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatTerminalToolConfirmationSubPart.d.ts +68 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatTerminalToolConfirmationSubPart.js +353 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatTerminalToolProgressPart.d.ts +100 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatTerminalToolProgressPart.js +1085 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatToolConfirmationSubPart.d.ts +39 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatToolConfirmationSubPart.js +275 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatToolInvocationPart.d.ts +32 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatToolInvocationPart.js +119 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatToolInvocationSubPart.d.ts +19 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatToolInvocationSubPart.js +36 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatToolOutputPart.d.ts +21 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatToolOutputPart.js +130 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatToolPostExecuteConfirmationPart.d.ts +25 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatToolPostExecuteConfirmationPart.js +225 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatToolProgressPart.d.ts +24 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatToolProgressPart.js +101 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDiffBlockPart.d.ts +42 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDiffBlockPart.js +127 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDragAndDrop.d.ts +43 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDragAndDrop.js +388 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingActions.d.ts +49 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingActions.js +721 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatFollowups.d.ts +13 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatFollowups.js +52 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatInlineAnchorWidget.d.ts +39 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatInlineAnchorWidget.js +409 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatInputPart.d.ts +334 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatInputPart.js +2008 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatInputPartWidgets.d.ts +52 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatInputPartWidgets.js +93 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatListRenderer.d.ts +217 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatListRenderer.js +1573 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatMarkdownDecorationsRenderer.d.ts +43 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatMarkdownDecorationsRenderer.js +249 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatOptions.d.ts +50 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatOptions.js +84 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSelectedTools.d.ts +32 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSelectedTools.js +174 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionPickerActionItem.d.ts +31 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionPickerActionItem.js +101 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/common.d.ts +19 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/common.js +76 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/media/chatSessionAction.css +39 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatWidget.d.ts +292 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatWidget.js +2014 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/codeBlockPart.css +171 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/codeBlockPart.d.ts +173 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/codeBlockPart.js +797 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatImplicitContext.d.ts +54 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatImplicitContext.js +345 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputCompletions.d.ts +10 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputCompletions.js +1069 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputRelatedFilesContrib.d.ts +34 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputRelatedFilesContrib.js +139 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/media/chat.css +2880 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/media/chatAgentHover.css +87 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/media/chatCodeBlockPill.css +139 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/media/chatInlineAnchorWidget.css +61 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/media/chatViewWelcome.css +209 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/modelPicker/modePickerActionItem.d.ts +28 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/modelPicker/modePickerActionItem.js +135 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/modelPicker/modelPickerActionItem.d.ts +28 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/modelPicker/modelPickerActionItem.js +147 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewWelcomeController.d.ts +71 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewWelcomeController.js +279 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewsWelcome.d.ts +28 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewsWelcome.js +28 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatColors.d.ts +13 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatColors.js +38 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatWidgetHistoryService.d.ts +55 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatWidgetHistoryService.js +176 -0
- package/vscode/src/vs/workbench/contrib/chat/common/codeBlockModelCollection.d.ts +45 -0
- package/vscode/src/vs/workbench/contrib/chat/common/codeBlockModelCollection.js +207 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/computeAutomaticInstructions.d.ts +48 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/computeAutomaticInstructions.js +373 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.d.ts +171 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.js +1442 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSession.d.ts +199 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSession.js +482 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionService.d.ts +28 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionService.js +37 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.d.ts +95 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.js +497 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatStrategies.d.ts +76 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatStrategies.js +464 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatWidget.d.ts +124 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatWidget.js +562 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatZoneWidget.d.ts +42 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatZoneWidget.js +279 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/media/inlineChat.css +411 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/utils.d.ts +13 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/utils.js +66 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.d.ts +61 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.js +154 -0
- package/vscode/src/vs/workbench/contrib/markdown/browser/markedKatexSupport.d.ts +19 -0
- package/vscode/src/vs/workbench/contrib/markdown/browser/markedKatexSupport.js +201 -0
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpPromptArgumentPick.d.ts +41 -0
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpPromptArgumentPick.js +372 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/chat/notebookChatUtils.d.ts +4 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/chat/notebookChatUtils.js +58 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/cellOperations.d.ts +26 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/cellOperations.js +594 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffCellEditorOptions.d.ts +8 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffCellEditorOptions.js +55 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffComponents.d.ts +273 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffComponents.js +1746 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementOutputs.d.ts +50 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementOutputs.js +269 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementViewModel.d.ts +258 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementViewModel.js +806 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffNestedCellViewModel.d.ts +41 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffNestedCellViewModel.js +116 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/editorHeightCalculator.d.ts +17 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/editorHeightCalculator.js +62 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/eventDispatcher.d.ts +27 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/eventDispatcher.js +40 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookCellDiffDecorator.d.ts +23 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookCellDiffDecorator.js +295 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookDeletedCellDecorator.d.ts +51 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookDeletedCellDecorator.js +241 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInlineDiff.d.ts +24 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInlineDiff.js +146 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInlineDiffWidget.d.ts +28 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInlineDiffWidget.js +90 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInsertedCellDecorator.d.ts +10 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInsertedCellDecorator.js +41 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookOriginalCellModelFactory.d.ts +21 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookOriginalCellModelFactory.js +42 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookOriginalModelRefFactory.d.ts +25 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookOriginalModelRefFactory.js +77 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiff.css +469 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditor.d.ts +149 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditor.js +823 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditorBrowser.d.ts +180 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditorBrowser.js +29 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffList.d.ts +102 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffList.js +567 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffOverviewRuler.d.ts +30 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffOverviewRuler.js +189 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffViewModel.d.ts +75 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffViewModel.js +439 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookMultiDiffEditor.d.ts +57 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookMultiDiffEditor.js +263 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookMultiDiffEditorInput.d.ts +22 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookMultiDiffEditorInput.js +48 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/unchangedEditorRegions.d.ts +13 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/unchangedEditorRegions.js +39 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookMetadataTextModel.d.ts +19 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookMetadataTextModel.js +89 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookDiff.d.ts +26 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookDiff.js +92 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookDiffEditorInput.d.ts +33 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookDiffEditorInput.js +108 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/chatTerminalCommandMirror.d.ts +34 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/chatTerminalCommandMirror.js +145 -0
|
@@ -0,0 +1,721 @@
|
|
|
1
|
+
|
|
2
|
+
import { CancellationToken } from '@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation';
|
|
3
|
+
import { Codicon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/codicons';
|
|
4
|
+
import { KeyMod, KeyCode } from '@codingame/monaco-vscode-api/vscode/vs/base/common/keyCodes';
|
|
5
|
+
import { basename } from '@codingame/monaco-vscode-api/vscode/vs/base/common/resources';
|
|
6
|
+
import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
|
|
7
|
+
import { isCodeEditor } from '@codingame/monaco-vscode-api/vscode/vs/editor/browser/editorBrowser';
|
|
8
|
+
import { Position } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/core/position';
|
|
9
|
+
import { EditorContextKeys } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/editorContextKeys';
|
|
10
|
+
import { isLocation } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/languages';
|
|
11
|
+
import { ILanguageFeaturesService } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/services/languageFeatures.service';
|
|
12
|
+
import { ITextModelService } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/services/resolverService.service';
|
|
13
|
+
import { localize2, localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
14
|
+
import { Action2, registerAction2, MenuId } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/common/actions';
|
|
15
|
+
import { CommandsRegistry } from '@codingame/monaco-vscode-api/vscode/vs/platform/commands/common/commands';
|
|
16
|
+
import { ICommandService } from '@codingame/monaco-vscode-api/vscode/vs/platform/commands/common/commands.service';
|
|
17
|
+
import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
|
|
18
|
+
import { ContextKeyExpr } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey';
|
|
19
|
+
import { IDialogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/dialogs/common/dialogs.service';
|
|
20
|
+
import { EditorActivation } from '@codingame/monaco-vscode-api/vscode/vs/platform/editor/common/editor';
|
|
21
|
+
import { KeybindingWeight } from '@codingame/monaco-vscode-api/vscode/vs/platform/keybinding/common/keybindingsRegistry';
|
|
22
|
+
import { IEditorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service';
|
|
23
|
+
import { IAgentSessionsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsService.service';
|
|
24
|
+
import { isChatViewTitleActionContext } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatActions';
|
|
25
|
+
import { ChatContextKeys } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatContextKeys';
|
|
26
|
+
import { chatEditingWidgetFileStateContextKey, ModifiedFileEntryState, CHAT_EDITING_MULTI_DIFF_SOURCE_RESOLVER_SCHEME, chatEditingResourceContextKey, decidedChatEditingResourceContextKey, applyingChatEditsFailedContextKey, hasUndecidedChatEditingResourceContextKey, hasAppliedChatEditsContextKey } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatEditingService';
|
|
27
|
+
import { IChatEditingService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatEditingService.service';
|
|
28
|
+
import { IChatService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService.service';
|
|
29
|
+
import { isRequestVM, isResponseVM, isChatTreeItem } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatViewModel';
|
|
30
|
+
import { ChatAgentLocation, ChatConfiguration, ChatModeKind } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/constants';
|
|
31
|
+
import { CHAT_CATEGORY } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/actions/chatActions';
|
|
32
|
+
import { IChatWidgetService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chat.service';
|
|
33
|
+
|
|
34
|
+
class EditingSessionAction extends Action2 {
|
|
35
|
+
constructor(opts) {
|
|
36
|
+
super({
|
|
37
|
+
category: CHAT_CATEGORY,
|
|
38
|
+
...opts
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
run(accessor, ...args) {
|
|
42
|
+
const context = getEditingSessionContext(accessor, args);
|
|
43
|
+
if (!context || !context.editingSession) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
return this.runEditingSessionAction(accessor, context.editingSession, context.chatWidget, ...args);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
function getEditingSessionContext(accessor, args) {
|
|
50
|
+
const arg0 = args.at(0);
|
|
51
|
+
const context = isChatViewTitleActionContext(arg0) ? arg0 : undefined;
|
|
52
|
+
const chatWidgetService = accessor.get(IChatWidgetService);
|
|
53
|
+
const chatEditingService = accessor.get(IChatEditingService);
|
|
54
|
+
let chatWidget = context ? chatWidgetService.getWidgetBySessionResource(context.sessionResource) : undefined;
|
|
55
|
+
if (!chatWidget) {
|
|
56
|
+
chatWidget = chatWidgetService.lastFocusedWidget ?? chatWidgetService.getWidgetsByLocations(ChatAgentLocation.Chat).find(w => w.supportsChangingModes);
|
|
57
|
+
}
|
|
58
|
+
if (!chatWidget?.viewModel) {
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
const editingSession = chatEditingService.getEditingSession(chatWidget.viewModel.model.sessionResource);
|
|
62
|
+
return { editingSession, chatWidget };
|
|
63
|
+
}
|
|
64
|
+
class WorkingSetAction extends EditingSessionAction {
|
|
65
|
+
runEditingSessionAction(accessor, editingSession, chatWidget, ...args) {
|
|
66
|
+
const uris = [];
|
|
67
|
+
if (URI.isUri(args[0])) {
|
|
68
|
+
uris.push(args[0]);
|
|
69
|
+
}
|
|
70
|
+
else if (chatWidget) {
|
|
71
|
+
uris.push(...chatWidget.input.selectedElements);
|
|
72
|
+
}
|
|
73
|
+
if (!uris.length) {
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
return this.runWorkingSetAction(accessor, editingSession, chatWidget, ...uris);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
registerAction2(class OpenFileInDiffAction extends WorkingSetAction {
|
|
80
|
+
constructor() {
|
|
81
|
+
super({
|
|
82
|
+
id: 'chatEditing.openFileInDiff',
|
|
83
|
+
title: ( localize2(5186, 'Open Changes in Diff Editor')),
|
|
84
|
+
icon: Codicon.diffSingle,
|
|
85
|
+
menu: [{
|
|
86
|
+
id: MenuId.ChatEditingWidgetModifiedFilesToolbar,
|
|
87
|
+
when: ( ContextKeyExpr.equals(chatEditingWidgetFileStateContextKey.key, ModifiedFileEntryState.Modified)),
|
|
88
|
+
order: 2,
|
|
89
|
+
group: 'navigation'
|
|
90
|
+
}],
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
async runWorkingSetAction(accessor, currentEditingSession, _chatWidget, ...uris) {
|
|
94
|
+
const editorService = accessor.get(IEditorService);
|
|
95
|
+
for (const uri of uris) {
|
|
96
|
+
let pane = editorService.activeEditorPane;
|
|
97
|
+
if (!pane) {
|
|
98
|
+
pane = await editorService.openEditor({ resource: uri });
|
|
99
|
+
}
|
|
100
|
+
if (!pane) {
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
const editedFile = currentEditingSession.getEntry(uri);
|
|
104
|
+
editedFile?.getEditorIntegration(pane).toggleDiff(undefined, true);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
registerAction2(class AcceptAction extends WorkingSetAction {
|
|
109
|
+
constructor() {
|
|
110
|
+
super({
|
|
111
|
+
id: 'chatEditing.acceptFile',
|
|
112
|
+
title: ( localize2(5187, 'Keep')),
|
|
113
|
+
icon: Codicon.check,
|
|
114
|
+
menu: [{
|
|
115
|
+
when: ( ContextKeyExpr.and(( ContextKeyExpr.equals('resourceScheme', CHAT_EDITING_MULTI_DIFF_SOURCE_RESOLVER_SCHEME)), ContextKeyExpr.notIn(chatEditingResourceContextKey.key, decidedChatEditingResourceContextKey.key))),
|
|
116
|
+
id: MenuId.MultiDiffEditorFileToolbar,
|
|
117
|
+
order: 0,
|
|
118
|
+
group: 'navigation',
|
|
119
|
+
}, {
|
|
120
|
+
id: MenuId.ChatEditingWidgetModifiedFilesToolbar,
|
|
121
|
+
when: ( ContextKeyExpr.equals(chatEditingWidgetFileStateContextKey.key, ModifiedFileEntryState.Modified)),
|
|
122
|
+
order: 0,
|
|
123
|
+
group: 'navigation'
|
|
124
|
+
}],
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
async runWorkingSetAction(accessor, currentEditingSession, chatWidget, ...uris) {
|
|
128
|
+
await currentEditingSession.accept(...uris);
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
registerAction2(class DiscardAction extends WorkingSetAction {
|
|
132
|
+
constructor() {
|
|
133
|
+
super({
|
|
134
|
+
id: 'chatEditing.discardFile',
|
|
135
|
+
title: ( localize2(5188, 'Undo')),
|
|
136
|
+
icon: Codicon.discard,
|
|
137
|
+
menu: [{
|
|
138
|
+
when: ( ContextKeyExpr.and(( ContextKeyExpr.equals('resourceScheme', CHAT_EDITING_MULTI_DIFF_SOURCE_RESOLVER_SCHEME)), ContextKeyExpr.notIn(chatEditingResourceContextKey.key, decidedChatEditingResourceContextKey.key))),
|
|
139
|
+
id: MenuId.MultiDiffEditorFileToolbar,
|
|
140
|
+
order: 2,
|
|
141
|
+
group: 'navigation',
|
|
142
|
+
}, {
|
|
143
|
+
id: MenuId.ChatEditingWidgetModifiedFilesToolbar,
|
|
144
|
+
when: ( ContextKeyExpr.equals(chatEditingWidgetFileStateContextKey.key, ModifiedFileEntryState.Modified)),
|
|
145
|
+
order: 1,
|
|
146
|
+
group: 'navigation'
|
|
147
|
+
}],
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
async runWorkingSetAction(accessor, currentEditingSession, chatWidget, ...uris) {
|
|
151
|
+
await currentEditingSession.reject(...uris);
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
class ChatEditingAcceptAllAction extends EditingSessionAction {
|
|
155
|
+
constructor() {
|
|
156
|
+
super({
|
|
157
|
+
id: 'chatEditing.acceptAllFiles',
|
|
158
|
+
title: ( localize(5189, 'Keep')),
|
|
159
|
+
icon: Codicon.check,
|
|
160
|
+
tooltip: ( localize(5190, 'Keep All Edits')),
|
|
161
|
+
precondition: hasUndecidedChatEditingResourceContextKey,
|
|
162
|
+
keybinding: {
|
|
163
|
+
primary: KeyMod.CtrlCmd | KeyCode.Enter,
|
|
164
|
+
when: ( ContextKeyExpr.and(hasUndecidedChatEditingResourceContextKey, ChatContextKeys.inChatInput)),
|
|
165
|
+
weight: KeybindingWeight.WorkbenchContrib,
|
|
166
|
+
},
|
|
167
|
+
menu: [
|
|
168
|
+
{
|
|
169
|
+
id: MenuId.ChatEditingWidgetToolbar,
|
|
170
|
+
group: 'navigation',
|
|
171
|
+
order: 0,
|
|
172
|
+
when: ( ContextKeyExpr.and(( applyingChatEditsFailedContextKey.negate()), ( ContextKeyExpr.and(hasUndecidedChatEditingResourceContextKey))))
|
|
173
|
+
}
|
|
174
|
+
]
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
async runEditingSessionAction(accessor, editingSession, chatWidget, ...args) {
|
|
178
|
+
await editingSession.accept();
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
registerAction2(ChatEditingAcceptAllAction);
|
|
182
|
+
class ChatEditingDiscardAllAction extends EditingSessionAction {
|
|
183
|
+
constructor() {
|
|
184
|
+
super({
|
|
185
|
+
id: 'chatEditing.discardAllFiles',
|
|
186
|
+
title: ( localize(5191, 'Undo')),
|
|
187
|
+
icon: Codicon.discard,
|
|
188
|
+
tooltip: ( localize(5192, 'Undo All Edits')),
|
|
189
|
+
precondition: hasUndecidedChatEditingResourceContextKey,
|
|
190
|
+
menu: [
|
|
191
|
+
{
|
|
192
|
+
id: MenuId.ChatEditingWidgetToolbar,
|
|
193
|
+
group: 'navigation',
|
|
194
|
+
order: 1,
|
|
195
|
+
when: ( ContextKeyExpr.and(( applyingChatEditsFailedContextKey.negate()), hasUndecidedChatEditingResourceContextKey))
|
|
196
|
+
}
|
|
197
|
+
],
|
|
198
|
+
keybinding: {
|
|
199
|
+
when: ( ContextKeyExpr.and(
|
|
200
|
+
hasUndecidedChatEditingResourceContextKey,
|
|
201
|
+
ChatContextKeys.inChatInput,
|
|
202
|
+
( ChatContextKeys.inputHasText.negate())
|
|
203
|
+
)),
|
|
204
|
+
weight: KeybindingWeight.WorkbenchContrib,
|
|
205
|
+
primary: KeyMod.CtrlCmd | KeyCode.Backspace,
|
|
206
|
+
},
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
async runEditingSessionAction(accessor, editingSession, chatWidget, ...args) {
|
|
210
|
+
await discardAllEditsWithConfirmation(accessor, editingSession);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
registerAction2(ChatEditingDiscardAllAction);
|
|
214
|
+
async function discardAllEditsWithConfirmation(accessor, currentEditingSession) {
|
|
215
|
+
const dialogService = accessor.get(IDialogService);
|
|
216
|
+
const entries = currentEditingSession.entries.get();
|
|
217
|
+
if (entries.length > 0) {
|
|
218
|
+
const confirmation = await dialogService.confirm({
|
|
219
|
+
title: ( localize(5193, "Undo all edits?")),
|
|
220
|
+
message: entries.length === 1
|
|
221
|
+
? ( localize(
|
|
222
|
+
5194,
|
|
223
|
+
"This will undo changes made in {0}. Do you want to proceed?",
|
|
224
|
+
basename(entries[0].modifiedURI)
|
|
225
|
+
))
|
|
226
|
+
: ( localize(
|
|
227
|
+
5195,
|
|
228
|
+
"This will undo changes made in {0} files. Do you want to proceed?",
|
|
229
|
+
entries.length
|
|
230
|
+
)),
|
|
231
|
+
primaryButton: ( localize(5196, "Yes")),
|
|
232
|
+
type: 'info'
|
|
233
|
+
});
|
|
234
|
+
if (!confirmation.confirmed) {
|
|
235
|
+
return false;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
await currentEditingSession.reject();
|
|
239
|
+
return true;
|
|
240
|
+
}
|
|
241
|
+
class ChatEditingShowChangesAction extends EditingSessionAction {
|
|
242
|
+
static { this.ID = 'chatEditing.viewChanges'; }
|
|
243
|
+
static { this.LABEL = ( localize(5197, 'View All Edits')); }
|
|
244
|
+
constructor() {
|
|
245
|
+
super({
|
|
246
|
+
id: ChatEditingShowChangesAction.ID,
|
|
247
|
+
title: { value: ChatEditingShowChangesAction.LABEL, original: ChatEditingShowChangesAction.LABEL },
|
|
248
|
+
tooltip: ChatEditingShowChangesAction.LABEL,
|
|
249
|
+
f1: true,
|
|
250
|
+
icon: Codicon.diffMultiple,
|
|
251
|
+
precondition: hasUndecidedChatEditingResourceContextKey,
|
|
252
|
+
menu: [
|
|
253
|
+
{
|
|
254
|
+
id: MenuId.ChatEditingWidgetToolbar,
|
|
255
|
+
group: 'navigation',
|
|
256
|
+
order: 4,
|
|
257
|
+
when: ( ContextKeyExpr.and(( applyingChatEditsFailedContextKey.negate()), ( ContextKeyExpr.and(hasAppliedChatEditsContextKey, hasUndecidedChatEditingResourceContextKey))))
|
|
258
|
+
}
|
|
259
|
+
],
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
async runEditingSessionAction(accessor, editingSession, chatWidget, ...args) {
|
|
263
|
+
await editingSession.show();
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
registerAction2(ChatEditingShowChangesAction);
|
|
267
|
+
class ViewAllSessionChangesAction extends Action2 {
|
|
268
|
+
static { this.ID = 'chatEditing.viewAllSessionChanges'; }
|
|
269
|
+
constructor() {
|
|
270
|
+
super({
|
|
271
|
+
id: ViewAllSessionChangesAction.ID,
|
|
272
|
+
title: ( localize2(5198, 'View All Changes')),
|
|
273
|
+
icon: Codicon.diffMultiple,
|
|
274
|
+
category: CHAT_CATEGORY,
|
|
275
|
+
precondition: ChatContextKeys.hasAgentSessionChanges,
|
|
276
|
+
menu: [
|
|
277
|
+
{
|
|
278
|
+
id: MenuId.ChatEditingSessionChangesToolbar,
|
|
279
|
+
group: 'navigation',
|
|
280
|
+
order: 10,
|
|
281
|
+
when: ChatContextKeys.hasAgentSessionChanges
|
|
282
|
+
}
|
|
283
|
+
],
|
|
284
|
+
});
|
|
285
|
+
}
|
|
286
|
+
async run(accessor, sessionResource) {
|
|
287
|
+
const agentSessionsService = accessor.get(IAgentSessionsService);
|
|
288
|
+
const commandService = accessor.get(ICommandService);
|
|
289
|
+
if (!URI.isUri(sessionResource)) {
|
|
290
|
+
return;
|
|
291
|
+
}
|
|
292
|
+
const session = agentSessionsService.getSession(sessionResource);
|
|
293
|
+
const changes = session?.changes;
|
|
294
|
+
if (!(changes instanceof Array)) {
|
|
295
|
+
return;
|
|
296
|
+
}
|
|
297
|
+
const resources = ( changes
|
|
298
|
+
.filter(d => d.originalUri)
|
|
299
|
+
.map(d => ({ originalUri: d.originalUri, modifiedUri: d.modifiedUri })));
|
|
300
|
+
if (resources.length > 0) {
|
|
301
|
+
await commandService.executeCommand('_workbench.openMultiDiffEditor', {
|
|
302
|
+
multiDiffSourceUri: sessionResource.with({ scheme: sessionResource.scheme + '-worktree-changes' }),
|
|
303
|
+
title: ( localize(5199, 'All Session Changes')),
|
|
304
|
+
resources,
|
|
305
|
+
});
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
registerAction2(ViewAllSessionChangesAction);
|
|
310
|
+
async function restoreSnapshotWithConfirmation(accessor, item) {
|
|
311
|
+
const configurationService = accessor.get(IConfigurationService);
|
|
312
|
+
const dialogService = accessor.get(IDialogService);
|
|
313
|
+
const chatWidgetService = accessor.get(IChatWidgetService);
|
|
314
|
+
const widget = chatWidgetService.getWidgetBySessionResource(item.sessionResource);
|
|
315
|
+
const chatService = accessor.get(IChatService);
|
|
316
|
+
const chatModel = chatService.getSession(item.sessionResource);
|
|
317
|
+
if (!chatModel) {
|
|
318
|
+
return;
|
|
319
|
+
}
|
|
320
|
+
const session = chatModel.editingSession;
|
|
321
|
+
if (!session) {
|
|
322
|
+
return;
|
|
323
|
+
}
|
|
324
|
+
const requestId = isRequestVM(item) ? item.id :
|
|
325
|
+
isResponseVM(item) ? item.requestId : undefined;
|
|
326
|
+
if (requestId) {
|
|
327
|
+
const chatRequests = chatModel.getRequests();
|
|
328
|
+
const itemIndex = chatRequests.findIndex(request => request.id === requestId);
|
|
329
|
+
const editsToUndo = chatRequests.length - itemIndex;
|
|
330
|
+
const requestsToRemove = chatRequests.slice(itemIndex);
|
|
331
|
+
const requestIdsToRemove = ( new Set(( requestsToRemove.map(request => request.id))));
|
|
332
|
+
const entriesModifiedInRequestsToRemove = session.entries.get().filter((entry) => ( requestIdsToRemove.has(entry.lastModifyingRequestId))) ?? [];
|
|
333
|
+
const shouldPrompt = entriesModifiedInRequestsToRemove.length > 0 && configurationService.getValue('chat.editing.confirmEditRequestRemoval') === true;
|
|
334
|
+
let message;
|
|
335
|
+
if (editsToUndo === 1) {
|
|
336
|
+
if (entriesModifiedInRequestsToRemove.length === 1) {
|
|
337
|
+
message = ( localize(
|
|
338
|
+
5200,
|
|
339
|
+
"This will remove your last request and undo the edits made to {0}. Do you want to proceed?",
|
|
340
|
+
basename(entriesModifiedInRequestsToRemove[0].modifiedURI)
|
|
341
|
+
));
|
|
342
|
+
}
|
|
343
|
+
else {
|
|
344
|
+
message = ( localize(
|
|
345
|
+
5201,
|
|
346
|
+
"This will remove your last request and undo edits made to {0} files in your working set. Do you want to proceed?",
|
|
347
|
+
entriesModifiedInRequestsToRemove.length
|
|
348
|
+
));
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
else {
|
|
352
|
+
if (entriesModifiedInRequestsToRemove.length === 1) {
|
|
353
|
+
message = ( localize(
|
|
354
|
+
5202,
|
|
355
|
+
"This will remove all subsequent requests and undo edits made to {0}. Do you want to proceed?",
|
|
356
|
+
basename(entriesModifiedInRequestsToRemove[0].modifiedURI)
|
|
357
|
+
));
|
|
358
|
+
}
|
|
359
|
+
else {
|
|
360
|
+
message = ( localize(
|
|
361
|
+
5203,
|
|
362
|
+
"This will remove all subsequent requests and undo edits made to {0} files in your working set. Do you want to proceed?",
|
|
363
|
+
entriesModifiedInRequestsToRemove.length
|
|
364
|
+
));
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
const confirmation = shouldPrompt
|
|
368
|
+
? await dialogService.confirm({
|
|
369
|
+
title: editsToUndo === 1
|
|
370
|
+
? ( localize(5204, "Do you want to undo your last edit?"))
|
|
371
|
+
: ( localize(5205, "Do you want to undo {0} edits?", editsToUndo)),
|
|
372
|
+
message: message,
|
|
373
|
+
primaryButton: ( localize(5206, "Yes")),
|
|
374
|
+
checkbox: { label: ( localize(5207, "Don't ask again")), checked: false },
|
|
375
|
+
type: 'info'
|
|
376
|
+
})
|
|
377
|
+
: { confirmed: true };
|
|
378
|
+
if (!confirmation.confirmed) {
|
|
379
|
+
widget?.viewModel?.model.setCheckpoint(undefined);
|
|
380
|
+
return;
|
|
381
|
+
}
|
|
382
|
+
if (confirmation.checkboxChecked) {
|
|
383
|
+
await configurationService.updateValue('chat.editing.confirmEditRequestRemoval', false);
|
|
384
|
+
}
|
|
385
|
+
const snapshotRequestId = chatRequests[itemIndex].id;
|
|
386
|
+
await session.restoreSnapshot(snapshotRequestId, undefined);
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
registerAction2(class RemoveAction extends Action2 {
|
|
390
|
+
constructor() {
|
|
391
|
+
super({
|
|
392
|
+
id: 'workbench.action.chat.undoEdits',
|
|
393
|
+
title: ( localize2(5208, "Undo Requests")),
|
|
394
|
+
f1: false,
|
|
395
|
+
category: CHAT_CATEGORY,
|
|
396
|
+
icon: Codicon.discard,
|
|
397
|
+
keybinding: {
|
|
398
|
+
primary: KeyCode.Delete,
|
|
399
|
+
mac: {
|
|
400
|
+
primary: KeyMod.CtrlCmd | KeyCode.Backspace,
|
|
401
|
+
},
|
|
402
|
+
when: ( ContextKeyExpr.and(ChatContextKeys.inChatSession, ( EditorContextKeys.textInputFocus.negate()))),
|
|
403
|
+
weight: KeybindingWeight.WorkbenchContrib,
|
|
404
|
+
},
|
|
405
|
+
menu: [
|
|
406
|
+
{
|
|
407
|
+
id: MenuId.ChatMessageTitle,
|
|
408
|
+
group: 'navigation',
|
|
409
|
+
order: 2,
|
|
410
|
+
when: ( ContextKeyExpr.and(( ( ContextKeyExpr.equals(`config.${ChatConfiguration.EditRequests}`, 'input')).negate()), ( ContextKeyExpr.equals(`config.${ChatConfiguration.CheckpointsEnabled}`, false)), ( ChatContextKeys.lockedToCodingAgent.negate()))),
|
|
411
|
+
}
|
|
412
|
+
]
|
|
413
|
+
});
|
|
414
|
+
}
|
|
415
|
+
async run(accessor, ...args) {
|
|
416
|
+
let item = args[0];
|
|
417
|
+
const chatWidgetService = accessor.get(IChatWidgetService);
|
|
418
|
+
const configurationService = accessor.get(IConfigurationService);
|
|
419
|
+
const widget = (isChatTreeItem(item) && chatWidgetService.getWidgetBySessionResource(item.sessionResource)) || chatWidgetService.lastFocusedWidget;
|
|
420
|
+
if (!isResponseVM(item) && !isRequestVM(item)) {
|
|
421
|
+
item = widget?.getFocus();
|
|
422
|
+
}
|
|
423
|
+
if (!item) {
|
|
424
|
+
return;
|
|
425
|
+
}
|
|
426
|
+
await restoreSnapshotWithConfirmation(accessor, item);
|
|
427
|
+
if (isRequestVM(item) && configurationService.getValue('chat.undoRequests.restoreInput')) {
|
|
428
|
+
widget?.focusInput();
|
|
429
|
+
widget?.input.setValue(item.messageText, false);
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
});
|
|
433
|
+
registerAction2(class RestoreCheckpointAction extends Action2 {
|
|
434
|
+
constructor() {
|
|
435
|
+
super({
|
|
436
|
+
id: 'workbench.action.chat.restoreCheckpoint',
|
|
437
|
+
title: ( localize2(5209, "Restore Checkpoint")),
|
|
438
|
+
tooltip: ( localize2(5210, "Restores workspace and chat to this point")),
|
|
439
|
+
f1: false,
|
|
440
|
+
category: CHAT_CATEGORY,
|
|
441
|
+
keybinding: {
|
|
442
|
+
primary: KeyCode.Delete,
|
|
443
|
+
mac: {
|
|
444
|
+
primary: KeyMod.CtrlCmd | KeyCode.Backspace,
|
|
445
|
+
},
|
|
446
|
+
when: ( ContextKeyExpr.and(ChatContextKeys.inChatSession, ( EditorContextKeys.textInputFocus.negate()))),
|
|
447
|
+
weight: KeybindingWeight.WorkbenchContrib,
|
|
448
|
+
},
|
|
449
|
+
menu: [
|
|
450
|
+
{
|
|
451
|
+
id: MenuId.ChatMessageCheckpoint,
|
|
452
|
+
group: 'navigation',
|
|
453
|
+
order: 2,
|
|
454
|
+
when: ( ContextKeyExpr.and(ChatContextKeys.isRequest, ( ChatContextKeys.lockedToCodingAgent.negate())))
|
|
455
|
+
}
|
|
456
|
+
]
|
|
457
|
+
});
|
|
458
|
+
}
|
|
459
|
+
async run(accessor, ...args) {
|
|
460
|
+
let item = args[0];
|
|
461
|
+
const chatWidgetService = accessor.get(IChatWidgetService);
|
|
462
|
+
const widget = (isChatTreeItem(item) && chatWidgetService.getWidgetBySessionResource(item.sessionResource)) || chatWidgetService.lastFocusedWidget;
|
|
463
|
+
if (!isResponseVM(item) && !isRequestVM(item)) {
|
|
464
|
+
item = widget?.getFocus();
|
|
465
|
+
}
|
|
466
|
+
if (!item) {
|
|
467
|
+
return;
|
|
468
|
+
}
|
|
469
|
+
if (isRequestVM(item)) {
|
|
470
|
+
widget?.focusInput();
|
|
471
|
+
widget?.input.setValue(item.messageText, false);
|
|
472
|
+
}
|
|
473
|
+
widget?.viewModel?.model.setCheckpoint(item.id);
|
|
474
|
+
await restoreSnapshotWithConfirmation(accessor, item);
|
|
475
|
+
}
|
|
476
|
+
});
|
|
477
|
+
registerAction2(class RestoreLastCheckpoint extends Action2 {
|
|
478
|
+
constructor() {
|
|
479
|
+
super({
|
|
480
|
+
id: 'workbench.action.chat.restoreLastCheckpoint',
|
|
481
|
+
title: ( localize2(5211, "Restore to Last Checkpoint")),
|
|
482
|
+
f1: false,
|
|
483
|
+
category: CHAT_CATEGORY,
|
|
484
|
+
icon: Codicon.discard,
|
|
485
|
+
menu: [
|
|
486
|
+
{
|
|
487
|
+
id: MenuId.ChatMessageFooter,
|
|
488
|
+
group: 'navigation',
|
|
489
|
+
order: 1,
|
|
490
|
+
when: ( ContextKeyExpr.and(
|
|
491
|
+
ContextKeyExpr.in(ChatContextKeys.itemId.key, ChatContextKeys.lastItemId.key),
|
|
492
|
+
( ContextKeyExpr.equals(`config.${ChatConfiguration.CheckpointsEnabled}`, true)),
|
|
493
|
+
( ChatContextKeys.lockedToCodingAgent.negate())
|
|
494
|
+
)),
|
|
495
|
+
}
|
|
496
|
+
]
|
|
497
|
+
});
|
|
498
|
+
}
|
|
499
|
+
async run(accessor, ...args) {
|
|
500
|
+
let item = args[0];
|
|
501
|
+
const chatWidgetService = accessor.get(IChatWidgetService);
|
|
502
|
+
const chatService = accessor.get(IChatService);
|
|
503
|
+
const widget = (isChatTreeItem(item) && chatWidgetService.getWidgetBySessionResource(item.sessionResource)) || chatWidgetService.lastFocusedWidget;
|
|
504
|
+
if (!isResponseVM(item) && !isRequestVM(item)) {
|
|
505
|
+
item = widget?.getFocus();
|
|
506
|
+
}
|
|
507
|
+
if (!item) {
|
|
508
|
+
return;
|
|
509
|
+
}
|
|
510
|
+
const chatModel = chatService.getSession(item.sessionResource);
|
|
511
|
+
if (!chatModel) {
|
|
512
|
+
return;
|
|
513
|
+
}
|
|
514
|
+
const session = chatModel.editingSession;
|
|
515
|
+
if (!session) {
|
|
516
|
+
return;
|
|
517
|
+
}
|
|
518
|
+
await restoreSnapshotWithConfirmation(accessor, item);
|
|
519
|
+
if (isResponseVM(item)) {
|
|
520
|
+
widget?.viewModel?.model.setCheckpoint(item.requestId);
|
|
521
|
+
const request = chatModel.getRequests().find(request => request.id === item.requestId);
|
|
522
|
+
if (request) {
|
|
523
|
+
widget?.focusInput();
|
|
524
|
+
widget?.input.setValue(request.message.text, false);
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
});
|
|
529
|
+
registerAction2(class EditAction extends Action2 {
|
|
530
|
+
constructor() {
|
|
531
|
+
super({
|
|
532
|
+
id: 'workbench.action.chat.editRequests',
|
|
533
|
+
title: ( localize2(5212, "Edit Request")),
|
|
534
|
+
f1: false,
|
|
535
|
+
category: CHAT_CATEGORY,
|
|
536
|
+
icon: Codicon.edit,
|
|
537
|
+
keybinding: {
|
|
538
|
+
primary: KeyCode.Enter,
|
|
539
|
+
when: ( ContextKeyExpr.and(ChatContextKeys.inChatSession, ( EditorContextKeys.textInputFocus.negate()))),
|
|
540
|
+
weight: KeybindingWeight.WorkbenchContrib,
|
|
541
|
+
},
|
|
542
|
+
menu: [
|
|
543
|
+
{
|
|
544
|
+
id: MenuId.ChatMessageTitle,
|
|
545
|
+
group: 'navigation',
|
|
546
|
+
order: 2,
|
|
547
|
+
when: ( ContextKeyExpr.and(( ContextKeyExpr.or(( ContextKeyExpr.equals(`config.${ChatConfiguration.EditRequests}`, 'hover')), ( ContextKeyExpr.equals(`config.${ChatConfiguration.EditRequests}`, 'input'))))))
|
|
548
|
+
}
|
|
549
|
+
]
|
|
550
|
+
});
|
|
551
|
+
}
|
|
552
|
+
async run(accessor, ...args) {
|
|
553
|
+
let item = args[0];
|
|
554
|
+
const chatWidgetService = accessor.get(IChatWidgetService);
|
|
555
|
+
const widget = (isChatTreeItem(item) && chatWidgetService.getWidgetBySessionResource(item.sessionResource)) || chatWidgetService.lastFocusedWidget;
|
|
556
|
+
if (!isResponseVM(item) && !isRequestVM(item)) {
|
|
557
|
+
item = widget?.getFocus();
|
|
558
|
+
}
|
|
559
|
+
if (!item) {
|
|
560
|
+
return;
|
|
561
|
+
}
|
|
562
|
+
if (isRequestVM(item)) {
|
|
563
|
+
widget?.startEditing(item.id);
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
});
|
|
567
|
+
registerAction2(class OpenWorkingSetHistoryAction extends Action2 {
|
|
568
|
+
static { this.id = 'chat.openFileUpdatedBySnapshot'; }
|
|
569
|
+
constructor() {
|
|
570
|
+
super({
|
|
571
|
+
id: OpenWorkingSetHistoryAction.id,
|
|
572
|
+
title: ( localize(5213, "Open File")),
|
|
573
|
+
menu: [{
|
|
574
|
+
id: MenuId.ChatEditingCodeBlockContext,
|
|
575
|
+
group: 'navigation',
|
|
576
|
+
order: 0,
|
|
577
|
+
},]
|
|
578
|
+
});
|
|
579
|
+
}
|
|
580
|
+
async run(accessor, ...args) {
|
|
581
|
+
const context = args[0];
|
|
582
|
+
if (!context?.sessionResource) {
|
|
583
|
+
return;
|
|
584
|
+
}
|
|
585
|
+
const editorService = accessor.get(IEditorService);
|
|
586
|
+
await editorService.openEditor({ resource: context.uri });
|
|
587
|
+
}
|
|
588
|
+
});
|
|
589
|
+
registerAction2(class OpenWorkingSetHistoryAction extends Action2 {
|
|
590
|
+
static { this.id = 'chat.openFileSnapshot'; }
|
|
591
|
+
constructor() {
|
|
592
|
+
super({
|
|
593
|
+
id: OpenWorkingSetHistoryAction.id,
|
|
594
|
+
title: ( localize(5214, "Open File Snapshot")),
|
|
595
|
+
menu: [{
|
|
596
|
+
id: MenuId.ChatEditingCodeBlockContext,
|
|
597
|
+
group: 'navigation',
|
|
598
|
+
order: 1,
|
|
599
|
+
},]
|
|
600
|
+
});
|
|
601
|
+
}
|
|
602
|
+
async run(accessor, ...args) {
|
|
603
|
+
const context = args[0];
|
|
604
|
+
if (!context?.sessionResource) {
|
|
605
|
+
return;
|
|
606
|
+
}
|
|
607
|
+
const chatService = accessor.get(IChatService);
|
|
608
|
+
const chatEditingService = accessor.get(IChatEditingService);
|
|
609
|
+
const editorService = accessor.get(IEditorService);
|
|
610
|
+
const chatModel = chatService.getSession(context.sessionResource);
|
|
611
|
+
if (!chatModel) {
|
|
612
|
+
return;
|
|
613
|
+
}
|
|
614
|
+
const snapshot = chatEditingService.getEditingSession(chatModel.sessionResource)?.getSnapshotUri(context.requestId, context.uri, context.stopId);
|
|
615
|
+
if (snapshot) {
|
|
616
|
+
const editor = await editorService.openEditor({ resource: snapshot, label: ( localize(5215, '{0} (Snapshot)', basename(context.uri))), options: { activation: EditorActivation.ACTIVATE } });
|
|
617
|
+
if (isCodeEditor(editor)) {
|
|
618
|
+
editor.updateOptions({ readOnly: true });
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
});
|
|
623
|
+
registerAction2(class ResolveSymbolsContextAction extends EditingSessionAction {
|
|
624
|
+
constructor() {
|
|
625
|
+
super({
|
|
626
|
+
id: 'workbench.action.edits.addFilesFromReferences',
|
|
627
|
+
title: ( localize2(5216, "Add Files From References")),
|
|
628
|
+
f1: false,
|
|
629
|
+
category: CHAT_CATEGORY,
|
|
630
|
+
menu: {
|
|
631
|
+
id: MenuId.ChatInputSymbolAttachmentContext,
|
|
632
|
+
group: 'navigation',
|
|
633
|
+
order: 1,
|
|
634
|
+
when: ( ContextKeyExpr.and(( ChatContextKeys.chatModeKind.isEqualTo(ChatModeKind.Ask)), EditorContextKeys.hasReferenceProvider))
|
|
635
|
+
}
|
|
636
|
+
});
|
|
637
|
+
}
|
|
638
|
+
async runEditingSessionAction(accessor, editingSession, chatWidget, ...args) {
|
|
639
|
+
if (args.length === 0 || !isLocation(args[0])) {
|
|
640
|
+
return;
|
|
641
|
+
}
|
|
642
|
+
const textModelService = accessor.get(ITextModelService);
|
|
643
|
+
const languageFeaturesService = accessor.get(ILanguageFeaturesService);
|
|
644
|
+
const symbol = args[0];
|
|
645
|
+
const modelReference = await textModelService.createModelReference(symbol.uri);
|
|
646
|
+
const textModel = modelReference.object.textEditorModel;
|
|
647
|
+
if (!textModel) {
|
|
648
|
+
return;
|
|
649
|
+
}
|
|
650
|
+
const position = ( new Position(symbol.range.startLineNumber, symbol.range.startColumn));
|
|
651
|
+
const [references, definitions, implementations] = await Promise.all([
|
|
652
|
+
this.getReferences(position, textModel, languageFeaturesService),
|
|
653
|
+
this.getDefinitions(position, textModel, languageFeaturesService),
|
|
654
|
+
this.getImplementations(position, textModel, languageFeaturesService)
|
|
655
|
+
]);
|
|
656
|
+
const attachments = [];
|
|
657
|
+
for (const reference of [...definitions, ...implementations, ...references]) {
|
|
658
|
+
attachments.push(chatWidget.attachmentModel.asFileVariableEntry(reference.uri));
|
|
659
|
+
}
|
|
660
|
+
chatWidget.attachmentModel.addContext(...attachments);
|
|
661
|
+
}
|
|
662
|
+
async getReferences(position, textModel, languageFeaturesService) {
|
|
663
|
+
const referenceProviders = languageFeaturesService.referenceProvider.all(textModel);
|
|
664
|
+
const references = await Promise.all(( referenceProviders.map(async (referenceProvider) => {
|
|
665
|
+
return (await referenceProvider.provideReferences(textModel, position, { includeDeclaration: true }, CancellationToken.None)) ?? [];
|
|
666
|
+
})));
|
|
667
|
+
return references.flat();
|
|
668
|
+
}
|
|
669
|
+
async getDefinitions(position, textModel, languageFeaturesService) {
|
|
670
|
+
const definitionProviders = languageFeaturesService.definitionProvider.all(textModel);
|
|
671
|
+
const definitions = await Promise.all(( definitionProviders.map(async (definitionProvider) => {
|
|
672
|
+
return (await definitionProvider.provideDefinition(textModel, position, CancellationToken.None)) ?? [];
|
|
673
|
+
})));
|
|
674
|
+
return definitions.flat();
|
|
675
|
+
}
|
|
676
|
+
async getImplementations(position, textModel, languageFeaturesService) {
|
|
677
|
+
const implementationProviders = languageFeaturesService.implementationProvider.all(textModel);
|
|
678
|
+
const implementations = await Promise.all(( implementationProviders.map(async (implementationProvider) => {
|
|
679
|
+
return (await implementationProvider.provideImplementation(textModel, position, CancellationToken.None)) ?? [];
|
|
680
|
+
})));
|
|
681
|
+
return implementations.flat();
|
|
682
|
+
}
|
|
683
|
+
});
|
|
684
|
+
class ViewPreviousEditsAction extends EditingSessionAction {
|
|
685
|
+
static { this.Id = 'chatEditing.viewPreviousEdits'; }
|
|
686
|
+
static { this.Label = ( localize(5217, 'View Previous Edits')); }
|
|
687
|
+
constructor() {
|
|
688
|
+
super({
|
|
689
|
+
id: ViewPreviousEditsAction.Id,
|
|
690
|
+
title: { value: ViewPreviousEditsAction.Label, original: ViewPreviousEditsAction.Label },
|
|
691
|
+
tooltip: ViewPreviousEditsAction.Label,
|
|
692
|
+
f1: true,
|
|
693
|
+
icon: Codicon.diffMultiple,
|
|
694
|
+
precondition: ( ContextKeyExpr.and(ChatContextKeys.enabled, ( hasUndecidedChatEditingResourceContextKey.negate()))),
|
|
695
|
+
menu: [
|
|
696
|
+
{
|
|
697
|
+
id: MenuId.ChatEditingWidgetToolbar,
|
|
698
|
+
group: 'navigation',
|
|
699
|
+
order: 4,
|
|
700
|
+
when: ( ContextKeyExpr.and(( applyingChatEditsFailedContextKey.negate()), ( ContextKeyExpr.and(hasAppliedChatEditsContextKey, ( hasUndecidedChatEditingResourceContextKey.negate())))))
|
|
701
|
+
}
|
|
702
|
+
],
|
|
703
|
+
});
|
|
704
|
+
}
|
|
705
|
+
async runEditingSessionAction(accessor, editingSession, chatWidget, ...args) {
|
|
706
|
+
await editingSession.show(true);
|
|
707
|
+
}
|
|
708
|
+
}
|
|
709
|
+
registerAction2(ViewPreviousEditsAction);
|
|
710
|
+
CommandsRegistry.registerCommand('_chat.editSessions.accept', async (accessor, resources) => {
|
|
711
|
+
if (resources.length === 0) {
|
|
712
|
+
return;
|
|
713
|
+
}
|
|
714
|
+
const uris = ( resources.map(resource => URI.revive(resource)));
|
|
715
|
+
const chatEditingService = accessor.get(IChatEditingService);
|
|
716
|
+
for (const editingSession of chatEditingService.editingSessionsObs.get()) {
|
|
717
|
+
await editingSession.accept(...uris);
|
|
718
|
+
}
|
|
719
|
+
});
|
|
720
|
+
|
|
721
|
+
export { ChatEditingAcceptAllAction, ChatEditingDiscardAllAction, ChatEditingShowChangesAction, EditingSessionAction, ViewAllSessionChangesAction, ViewPreviousEditsAction, discardAllEditsWithConfirmation, getEditingSessionContext };
|