@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,797 @@
|
|
|
1
|
+
|
|
2
|
+
import { registerCss } from '@codingame/monaco-vscode-api/css';
|
|
3
|
+
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
4
|
+
import * as codeBlockPart from './codeBlockPart.css';
|
|
5
|
+
import { $ as $$1, append, hide, show, clearNode, getTotalHeight, Dimension, reset } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/dom';
|
|
6
|
+
import { renderFormattedText } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/formattedTextRenderer';
|
|
7
|
+
import { Button } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/button/button';
|
|
8
|
+
import { Codicon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/codicons';
|
|
9
|
+
import { Emitter, Event } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
|
|
10
|
+
import { Disposable, MutableDisposable, combinedDisposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
11
|
+
import { Schemas } from '@codingame/monaco-vscode-api/vscode/vs/base/common/network';
|
|
12
|
+
import { isEqual } from '@codingame/monaco-vscode-api/vscode/vs/base/common/resources';
|
|
13
|
+
import { assertType } from '@codingame/monaco-vscode-api/vscode/vs/base/common/types';
|
|
14
|
+
import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
|
|
15
|
+
import { EditorExtensionsRegistry } from '@codingame/monaco-vscode-api/vscode/vs/editor/browser/editorExtensions';
|
|
16
|
+
import { ICodeEditorService } from '@codingame/monaco-vscode-api/vscode/vs/editor/browser/services/codeEditorService.service';
|
|
17
|
+
import { CodeEditorWidget } from '@codingame/monaco-vscode-api/vscode/vs/editor/browser/widget/codeEditor/codeEditorWidget';
|
|
18
|
+
import { DiffEditorWidget } from '@codingame/monaco-vscode-api/vscode/vs/editor/browser/widget/diffEditor/diffEditorWidget';
|
|
19
|
+
import { EditorOption } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/config/editorOptions';
|
|
20
|
+
import { EDITOR_FONT_DEFAULTS } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/config/fontInfo';
|
|
21
|
+
import { Range } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/core/range';
|
|
22
|
+
import { ScrollType } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/editorCommon';
|
|
23
|
+
import { TextEdit } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/languages';
|
|
24
|
+
import { EndOfLinePreference } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/model';
|
|
25
|
+
import { TextModelText } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/model/textModelText';
|
|
26
|
+
import { IModelService } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/services/model.service';
|
|
27
|
+
import { DefaultModelSHA1Computer } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/services/modelService';
|
|
28
|
+
import { ITextModelService } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/services/resolverService.service';
|
|
29
|
+
import { BracketMatchingController } from '@codingame/monaco-vscode-api/vscode/vs/editor/contrib/bracketMatching/browser/bracketMatching';
|
|
30
|
+
import { ColorDetector } from '@codingame/monaco-vscode-api/vscode/vs/editor/contrib/colorPicker/browser/colorDetector';
|
|
31
|
+
import { ContextMenuController } from '@codingame/monaco-vscode-api/vscode/vs/editor/contrib/contextmenu/browser/contextmenu';
|
|
32
|
+
import { GotoDefinitionAtPositionEditorContribution } from '@codingame/monaco-vscode-api/vscode/vs/editor/contrib/gotoSymbol/browser/link/goToDefinitionAtPosition';
|
|
33
|
+
import { ContentHoverController } from '@codingame/monaco-vscode-api/vscode/vs/editor/contrib/hover/browser/contentHoverController';
|
|
34
|
+
import { GlyphHoverController } from '@codingame/monaco-vscode-api/vscode/vs/editor/contrib/hover/browser/glyphHoverController';
|
|
35
|
+
import { LinkDetector } from '@codingame/monaco-vscode-api/vscode/vs/editor/contrib/links/browser/links';
|
|
36
|
+
import { MessageController } from '@codingame/monaco-vscode-api/vscode/vs/editor/contrib/message/browser/messageController';
|
|
37
|
+
import { ViewportSemanticTokensContribution } from '@codingame/monaco-vscode-api/vscode/vs/editor/contrib/semanticTokens/browser/viewportSemanticTokens';
|
|
38
|
+
import { SmartSelectController } from '@codingame/monaco-vscode-api/vscode/vs/editor/contrib/smartSelect/browser/smartSelect';
|
|
39
|
+
import { WordHighlighterContribution } from '@codingame/monaco-vscode-api/vscode/vs/editor/contrib/wordHighlighter/browser/wordHighlighter';
|
|
40
|
+
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
41
|
+
import { IAccessibilityService } from '@codingame/monaco-vscode-api/vscode/vs/platform/accessibility/common/accessibility.service';
|
|
42
|
+
import { MenuWorkbenchToolBar } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/browser/toolbar';
|
|
43
|
+
import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
|
|
44
|
+
import { IContextKeyService } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey.service';
|
|
45
|
+
import { IDialogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/dialogs/common/dialogs.service';
|
|
46
|
+
import { FileKind } from '@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files';
|
|
47
|
+
import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
|
|
48
|
+
import { ServiceCollection } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/serviceCollection';
|
|
49
|
+
import { ILabelService } from '@codingame/monaco-vscode-api/vscode/vs/platform/label/common/label.service';
|
|
50
|
+
import { IOpenerService } from '@codingame/monaco-vscode-api/vscode/vs/platform/opener/common/opener.service';
|
|
51
|
+
import { ResourceLabel } from '@codingame/monaco-vscode-api/vscode/vs/workbench/browser/labels';
|
|
52
|
+
import { ResourceContextKey } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/contextkeys';
|
|
53
|
+
import { AccessibilityVerbositySettingId } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/accessibility/browser/accessibilityConfiguration';
|
|
54
|
+
import { InspectEditorTokensController } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/codeEditor/browser/inspectEditorTokens/inspectEditorTokens';
|
|
55
|
+
import { MenuPreventer } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/codeEditor/browser/menuPreventer';
|
|
56
|
+
import { SelectionClipboardContributionID } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/codeEditor/browser/selectionClipboard';
|
|
57
|
+
import { getSimpleEditorOptions } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/codeEditor/browser/simpleEditorOptions';
|
|
58
|
+
import { ChatContextKeys } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatContextKeys';
|
|
59
|
+
import { isRequestVM, isResponseVM } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatViewModel';
|
|
60
|
+
import { emptyProgressRunner } from '@codingame/monaco-vscode-api/vscode/vs/platform/progress/common/progress';
|
|
61
|
+
import { IEditorProgressService } from '@codingame/monaco-vscode-api/vscode/vs/platform/progress/common/progress.service';
|
|
62
|
+
import { SuggestController } from '@codingame/monaco-vscode-api/vscode/vs/editor/contrib/suggest/browser/suggestController';
|
|
63
|
+
import { SnippetController2 } from '@codingame/monaco-vscode-api/vscode/vs/editor/contrib/snippet/browser/snippetController2';
|
|
64
|
+
|
|
65
|
+
registerCss(codeBlockPart);
|
|
66
|
+
const $ = $$1;
|
|
67
|
+
const localFileLanguageId = 'vscode-local-file';
|
|
68
|
+
function parseLocalFileData(text) {
|
|
69
|
+
let data;
|
|
70
|
+
try {
|
|
71
|
+
data = JSON.parse(text);
|
|
72
|
+
}
|
|
73
|
+
catch (e) {
|
|
74
|
+
throw ( new Error('Could not parse code block local file data'));
|
|
75
|
+
}
|
|
76
|
+
let uri;
|
|
77
|
+
try {
|
|
78
|
+
uri = URI.revive(data?.uri);
|
|
79
|
+
}
|
|
80
|
+
catch (e) {
|
|
81
|
+
throw ( new Error('Invalid code block local file data URI'));
|
|
82
|
+
}
|
|
83
|
+
let range;
|
|
84
|
+
if (data.range) {
|
|
85
|
+
range = ( new Range(
|
|
86
|
+
data.range.startLineNumber + 1,
|
|
87
|
+
data.range.startColumn + 1,
|
|
88
|
+
data.range.endLineNumber + 1,
|
|
89
|
+
data.range.endColumn + 1
|
|
90
|
+
));
|
|
91
|
+
}
|
|
92
|
+
return { uri, range };
|
|
93
|
+
}
|
|
94
|
+
const defaultCodeblockPadding = 10;
|
|
95
|
+
let CodeBlockPart = class CodeBlockPart extends Disposable {
|
|
96
|
+
get verticalPadding() {
|
|
97
|
+
return this.currentCodeBlockData?.renderOptions?.verticalPadding ?? defaultCodeblockPadding;
|
|
98
|
+
}
|
|
99
|
+
constructor(editorOptions, menuId, delegate, overflowWidgetsDomNode, isSimpleWidget = false, instantiationService, contextKeyService, modelService, configurationService, accessibilityService) {
|
|
100
|
+
super();
|
|
101
|
+
this.editorOptions = editorOptions;
|
|
102
|
+
this.menuId = menuId;
|
|
103
|
+
this.isSimpleWidget = isSimpleWidget;
|
|
104
|
+
this.modelService = modelService;
|
|
105
|
+
this.configurationService = configurationService;
|
|
106
|
+
this.accessibilityService = accessibilityService;
|
|
107
|
+
this._onDidChangeContentHeight = this._register(( new Emitter()));
|
|
108
|
+
this.onDidChangeContentHeight = this._onDidChangeContentHeight.event;
|
|
109
|
+
this.currentScrollWidth = 0;
|
|
110
|
+
this.isDisposed = false;
|
|
111
|
+
this.element = $('.interactive-result-code-block');
|
|
112
|
+
this.resourceContextKey = this._register(instantiationService.createInstance(ResourceContextKey));
|
|
113
|
+
this.contextKeyService = this._register(contextKeyService.createScoped(this.element));
|
|
114
|
+
const scopedInstantiationService = this._register(instantiationService.createChild(( new ServiceCollection([IContextKeyService, this.contextKeyService]))));
|
|
115
|
+
const editorElement = append(this.element, $('.interactive-result-editor'));
|
|
116
|
+
this.editor = this.createEditor(scopedInstantiationService, editorElement, {
|
|
117
|
+
...getSimpleEditorOptions(this.configurationService),
|
|
118
|
+
readOnly: true,
|
|
119
|
+
lineNumbers: 'off',
|
|
120
|
+
selectOnLineNumbers: true,
|
|
121
|
+
scrollBeyondLastLine: false,
|
|
122
|
+
lineDecorationsWidth: 8,
|
|
123
|
+
dragAndDrop: false,
|
|
124
|
+
padding: { top: this.verticalPadding, bottom: this.verticalPadding },
|
|
125
|
+
mouseWheelZoom: false,
|
|
126
|
+
scrollbar: {
|
|
127
|
+
vertical: 'hidden',
|
|
128
|
+
alwaysConsumeMouseWheel: false
|
|
129
|
+
},
|
|
130
|
+
definitionLinkOpensInPeek: false,
|
|
131
|
+
gotoLocation: {
|
|
132
|
+
multiple: 'goto',
|
|
133
|
+
multipleDeclarations: 'goto',
|
|
134
|
+
multipleDefinitions: 'goto',
|
|
135
|
+
multipleImplementations: 'goto',
|
|
136
|
+
},
|
|
137
|
+
ariaLabel: ( localize(5673, 'Code block')),
|
|
138
|
+
overflowWidgetsDomNode,
|
|
139
|
+
tabFocusMode: true,
|
|
140
|
+
...this.getEditorOptionsFromConfig(),
|
|
141
|
+
});
|
|
142
|
+
const toolbarElement = append(this.element, $('.interactive-result-code-block-toolbar'));
|
|
143
|
+
const editorScopedService = this.editor.contextKeyService.createScoped(toolbarElement);
|
|
144
|
+
const editorScopedInstantiationService = this._register(scopedInstantiationService.createChild(( new ServiceCollection([IContextKeyService, editorScopedService]))));
|
|
145
|
+
this.toolbar = this._register(editorScopedInstantiationService.createInstance(MenuWorkbenchToolBar, toolbarElement, menuId, {
|
|
146
|
+
menuOptions: {
|
|
147
|
+
shouldForwardArgs: true
|
|
148
|
+
}
|
|
149
|
+
}));
|
|
150
|
+
const vulnsContainer = append(this.element, $('.interactive-result-vulns'));
|
|
151
|
+
const vulnsHeaderElement = append(vulnsContainer, $('.interactive-result-vulns-header', undefined));
|
|
152
|
+
this.vulnsButton = this._register(( new Button(vulnsHeaderElement, {
|
|
153
|
+
buttonBackground: undefined,
|
|
154
|
+
buttonBorder: undefined,
|
|
155
|
+
buttonForeground: undefined,
|
|
156
|
+
buttonHoverBackground: undefined,
|
|
157
|
+
buttonSecondaryBackground: undefined,
|
|
158
|
+
buttonSecondaryForeground: undefined,
|
|
159
|
+
buttonSecondaryHoverBackground: undefined,
|
|
160
|
+
buttonSeparator: undefined,
|
|
161
|
+
supportIcons: true
|
|
162
|
+
})));
|
|
163
|
+
this.vulnsListElement = append(vulnsContainer, $('ul.interactive-result-vulns-list'));
|
|
164
|
+
this._register(this.vulnsButton.onDidClick(() => {
|
|
165
|
+
const element = this.currentCodeBlockData.element;
|
|
166
|
+
element.vulnerabilitiesListExpanded = !element.vulnerabilitiesListExpanded;
|
|
167
|
+
this.vulnsButton.label = this.getVulnerabilitiesLabel();
|
|
168
|
+
this.element.classList.toggle('chat-vulnerabilities-collapsed', !element.vulnerabilitiesListExpanded);
|
|
169
|
+
this._onDidChangeContentHeight.fire();
|
|
170
|
+
}));
|
|
171
|
+
this._register(this.toolbar.onDidChangeDropdownVisibility(e => {
|
|
172
|
+
toolbarElement.classList.toggle('force-visibility', e);
|
|
173
|
+
}));
|
|
174
|
+
this._configureForScreenReader();
|
|
175
|
+
this._register(this.accessibilityService.onDidChangeScreenReaderOptimized(() => this._configureForScreenReader()));
|
|
176
|
+
this._register(this.configurationService.onDidChangeConfiguration((e) => {
|
|
177
|
+
if (( e.affectedKeys.has(AccessibilityVerbositySettingId.Chat))) {
|
|
178
|
+
this._configureForScreenReader();
|
|
179
|
+
}
|
|
180
|
+
}));
|
|
181
|
+
this._register(this.editorOptions.onDidChange(() => {
|
|
182
|
+
this.editor.updateOptions(this.getEditorOptionsFromConfig());
|
|
183
|
+
}));
|
|
184
|
+
this._register(this.editor.onDidScrollChange(e => {
|
|
185
|
+
this.currentScrollWidth = e.scrollWidth;
|
|
186
|
+
}));
|
|
187
|
+
this._register(this.editor.onDidContentSizeChange(e => {
|
|
188
|
+
if (e.contentHeightChanged) {
|
|
189
|
+
this._onDidChangeContentHeight.fire();
|
|
190
|
+
}
|
|
191
|
+
}));
|
|
192
|
+
this._register(this.editor.onDidBlurEditorWidget(() => {
|
|
193
|
+
this.element.classList.remove('focused');
|
|
194
|
+
WordHighlighterContribution.get(this.editor)?.stopHighlighting();
|
|
195
|
+
this.clearWidgets();
|
|
196
|
+
}));
|
|
197
|
+
this._register(this.editor.onDidFocusEditorWidget(() => {
|
|
198
|
+
this.element.classList.add('focused');
|
|
199
|
+
WordHighlighterContribution.get(this.editor)?.restoreViewState(true);
|
|
200
|
+
}));
|
|
201
|
+
this._register(Event.any(this.editor.onDidChangeModel, this.editor.onDidChangeModelContent)(() => {
|
|
202
|
+
if (this.currentCodeBlockData) {
|
|
203
|
+
this.updateContexts(this.currentCodeBlockData);
|
|
204
|
+
}
|
|
205
|
+
}));
|
|
206
|
+
if (delegate.onDidScroll) {
|
|
207
|
+
this._register(delegate.onDidScroll(e => {
|
|
208
|
+
this.clearWidgets();
|
|
209
|
+
}));
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
dispose() {
|
|
213
|
+
this.isDisposed = true;
|
|
214
|
+
super.dispose();
|
|
215
|
+
}
|
|
216
|
+
get uri() {
|
|
217
|
+
return this.editor.getModel()?.uri;
|
|
218
|
+
}
|
|
219
|
+
createEditor(instantiationService, parent, options) {
|
|
220
|
+
return this._register(instantiationService.createInstance(CodeEditorWidget, parent, options, {
|
|
221
|
+
isSimpleWidget: this.isSimpleWidget,
|
|
222
|
+
contributions: EditorExtensionsRegistry.getSomeEditorContributions([
|
|
223
|
+
MenuPreventer.ID,
|
|
224
|
+
SelectionClipboardContributionID,
|
|
225
|
+
ContextMenuController.ID,
|
|
226
|
+
WordHighlighterContribution.ID,
|
|
227
|
+
ViewportSemanticTokensContribution.ID,
|
|
228
|
+
BracketMatchingController.ID,
|
|
229
|
+
SmartSelectController.ID,
|
|
230
|
+
ContentHoverController.ID,
|
|
231
|
+
GlyphHoverController.ID,
|
|
232
|
+
MessageController.ID,
|
|
233
|
+
GotoDefinitionAtPositionEditorContribution.ID,
|
|
234
|
+
SuggestController.ID,
|
|
235
|
+
SnippetController2.ID,
|
|
236
|
+
ColorDetector.ID,
|
|
237
|
+
LinkDetector.ID,
|
|
238
|
+
InspectEditorTokensController.ID,
|
|
239
|
+
])
|
|
240
|
+
}));
|
|
241
|
+
}
|
|
242
|
+
focus() {
|
|
243
|
+
this.editor.focus();
|
|
244
|
+
}
|
|
245
|
+
updatePaddingForLayout() {
|
|
246
|
+
const horizontalScrollbarVisible = this.currentScrollWidth > this.editor.getLayoutInfo().contentWidth;
|
|
247
|
+
const scrollbarHeight = this.editor.getLayoutInfo().horizontalScrollbarHeight;
|
|
248
|
+
const bottomPadding = horizontalScrollbarVisible ?
|
|
249
|
+
Math.max(this.verticalPadding - scrollbarHeight, 2) :
|
|
250
|
+
this.verticalPadding;
|
|
251
|
+
this.editor.updateOptions({ padding: { top: this.verticalPadding, bottom: bottomPadding } });
|
|
252
|
+
}
|
|
253
|
+
_configureForScreenReader() {
|
|
254
|
+
const toolbarElt = this.toolbar.getElement();
|
|
255
|
+
if (this.accessibilityService.isScreenReaderOptimized()) {
|
|
256
|
+
toolbarElt.style.display = 'block';
|
|
257
|
+
}
|
|
258
|
+
else {
|
|
259
|
+
toolbarElt.style.display = '';
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
getEditorOptionsFromConfig() {
|
|
263
|
+
return {
|
|
264
|
+
wordWrap: this.editorOptions.configuration.resultEditor.wordWrap,
|
|
265
|
+
fontLigatures: this.editorOptions.configuration.resultEditor.fontLigatures,
|
|
266
|
+
bracketPairColorization: this.editorOptions.configuration.resultEditor.bracketPairColorization,
|
|
267
|
+
fontFamily: this.editorOptions.configuration.resultEditor.fontFamily === 'default' ?
|
|
268
|
+
EDITOR_FONT_DEFAULTS.fontFamily :
|
|
269
|
+
this.editorOptions.configuration.resultEditor.fontFamily,
|
|
270
|
+
fontSize: this.editorOptions.configuration.resultEditor.fontSize,
|
|
271
|
+
fontWeight: this.editorOptions.configuration.resultEditor.fontWeight,
|
|
272
|
+
lineHeight: this.editorOptions.configuration.resultEditor.lineHeight,
|
|
273
|
+
...this.currentCodeBlockData?.renderOptions?.editorOptions,
|
|
274
|
+
};
|
|
275
|
+
}
|
|
276
|
+
layout(width) {
|
|
277
|
+
const contentHeight = this.getContentHeight();
|
|
278
|
+
let height = contentHeight;
|
|
279
|
+
if (this.currentCodeBlockData?.renderOptions?.maxHeightInLines) {
|
|
280
|
+
height = Math.min(contentHeight, this.editor.getOption(EditorOption.lineHeight) * this.currentCodeBlockData?.renderOptions?.maxHeightInLines);
|
|
281
|
+
}
|
|
282
|
+
const editorBorder = 2;
|
|
283
|
+
width = width - editorBorder - (this.currentCodeBlockData?.renderOptions?.reserveWidth ?? 0);
|
|
284
|
+
this.editor.layout({ width: isRequestVM(this.currentCodeBlockData?.element) ? width * 0.9 : width, height });
|
|
285
|
+
this.updatePaddingForLayout();
|
|
286
|
+
}
|
|
287
|
+
getContentHeight() {
|
|
288
|
+
if (this.currentCodeBlockData?.range) {
|
|
289
|
+
const lineCount = this.currentCodeBlockData.range.endLineNumber - this.currentCodeBlockData.range.startLineNumber + 1;
|
|
290
|
+
const lineHeight = this.editor.getOption(EditorOption.lineHeight);
|
|
291
|
+
return lineCount * lineHeight;
|
|
292
|
+
}
|
|
293
|
+
return this.editor.getContentHeight();
|
|
294
|
+
}
|
|
295
|
+
async render(data, width) {
|
|
296
|
+
this.currentCodeBlockData = data;
|
|
297
|
+
if (data.parentContextKeyService) {
|
|
298
|
+
this.contextKeyService.updateParent(data.parentContextKeyService);
|
|
299
|
+
}
|
|
300
|
+
if (this.getEditorOptionsFromConfig().wordWrap === 'on') {
|
|
301
|
+
this.layout(width);
|
|
302
|
+
}
|
|
303
|
+
const didUpdate = await this.updateEditor(data);
|
|
304
|
+
if (!didUpdate || this.isDisposed || this.currentCodeBlockData !== data) {
|
|
305
|
+
return;
|
|
306
|
+
}
|
|
307
|
+
this.editor.updateOptions({
|
|
308
|
+
...this.getEditorOptionsFromConfig(),
|
|
309
|
+
});
|
|
310
|
+
if (!this.editor.getOption(EditorOption.ariaLabel)) {
|
|
311
|
+
this.editor.updateOptions({
|
|
312
|
+
ariaLabel: ( localize(5674, "Code block {0}", data.codeBlockIndex + 1)),
|
|
313
|
+
});
|
|
314
|
+
}
|
|
315
|
+
this.layout(width);
|
|
316
|
+
this.toolbar.setAriaLabel(( localize(5675, "Code block {0}", data.codeBlockIndex + 1)));
|
|
317
|
+
if (data.renderOptions?.hideToolbar) {
|
|
318
|
+
hide(this.toolbar.getElement());
|
|
319
|
+
}
|
|
320
|
+
else {
|
|
321
|
+
show(this.toolbar.getElement());
|
|
322
|
+
}
|
|
323
|
+
if (data.vulns?.length && isResponseVM(data.element)) {
|
|
324
|
+
clearNode(this.vulnsListElement);
|
|
325
|
+
this.element.classList.remove('no-vulns');
|
|
326
|
+
this.element.classList.toggle('chat-vulnerabilities-collapsed', !data.element.vulnerabilitiesListExpanded);
|
|
327
|
+
append(this.vulnsListElement, ...( data.vulns.map(
|
|
328
|
+
v => $('li', undefined, $('span.chat-vuln-title', undefined, v.title), ' ' + v.description)
|
|
329
|
+
)));
|
|
330
|
+
this.vulnsButton.label = this.getVulnerabilitiesLabel();
|
|
331
|
+
}
|
|
332
|
+
else {
|
|
333
|
+
this.element.classList.add('no-vulns');
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
reset() {
|
|
337
|
+
this.clearWidgets();
|
|
338
|
+
this.currentCodeBlockData = undefined;
|
|
339
|
+
}
|
|
340
|
+
clearWidgets() {
|
|
341
|
+
ContentHoverController.get(this.editor)?.hideContentHover();
|
|
342
|
+
GlyphHoverController.get(this.editor)?.hideGlyphHover();
|
|
343
|
+
}
|
|
344
|
+
async updateEditor(data) {
|
|
345
|
+
const textModel = await data.textModel;
|
|
346
|
+
if (this.isDisposed || this.currentCodeBlockData !== data || !textModel || textModel.isDisposed()) {
|
|
347
|
+
return false;
|
|
348
|
+
}
|
|
349
|
+
this.editor.setModel(textModel);
|
|
350
|
+
if (data.range) {
|
|
351
|
+
this.editor.setSelection(data.range);
|
|
352
|
+
this.editor.revealRangeInCenter(data.range, ScrollType.Immediate);
|
|
353
|
+
}
|
|
354
|
+
this.updateContexts(data);
|
|
355
|
+
return true;
|
|
356
|
+
}
|
|
357
|
+
getVulnerabilitiesLabel() {
|
|
358
|
+
if (!this.currentCodeBlockData || !this.currentCodeBlockData.vulns) {
|
|
359
|
+
return '';
|
|
360
|
+
}
|
|
361
|
+
const referencesLabel = this.currentCodeBlockData.vulns.length > 1 ?
|
|
362
|
+
( localize(5676, "{0} vulnerabilities", this.currentCodeBlockData.vulns.length)) :
|
|
363
|
+
( localize(5677, "{0} vulnerability", 1));
|
|
364
|
+
const icon = (element) => element.vulnerabilitiesListExpanded ? Codicon.chevronDown : Codicon.chevronRight;
|
|
365
|
+
return `${referencesLabel} $(${icon(this.currentCodeBlockData.element).id})`;
|
|
366
|
+
}
|
|
367
|
+
updateContexts(data) {
|
|
368
|
+
const textModel = this.editor.getModel();
|
|
369
|
+
if (!textModel) {
|
|
370
|
+
return;
|
|
371
|
+
}
|
|
372
|
+
this.toolbar.context = {
|
|
373
|
+
code: textModel.getTextBuffer().getValueInRange(data.range ?? textModel.getFullModelRange(), EndOfLinePreference.TextDefined),
|
|
374
|
+
codeBlockIndex: data.codeBlockIndex,
|
|
375
|
+
element: data.element,
|
|
376
|
+
languageId: textModel.getLanguageId(),
|
|
377
|
+
codemapperUri: data.codemapperUri,
|
|
378
|
+
chatSessionResource: data.chatSessionResource
|
|
379
|
+
};
|
|
380
|
+
this.resourceContextKey.set(textModel.uri);
|
|
381
|
+
}
|
|
382
|
+
};
|
|
383
|
+
CodeBlockPart = ( __decorate([
|
|
384
|
+
( __param(5, IInstantiationService)),
|
|
385
|
+
( __param(6, IContextKeyService)),
|
|
386
|
+
( __param(7, IModelService)),
|
|
387
|
+
( __param(8, IConfigurationService)),
|
|
388
|
+
( __param(9, IAccessibilityService))
|
|
389
|
+
], CodeBlockPart));
|
|
390
|
+
let ChatCodeBlockContentProvider = class ChatCodeBlockContentProvider extends Disposable {
|
|
391
|
+
constructor(textModelService, _modelService) {
|
|
392
|
+
super();
|
|
393
|
+
this._modelService = _modelService;
|
|
394
|
+
this._register(textModelService.registerTextModelContentProvider(Schemas.vscodeChatCodeBlock, this));
|
|
395
|
+
}
|
|
396
|
+
async provideTextContent(resource) {
|
|
397
|
+
const existing = this._modelService.getModel(resource);
|
|
398
|
+
if (existing) {
|
|
399
|
+
return existing;
|
|
400
|
+
}
|
|
401
|
+
return this._modelService.createModel('', null, resource);
|
|
402
|
+
}
|
|
403
|
+
};
|
|
404
|
+
ChatCodeBlockContentProvider = ( __decorate([
|
|
405
|
+
( __param(0, ITextModelService)),
|
|
406
|
+
( __param(1, IModelService))
|
|
407
|
+
], ChatCodeBlockContentProvider));
|
|
408
|
+
let CodeCompareBlockPart = class CodeCompareBlockPart extends Disposable {
|
|
409
|
+
constructor(options, menuId, delegate, overflowWidgetsDomNode, isSimpleWidget = false, instantiationService, contextKeyService, modelService, configurationService, accessibilityService, labelService, openerService) {
|
|
410
|
+
super();
|
|
411
|
+
this.options = options;
|
|
412
|
+
this.menuId = menuId;
|
|
413
|
+
this.isSimpleWidget = isSimpleWidget;
|
|
414
|
+
this.modelService = modelService;
|
|
415
|
+
this.configurationService = configurationService;
|
|
416
|
+
this.accessibilityService = accessibilityService;
|
|
417
|
+
this.labelService = labelService;
|
|
418
|
+
this.openerService = openerService;
|
|
419
|
+
this._onDidChangeContentHeight = this._register(( new Emitter()));
|
|
420
|
+
this.onDidChangeContentHeight = this._onDidChangeContentHeight.event;
|
|
421
|
+
this._lastDiffEditorViewModel = this._store.add(( new MutableDisposable()));
|
|
422
|
+
this.currentScrollWidth = 0;
|
|
423
|
+
this.currentHorizontalPadding = 0;
|
|
424
|
+
this.element = $('.interactive-result-code-block');
|
|
425
|
+
this.element.classList.add('compare');
|
|
426
|
+
this.messageElement = append(this.element, $('.message'));
|
|
427
|
+
this.messageElement.setAttribute('role', 'status');
|
|
428
|
+
this.messageElement.tabIndex = 0;
|
|
429
|
+
this.contextKeyService = this._register(contextKeyService.createScoped(this.element));
|
|
430
|
+
const scopedInstantiationService = this._register(instantiationService.createChild(( new ServiceCollection(
|
|
431
|
+
[IContextKeyService, this.contextKeyService],
|
|
432
|
+
[IEditorProgressService, new class {
|
|
433
|
+
show(_total, _delay) {
|
|
434
|
+
return emptyProgressRunner;
|
|
435
|
+
}
|
|
436
|
+
async showWhile(promise, _delay) {
|
|
437
|
+
await promise;
|
|
438
|
+
}
|
|
439
|
+
}]
|
|
440
|
+
))));
|
|
441
|
+
const editorHeader = this.editorHeader = append(this.element, $('.interactive-result-header.show-file-icons'));
|
|
442
|
+
const editorElement = append(this.element, $('.interactive-result-editor'));
|
|
443
|
+
this.diffEditor = this.createDiffEditor(scopedInstantiationService, editorElement, {
|
|
444
|
+
...getSimpleEditorOptions(this.configurationService),
|
|
445
|
+
lineNumbers: 'on',
|
|
446
|
+
selectOnLineNumbers: true,
|
|
447
|
+
scrollBeyondLastLine: false,
|
|
448
|
+
lineDecorationsWidth: 12,
|
|
449
|
+
dragAndDrop: false,
|
|
450
|
+
padding: { top: defaultCodeblockPadding, bottom: defaultCodeblockPadding },
|
|
451
|
+
mouseWheelZoom: false,
|
|
452
|
+
scrollbar: {
|
|
453
|
+
vertical: 'hidden',
|
|
454
|
+
alwaysConsumeMouseWheel: false
|
|
455
|
+
},
|
|
456
|
+
definitionLinkOpensInPeek: false,
|
|
457
|
+
gotoLocation: {
|
|
458
|
+
multiple: 'goto',
|
|
459
|
+
multipleDeclarations: 'goto',
|
|
460
|
+
multipleDefinitions: 'goto',
|
|
461
|
+
multipleImplementations: 'goto',
|
|
462
|
+
},
|
|
463
|
+
ariaLabel: ( localize(5673, 'Code block')),
|
|
464
|
+
overflowWidgetsDomNode,
|
|
465
|
+
...this.getEditorOptionsFromConfig(),
|
|
466
|
+
});
|
|
467
|
+
this.resourceLabel = this._register(scopedInstantiationService.createInstance(ResourceLabel, editorHeader, { supportIcons: true }));
|
|
468
|
+
const editorScopedService = this.diffEditor.getModifiedEditor().contextKeyService.createScoped(editorHeader);
|
|
469
|
+
const editorScopedInstantiationService = this._register(scopedInstantiationService.createChild(( new ServiceCollection([IContextKeyService, editorScopedService]))));
|
|
470
|
+
this.toolbar = this._register(editorScopedInstantiationService.createInstance(MenuWorkbenchToolBar, editorHeader, menuId, {
|
|
471
|
+
menuOptions: {
|
|
472
|
+
shouldForwardArgs: true
|
|
473
|
+
}
|
|
474
|
+
}));
|
|
475
|
+
this._configureForScreenReader();
|
|
476
|
+
this._register(this.accessibilityService.onDidChangeScreenReaderOptimized(() => this._configureForScreenReader()));
|
|
477
|
+
this._register(this.configurationService.onDidChangeConfiguration((e) => {
|
|
478
|
+
if (( e.affectedKeys.has(AccessibilityVerbositySettingId.Chat))) {
|
|
479
|
+
this._configureForScreenReader();
|
|
480
|
+
}
|
|
481
|
+
}));
|
|
482
|
+
this._register(this.options.onDidChange(() => {
|
|
483
|
+
this.diffEditor.updateOptions(this.getEditorOptionsFromConfig());
|
|
484
|
+
}));
|
|
485
|
+
this._register(this.diffEditor.getModifiedEditor().onDidScrollChange(e => {
|
|
486
|
+
this.currentScrollWidth = e.scrollWidth;
|
|
487
|
+
}));
|
|
488
|
+
this._register(this.diffEditor.onDidContentSizeChange(e => {
|
|
489
|
+
if (e.contentHeightChanged) {
|
|
490
|
+
this._onDidChangeContentHeight.fire();
|
|
491
|
+
}
|
|
492
|
+
}));
|
|
493
|
+
this._register(this.diffEditor.getModifiedEditor().onDidBlurEditorWidget(() => {
|
|
494
|
+
this.element.classList.remove('focused');
|
|
495
|
+
WordHighlighterContribution.get(this.diffEditor.getModifiedEditor())?.stopHighlighting();
|
|
496
|
+
this.clearWidgets();
|
|
497
|
+
}));
|
|
498
|
+
this._register(this.diffEditor.getModifiedEditor().onDidFocusEditorWidget(() => {
|
|
499
|
+
this.element.classList.add('focused');
|
|
500
|
+
WordHighlighterContribution.get(this.diffEditor.getModifiedEditor())?.restoreViewState(true);
|
|
501
|
+
}));
|
|
502
|
+
if (delegate.onDidScroll) {
|
|
503
|
+
this._register(delegate.onDidScroll(e => {
|
|
504
|
+
this.clearWidgets();
|
|
505
|
+
}));
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
get uri() {
|
|
509
|
+
return this.diffEditor.getModifiedEditor().getModel()?.uri;
|
|
510
|
+
}
|
|
511
|
+
createDiffEditor(instantiationService, parent, options) {
|
|
512
|
+
const widgetOptions = {
|
|
513
|
+
isSimpleWidget: this.isSimpleWidget,
|
|
514
|
+
contributions: EditorExtensionsRegistry.getSomeEditorContributions([
|
|
515
|
+
MenuPreventer.ID,
|
|
516
|
+
SelectionClipboardContributionID,
|
|
517
|
+
ContextMenuController.ID,
|
|
518
|
+
WordHighlighterContribution.ID,
|
|
519
|
+
ViewportSemanticTokensContribution.ID,
|
|
520
|
+
BracketMatchingController.ID,
|
|
521
|
+
SmartSelectController.ID,
|
|
522
|
+
ContentHoverController.ID,
|
|
523
|
+
GlyphHoverController.ID,
|
|
524
|
+
GotoDefinitionAtPositionEditorContribution.ID,
|
|
525
|
+
])
|
|
526
|
+
};
|
|
527
|
+
return this._register(instantiationService.createInstance(DiffEditorWidget, parent, {
|
|
528
|
+
scrollbar: { useShadows: false, alwaysConsumeMouseWheel: false, ignoreHorizontalScrollbarInContentHeight: true, },
|
|
529
|
+
renderMarginRevertIcon: false,
|
|
530
|
+
diffCodeLens: false,
|
|
531
|
+
scrollBeyondLastLine: false,
|
|
532
|
+
stickyScroll: { enabled: false },
|
|
533
|
+
originalAriaLabel: ( localize(5678, 'Original')),
|
|
534
|
+
modifiedAriaLabel: ( localize(5679, 'Modified')),
|
|
535
|
+
diffAlgorithm: 'advanced',
|
|
536
|
+
readOnly: false,
|
|
537
|
+
isInEmbeddedEditor: true,
|
|
538
|
+
useInlineViewWhenSpaceIsLimited: true,
|
|
539
|
+
experimental: {
|
|
540
|
+
useTrueInlineView: true,
|
|
541
|
+
},
|
|
542
|
+
renderSideBySideInlineBreakpoint: 300,
|
|
543
|
+
renderOverviewRuler: false,
|
|
544
|
+
compactMode: true,
|
|
545
|
+
hideUnchangedRegions: { enabled: true, contextLineCount: 1 },
|
|
546
|
+
renderGutterMenu: false,
|
|
547
|
+
lineNumbersMinChars: 1,
|
|
548
|
+
...options
|
|
549
|
+
}, { originalEditor: widgetOptions, modifiedEditor: widgetOptions }));
|
|
550
|
+
}
|
|
551
|
+
focus() {
|
|
552
|
+
this.diffEditor.focus();
|
|
553
|
+
}
|
|
554
|
+
updatePaddingForLayout() {
|
|
555
|
+
const horizontalScrollbarVisible = this.currentScrollWidth > this.diffEditor.getModifiedEditor().getLayoutInfo().contentWidth;
|
|
556
|
+
const scrollbarHeight = this.diffEditor.getModifiedEditor().getLayoutInfo().horizontalScrollbarHeight;
|
|
557
|
+
const bottomPadding = horizontalScrollbarVisible ?
|
|
558
|
+
Math.max(defaultCodeblockPadding - scrollbarHeight, 2) :
|
|
559
|
+
defaultCodeblockPadding;
|
|
560
|
+
this.diffEditor.updateOptions({ padding: { top: defaultCodeblockPadding, bottom: bottomPadding } });
|
|
561
|
+
}
|
|
562
|
+
_configureForScreenReader() {
|
|
563
|
+
const toolbarElt = this.toolbar.getElement();
|
|
564
|
+
if (this.accessibilityService.isScreenReaderOptimized()) {
|
|
565
|
+
toolbarElt.style.display = 'block';
|
|
566
|
+
toolbarElt.ariaLabel = ( localize(5680, 'Code block toolbar'));
|
|
567
|
+
}
|
|
568
|
+
else {
|
|
569
|
+
toolbarElt.style.display = '';
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
getEditorOptionsFromConfig() {
|
|
573
|
+
return {
|
|
574
|
+
wordWrap: this.options.configuration.resultEditor.wordWrap,
|
|
575
|
+
fontLigatures: this.options.configuration.resultEditor.fontLigatures,
|
|
576
|
+
bracketPairColorization: this.options.configuration.resultEditor.bracketPairColorization,
|
|
577
|
+
fontFamily: this.options.configuration.resultEditor.fontFamily === 'default' ?
|
|
578
|
+
EDITOR_FONT_DEFAULTS.fontFamily :
|
|
579
|
+
this.options.configuration.resultEditor.fontFamily,
|
|
580
|
+
fontSize: this.options.configuration.resultEditor.fontSize,
|
|
581
|
+
fontWeight: this.options.configuration.resultEditor.fontWeight,
|
|
582
|
+
lineHeight: this.options.configuration.resultEditor.lineHeight,
|
|
583
|
+
};
|
|
584
|
+
}
|
|
585
|
+
layout(width) {
|
|
586
|
+
const editorBorder = 2;
|
|
587
|
+
const toolbar = getTotalHeight(this.editorHeader);
|
|
588
|
+
const content = this.diffEditor.getModel()
|
|
589
|
+
? this.diffEditor.getContentHeight()
|
|
590
|
+
: getTotalHeight(this.messageElement);
|
|
591
|
+
const dimension = new Dimension(width - editorBorder - this.currentHorizontalPadding * 2, toolbar + content);
|
|
592
|
+
this.element.style.height = `${dimension.height}px`;
|
|
593
|
+
this.element.style.width = `${dimension.width}px`;
|
|
594
|
+
this.diffEditor.layout(dimension.with(undefined, content - editorBorder));
|
|
595
|
+
this.updatePaddingForLayout();
|
|
596
|
+
}
|
|
597
|
+
async render(data, width, token) {
|
|
598
|
+
this.currentHorizontalPadding = data.horizontalPadding || 0;
|
|
599
|
+
if (data.parentContextKeyService) {
|
|
600
|
+
this.contextKeyService.updateParent(data.parentContextKeyService);
|
|
601
|
+
}
|
|
602
|
+
if (this.options.configuration.resultEditor.wordWrap === 'on') {
|
|
603
|
+
this.layout(width);
|
|
604
|
+
}
|
|
605
|
+
await this.updateEditor(data, token);
|
|
606
|
+
this.layout(width);
|
|
607
|
+
this.diffEditor.updateOptions({
|
|
608
|
+
ariaLabel: ( localize(5681, "Code Edits")),
|
|
609
|
+
readOnly: !!data.isReadOnly,
|
|
610
|
+
});
|
|
611
|
+
this.resourceLabel.element.setFile(data.edit.uri, {
|
|
612
|
+
fileKind: FileKind.FILE,
|
|
613
|
+
fileDecorations: { colors: true, badges: false }
|
|
614
|
+
});
|
|
615
|
+
this._onDidChangeContentHeight.fire();
|
|
616
|
+
}
|
|
617
|
+
reset() {
|
|
618
|
+
this.clearWidgets();
|
|
619
|
+
}
|
|
620
|
+
clearWidgets() {
|
|
621
|
+
ContentHoverController.get(this.diffEditor.getOriginalEditor())?.hideContentHover();
|
|
622
|
+
ContentHoverController.get(this.diffEditor.getModifiedEditor())?.hideContentHover();
|
|
623
|
+
GlyphHoverController.get(this.diffEditor.getOriginalEditor())?.hideGlyphHover();
|
|
624
|
+
GlyphHoverController.get(this.diffEditor.getModifiedEditor())?.hideGlyphHover();
|
|
625
|
+
}
|
|
626
|
+
async updateEditor(data, token) {
|
|
627
|
+
if (!isResponseVM(data.element)) {
|
|
628
|
+
return;
|
|
629
|
+
}
|
|
630
|
+
const isEditApplied = Boolean(data.edit.state?.applied ?? 0);
|
|
631
|
+
ChatContextKeys.editApplied.bindTo(this.contextKeyService).set(isEditApplied);
|
|
632
|
+
this.element.classList.toggle('no-diff', isEditApplied);
|
|
633
|
+
if (isEditApplied) {
|
|
634
|
+
assertType(data.edit.state?.applied);
|
|
635
|
+
const uriLabel = this.labelService.getUriLabel(data.edit.uri, { relative: true, noPrefix: true });
|
|
636
|
+
let template;
|
|
637
|
+
if (data.edit.state.applied === 1) {
|
|
638
|
+
template = ( localize(5682, "Applied 1 change in [[``{0}``]]", uriLabel));
|
|
639
|
+
}
|
|
640
|
+
else if (data.edit.state.applied < 0) {
|
|
641
|
+
template = ( localize(5683, "Edits in [[``{0}``]] have been rejected", uriLabel));
|
|
642
|
+
}
|
|
643
|
+
else {
|
|
644
|
+
template = ( localize(
|
|
645
|
+
5684,
|
|
646
|
+
"Applied {0} changes in [[``{1}``]]",
|
|
647
|
+
data.edit.state.applied,
|
|
648
|
+
uriLabel
|
|
649
|
+
));
|
|
650
|
+
}
|
|
651
|
+
const message = renderFormattedText(template, {
|
|
652
|
+
renderCodeSegments: true,
|
|
653
|
+
actionHandler: {
|
|
654
|
+
callback: () => {
|
|
655
|
+
this.openerService.open(data.edit.uri, { fromUserGesture: true, allowCommands: false });
|
|
656
|
+
},
|
|
657
|
+
disposables: this._store,
|
|
658
|
+
}
|
|
659
|
+
});
|
|
660
|
+
reset(this.messageElement, message);
|
|
661
|
+
}
|
|
662
|
+
const diffData = await data.diffData;
|
|
663
|
+
if (!isEditApplied && diffData) {
|
|
664
|
+
const viewModel = this.diffEditor.createViewModel({
|
|
665
|
+
original: diffData.original,
|
|
666
|
+
modified: diffData.modified
|
|
667
|
+
});
|
|
668
|
+
await viewModel.waitForDiff();
|
|
669
|
+
if (token.isCancellationRequested) {
|
|
670
|
+
return;
|
|
671
|
+
}
|
|
672
|
+
const listener = Event.any(diffData.original.onWillDispose, diffData.modified.onWillDispose)(() => {
|
|
673
|
+
this.diffEditor.setModel(null);
|
|
674
|
+
});
|
|
675
|
+
this.diffEditor.setModel(viewModel);
|
|
676
|
+
this._lastDiffEditorViewModel.value = combinedDisposable(listener, viewModel);
|
|
677
|
+
}
|
|
678
|
+
else {
|
|
679
|
+
this.diffEditor.setModel(null);
|
|
680
|
+
this._lastDiffEditorViewModel.value = undefined;
|
|
681
|
+
this._onDidChangeContentHeight.fire();
|
|
682
|
+
}
|
|
683
|
+
this.toolbar.context = {
|
|
684
|
+
edit: data.edit,
|
|
685
|
+
element: data.element,
|
|
686
|
+
diffEditor: this.diffEditor,
|
|
687
|
+
};
|
|
688
|
+
}
|
|
689
|
+
};
|
|
690
|
+
CodeCompareBlockPart = ( __decorate([
|
|
691
|
+
( __param(5, IInstantiationService)),
|
|
692
|
+
( __param(6, IContextKeyService)),
|
|
693
|
+
( __param(7, IModelService)),
|
|
694
|
+
( __param(8, IConfigurationService)),
|
|
695
|
+
( __param(9, IAccessibilityService)),
|
|
696
|
+
( __param(10, ILabelService)),
|
|
697
|
+
( __param(11, IOpenerService))
|
|
698
|
+
], CodeCompareBlockPart));
|
|
699
|
+
let DefaultChatTextEditor = class DefaultChatTextEditor {
|
|
700
|
+
constructor(modelService, editorService, dialogService) {
|
|
701
|
+
this.modelService = modelService;
|
|
702
|
+
this.editorService = editorService;
|
|
703
|
+
this.dialogService = dialogService;
|
|
704
|
+
this._sha1 = ( new DefaultModelSHA1Computer());
|
|
705
|
+
}
|
|
706
|
+
async apply(response, item, diffEditor) {
|
|
707
|
+
if (!response.response.value.includes(item)) {
|
|
708
|
+
return;
|
|
709
|
+
}
|
|
710
|
+
if (item.state?.applied) {
|
|
711
|
+
return;
|
|
712
|
+
}
|
|
713
|
+
if (!diffEditor) {
|
|
714
|
+
for (const candidate of this.editorService.listDiffEditors()) {
|
|
715
|
+
if (!candidate.getContainerDomNode().isConnected) {
|
|
716
|
+
continue;
|
|
717
|
+
}
|
|
718
|
+
const model = candidate.getModel();
|
|
719
|
+
if (!model || !isEqual(model.original.uri, item.uri) || model.modified.uri.scheme !== Schemas.vscodeChatCodeCompareBlock) {
|
|
720
|
+
diffEditor = candidate;
|
|
721
|
+
break;
|
|
722
|
+
}
|
|
723
|
+
}
|
|
724
|
+
}
|
|
725
|
+
const edits = diffEditor
|
|
726
|
+
? await this._applyWithDiffEditor(diffEditor, item)
|
|
727
|
+
: await this._apply(item);
|
|
728
|
+
response.setEditApplied(item, edits);
|
|
729
|
+
}
|
|
730
|
+
async _applyWithDiffEditor(diffEditor, item) {
|
|
731
|
+
const model = diffEditor.getModel();
|
|
732
|
+
if (!model) {
|
|
733
|
+
return 0;
|
|
734
|
+
}
|
|
735
|
+
const diff = diffEditor.getDiffComputationResult();
|
|
736
|
+
if (!diff || diff.identical) {
|
|
737
|
+
return 0;
|
|
738
|
+
}
|
|
739
|
+
if (!(await this._checkSha1(model.original, item))) {
|
|
740
|
+
return 0;
|
|
741
|
+
}
|
|
742
|
+
const modified = ( new TextModelText(model.modified));
|
|
743
|
+
const edits = ( diff.changes2.map(i => i.toRangeMapping().toTextEdit(modified).toSingleEditOperation()));
|
|
744
|
+
model.original.pushStackElement();
|
|
745
|
+
model.original.pushEditOperations(null, edits, () => null);
|
|
746
|
+
model.original.pushStackElement();
|
|
747
|
+
return edits.length;
|
|
748
|
+
}
|
|
749
|
+
async _apply(item) {
|
|
750
|
+
const ref = await this.modelService.createModelReference(item.uri);
|
|
751
|
+
try {
|
|
752
|
+
if (!(await this._checkSha1(ref.object.textEditorModel, item))) {
|
|
753
|
+
return 0;
|
|
754
|
+
}
|
|
755
|
+
ref.object.textEditorModel.pushStackElement();
|
|
756
|
+
let total = 0;
|
|
757
|
+
for (const group of item.edits) {
|
|
758
|
+
const edits = ( group.map(TextEdit.asEditOperation));
|
|
759
|
+
ref.object.textEditorModel.pushEditOperations(null, edits, () => null);
|
|
760
|
+
total += edits.length;
|
|
761
|
+
}
|
|
762
|
+
ref.object.textEditorModel.pushStackElement();
|
|
763
|
+
return total;
|
|
764
|
+
}
|
|
765
|
+
finally {
|
|
766
|
+
ref.dispose();
|
|
767
|
+
}
|
|
768
|
+
}
|
|
769
|
+
async _checkSha1(model, item) {
|
|
770
|
+
if (item.state?.sha1 && this._sha1.computeSHA1(model) && this._sha1.computeSHA1(model) !== item.state.sha1) {
|
|
771
|
+
const result = await this.dialogService.confirm({
|
|
772
|
+
message: ( localize(5685, "The original file has been modified.")),
|
|
773
|
+
detail: ( localize(5686, "Do you want to apply the changes anyway?")),
|
|
774
|
+
});
|
|
775
|
+
if (!result.confirmed) {
|
|
776
|
+
return false;
|
|
777
|
+
}
|
|
778
|
+
}
|
|
779
|
+
return true;
|
|
780
|
+
}
|
|
781
|
+
discard(response, item) {
|
|
782
|
+
if (!response.response.value.includes(item)) {
|
|
783
|
+
return;
|
|
784
|
+
}
|
|
785
|
+
if (item.state?.applied) {
|
|
786
|
+
return;
|
|
787
|
+
}
|
|
788
|
+
response.setEditApplied(item, -1);
|
|
789
|
+
}
|
|
790
|
+
};
|
|
791
|
+
DefaultChatTextEditor = ( __decorate([
|
|
792
|
+
( __param(0, ITextModelService)),
|
|
793
|
+
( __param(1, ICodeEditorService)),
|
|
794
|
+
( __param(2, IDialogService))
|
|
795
|
+
], DefaultChatTextEditor));
|
|
796
|
+
|
|
797
|
+
export { ChatCodeBlockContentProvider, CodeBlockPart, CodeCompareBlockPart, DefaultChatTextEditor, localFileLanguageId, parseLocalFileData };
|