@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,263 @@
|
|
|
1
|
+
|
|
2
|
+
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
|
+
import { IStorageService } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage.service';
|
|
4
|
+
import { ITelemetryService } from '@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/telemetry.service';
|
|
5
|
+
import { IThemeService } from '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/themeService.service';
|
|
6
|
+
import { CancellationTokenSource } from '@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation';
|
|
7
|
+
import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
|
|
8
|
+
import { IContextKeyService } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey.service';
|
|
9
|
+
import { INotebookEditorWorkerService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/services/notebookWorkerService.service';
|
|
10
|
+
import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
|
|
11
|
+
import { createBareFontInfoFromRawSettings } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/config/fontInfoFromSettings';
|
|
12
|
+
import { PixelRatio } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/pixelRatio';
|
|
13
|
+
import { DisposableStore } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
14
|
+
import { EditorPane } from '@codingame/monaco-vscode-api/vscode/vs/workbench/browser/parts/editor/editorPane';
|
|
15
|
+
import { NOTEBOOK_MULTI_DIFF_EDITOR_ID, CellUri } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
|
|
16
|
+
import { FontMeasurements } from '@codingame/monaco-vscode-api/vscode/vs/editor/browser/config/fontMeasurements';
|
|
17
|
+
import { NotebookOptions } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/browser/notebookOptions';
|
|
18
|
+
import { INotebookService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookService.service';
|
|
19
|
+
import { NotebookMultiDiffEditorWidgetInput } from './notebookMultiDiffEditorInput.js';
|
|
20
|
+
import { MultiDiffEditorWidget } from '@codingame/monaco-vscode-api/vscode/vs/editor/browser/widget/multiDiffEditor/multiDiffEditorWidget';
|
|
21
|
+
import { ResourceLabel } from '@codingame/monaco-vscode-api/vscode/vs/workbench/browser/labels';
|
|
22
|
+
import { INotebookDocumentService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/notebook/common/notebookDocumentService.service';
|
|
23
|
+
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
24
|
+
import { Schemas } from '@codingame/monaco-vscode-api/vscode/vs/base/common/network';
|
|
25
|
+
import { getIconClassesForLanguageId } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/services/getIconClasses';
|
|
26
|
+
import { NotebookDiffViewModel } from './notebookDiffViewModel.js';
|
|
27
|
+
import { NotebookDiffEditorEventDispatcher } from './eventDispatcher.js';
|
|
28
|
+
import { NOTEBOOK_DIFF_CELLS_COLLAPSED, NOTEBOOK_DIFF_HAS_UNCHANGED_CELLS, NOTEBOOK_DIFF_UNCHANGED_CELLS_HIDDEN } from './notebookDiffEditorBrowser.js';
|
|
29
|
+
import '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/index';
|
|
30
|
+
import { DiffEditorHeightCalculatorService } from './editorHeightCalculator.js';
|
|
31
|
+
import { autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/reactions/autorun';
|
|
32
|
+
import { transaction } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/transaction';
|
|
33
|
+
|
|
34
|
+
var NotebookMultiTextDiffEditor_1;
|
|
35
|
+
let NotebookMultiTextDiffEditor = class NotebookMultiTextDiffEditor extends EditorPane {
|
|
36
|
+
static { NotebookMultiTextDiffEditor_1 = this; }
|
|
37
|
+
static { this.ID = NOTEBOOK_MULTI_DIFF_EDITOR_ID; }
|
|
38
|
+
get textModel() {
|
|
39
|
+
return this._model?.modified.notebook;
|
|
40
|
+
}
|
|
41
|
+
get notebookOptions() {
|
|
42
|
+
return this._notebookOptions;
|
|
43
|
+
}
|
|
44
|
+
constructor(group, instantiationService, themeService, _parentContextKeyService, notebookEditorWorkerService, configurationService, telemetryService, storageService, notebookService) {
|
|
45
|
+
super(NotebookMultiTextDiffEditor_1.ID, group, telemetryService, themeService, storageService);
|
|
46
|
+
this.instantiationService = instantiationService;
|
|
47
|
+
this._parentContextKeyService = _parentContextKeyService;
|
|
48
|
+
this.notebookEditorWorkerService = notebookEditorWorkerService;
|
|
49
|
+
this.configurationService = configurationService;
|
|
50
|
+
this.notebookService = notebookService;
|
|
51
|
+
this.modelSpecificResources = this._register(( new DisposableStore()));
|
|
52
|
+
this.ctxAllCollapsed = this._parentContextKeyService.createKey(NOTEBOOK_DIFF_CELLS_COLLAPSED.key, false);
|
|
53
|
+
this.ctxHasUnchangedCells = this._parentContextKeyService.createKey(NOTEBOOK_DIFF_HAS_UNCHANGED_CELLS.key, false);
|
|
54
|
+
this.ctxHiddenUnchangedCells = this._parentContextKeyService.createKey(NOTEBOOK_DIFF_UNCHANGED_CELLS_HIDDEN.key, true);
|
|
55
|
+
this._notebookOptions = instantiationService.createInstance(NotebookOptions, this.window, false, undefined);
|
|
56
|
+
this._register(this._notebookOptions);
|
|
57
|
+
}
|
|
58
|
+
get fontInfo() {
|
|
59
|
+
if (!this._fontInfo) {
|
|
60
|
+
this._fontInfo = this.createFontInfo();
|
|
61
|
+
}
|
|
62
|
+
return this._fontInfo;
|
|
63
|
+
}
|
|
64
|
+
layout(dimension, position) {
|
|
65
|
+
this._multiDiffEditorWidget.layout(dimension);
|
|
66
|
+
}
|
|
67
|
+
createFontInfo() {
|
|
68
|
+
const editorOptions = this.configurationService.getValue('editor');
|
|
69
|
+
return FontMeasurements.readFontInfo(this.window, createBareFontInfoFromRawSettings(editorOptions, PixelRatio.getInstance(this.window).value));
|
|
70
|
+
}
|
|
71
|
+
createEditor(parent) {
|
|
72
|
+
this._multiDiffEditorWidget = this._register(this.instantiationService.createInstance(MultiDiffEditorWidget, parent, this.instantiationService.createInstance(WorkbenchUIElementFactory)));
|
|
73
|
+
this._register(this._multiDiffEditorWidget.onDidChangeActiveControl(() => {
|
|
74
|
+
this._onDidChangeControl.fire();
|
|
75
|
+
}));
|
|
76
|
+
}
|
|
77
|
+
async setInput(input, options, context, token) {
|
|
78
|
+
super.setInput(input, options, context, token);
|
|
79
|
+
const model = await input.resolve();
|
|
80
|
+
if (this._model !== model) {
|
|
81
|
+
this._detachModel();
|
|
82
|
+
this._model = model;
|
|
83
|
+
}
|
|
84
|
+
const eventDispatcher = this.modelSpecificResources.add(( new NotebookDiffEditorEventDispatcher()));
|
|
85
|
+
const diffEditorHeightCalculator = this.instantiationService.createInstance(DiffEditorHeightCalculatorService, this.fontInfo.lineHeight);
|
|
86
|
+
this.viewModel = this.modelSpecificResources.add(( new NotebookDiffViewModel(
|
|
87
|
+
model,
|
|
88
|
+
this.notebookEditorWorkerService,
|
|
89
|
+
this.configurationService,
|
|
90
|
+
eventDispatcher,
|
|
91
|
+
this.notebookService,
|
|
92
|
+
diffEditorHeightCalculator,
|
|
93
|
+
undefined,
|
|
94
|
+
true
|
|
95
|
+
)));
|
|
96
|
+
await this.viewModel.computeDiff(this.modelSpecificResources.add(( new CancellationTokenSource())).token);
|
|
97
|
+
this.ctxHasUnchangedCells.set(this.viewModel.hasUnchangedCells);
|
|
98
|
+
this.ctxHasUnchangedCells.set(this.viewModel.hasUnchangedCells);
|
|
99
|
+
const widgetInput = this.modelSpecificResources.add(NotebookMultiDiffEditorWidgetInput.createInput(this.viewModel, this.instantiationService));
|
|
100
|
+
this.widgetViewModel = this.modelSpecificResources.add(await widgetInput.getViewModel());
|
|
101
|
+
const itemsWeHaveSeen = ( new WeakSet());
|
|
102
|
+
this.modelSpecificResources.add(autorun(reader => {
|
|
103
|
+
if (!this.widgetViewModel || !this.viewModel) {
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
const items = this.widgetViewModel.items.read(reader);
|
|
107
|
+
const diffItems = this.viewModel.value;
|
|
108
|
+
if (items.length !== diffItems.length) {
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
transaction((tx) => {
|
|
112
|
+
items.forEach(item => {
|
|
113
|
+
if (( itemsWeHaveSeen.has(item))) {
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
itemsWeHaveSeen.add(item);
|
|
117
|
+
const diffItem = diffItems.find(d => d.modifiedUri?.toString() === item.modifiedUri?.toString() && d.originalUri?.toString() === item.originalUri?.toString());
|
|
118
|
+
if (diffItem && diffItem.type === 'unchanged') {
|
|
119
|
+
item.collapsed.set(true, tx);
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
});
|
|
123
|
+
}));
|
|
124
|
+
this._multiDiffEditorWidget.setViewModel(this.widgetViewModel);
|
|
125
|
+
}
|
|
126
|
+
_detachModel() {
|
|
127
|
+
this.viewModel = undefined;
|
|
128
|
+
this.modelSpecificResources.clear();
|
|
129
|
+
}
|
|
130
|
+
_generateFontFamily() {
|
|
131
|
+
return this.fontInfo.fontFamily ?? `"SF Mono", Monaco, Menlo, Consolas, "Ubuntu Mono", "Liberation Mono", "DejaVu Sans Mono", "Courier New", monospace`;
|
|
132
|
+
}
|
|
133
|
+
setOptions(options) {
|
|
134
|
+
super.setOptions(options);
|
|
135
|
+
}
|
|
136
|
+
getControl() {
|
|
137
|
+
return this._multiDiffEditorWidget.getActiveControl();
|
|
138
|
+
}
|
|
139
|
+
focus() {
|
|
140
|
+
super.focus();
|
|
141
|
+
this._multiDiffEditorWidget?.getActiveControl()?.focus();
|
|
142
|
+
}
|
|
143
|
+
hasFocus() {
|
|
144
|
+
return this._multiDiffEditorWidget?.getActiveControl()?.hasTextFocus() || super.hasFocus();
|
|
145
|
+
}
|
|
146
|
+
clearInput() {
|
|
147
|
+
super.clearInput();
|
|
148
|
+
this._multiDiffEditorWidget.setViewModel(undefined);
|
|
149
|
+
this.modelSpecificResources.clear();
|
|
150
|
+
this.viewModel = undefined;
|
|
151
|
+
this.widgetViewModel = undefined;
|
|
152
|
+
}
|
|
153
|
+
expandAll() {
|
|
154
|
+
if (this.widgetViewModel) {
|
|
155
|
+
this.widgetViewModel.expandAll();
|
|
156
|
+
this.ctxAllCollapsed.set(false);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
collapseAll() {
|
|
160
|
+
if (this.widgetViewModel) {
|
|
161
|
+
this.widgetViewModel.collapseAll();
|
|
162
|
+
this.ctxAllCollapsed.set(true);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
hideUnchanged() {
|
|
166
|
+
if (this.viewModel) {
|
|
167
|
+
this.viewModel.includeUnchanged = false;
|
|
168
|
+
this.ctxHiddenUnchangedCells.set(true);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
showUnchanged() {
|
|
172
|
+
if (this.viewModel) {
|
|
173
|
+
this.viewModel.includeUnchanged = true;
|
|
174
|
+
this.ctxHiddenUnchangedCells.set(false);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
getDiffElementViewModel(uri) {
|
|
178
|
+
if (uri.scheme === Schemas.vscodeNotebookCellOutput || uri.scheme === Schemas.vscodeNotebookCellOutputDiff ||
|
|
179
|
+
uri.scheme === Schemas.vscodeNotebookCellMetadata || uri.scheme === Schemas.vscodeNotebookCellMetadataDiff) {
|
|
180
|
+
const data = CellUri.parseCellPropertyUri(uri, uri.scheme);
|
|
181
|
+
if (data) {
|
|
182
|
+
uri = CellUri.generate(data.notebook, data.handle);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
if (uri.scheme === Schemas.vscodeNotebookMetadata) {
|
|
186
|
+
return this.viewModel?.items.find(item => item.type === 'modifiedMetadata' ||
|
|
187
|
+
item.type === 'unchangedMetadata');
|
|
188
|
+
}
|
|
189
|
+
return this.viewModel?.items.find(c => {
|
|
190
|
+
switch (c.type) {
|
|
191
|
+
case 'delete':
|
|
192
|
+
return c.original?.uri.toString() === ( uri.toString());
|
|
193
|
+
case 'insert':
|
|
194
|
+
return c.modified?.uri.toString() === ( uri.toString());
|
|
195
|
+
case 'modified':
|
|
196
|
+
case 'unchanged':
|
|
197
|
+
return c.modified?.uri.toString() === ( uri.toString()) || c.original?.uri.toString() === ( uri.toString());
|
|
198
|
+
default:
|
|
199
|
+
return;
|
|
200
|
+
}
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
};
|
|
204
|
+
NotebookMultiTextDiffEditor = NotebookMultiTextDiffEditor_1 = ( __decorate([
|
|
205
|
+
( __param(1, IInstantiationService)),
|
|
206
|
+
( __param(2, IThemeService)),
|
|
207
|
+
( __param(3, IContextKeyService)),
|
|
208
|
+
( __param(4, INotebookEditorWorkerService)),
|
|
209
|
+
( __param(5, IConfigurationService)),
|
|
210
|
+
( __param(6, ITelemetryService)),
|
|
211
|
+
( __param(7, IStorageService)),
|
|
212
|
+
( __param(8, INotebookService))
|
|
213
|
+
], NotebookMultiTextDiffEditor));
|
|
214
|
+
let WorkbenchUIElementFactory = class WorkbenchUIElementFactory {
|
|
215
|
+
constructor(_instantiationService, notebookDocumentService, notebookService) {
|
|
216
|
+
this._instantiationService = _instantiationService;
|
|
217
|
+
this.notebookDocumentService = notebookDocumentService;
|
|
218
|
+
this.notebookService = notebookService;
|
|
219
|
+
}
|
|
220
|
+
createResourceLabel(element) {
|
|
221
|
+
const label = this._instantiationService.createInstance(ResourceLabel, element, {});
|
|
222
|
+
const that = this;
|
|
223
|
+
return {
|
|
224
|
+
setUri(uri, options = {}) {
|
|
225
|
+
if (!uri) {
|
|
226
|
+
label.element.clear();
|
|
227
|
+
}
|
|
228
|
+
else {
|
|
229
|
+
let name = '';
|
|
230
|
+
let description = '';
|
|
231
|
+
let extraClasses = undefined;
|
|
232
|
+
if (uri.scheme === Schemas.vscodeNotebookCell) {
|
|
233
|
+
const notebookDocument = uri.scheme === Schemas.vscodeNotebookCell ? that.notebookDocumentService.getNotebook(uri) : undefined;
|
|
234
|
+
const cellIndex = Schemas.vscodeNotebookCell ? that.notebookDocumentService.getNotebook(uri)?.getCellIndex(uri) : undefined;
|
|
235
|
+
if (notebookDocument && cellIndex !== undefined) {
|
|
236
|
+
name = ( localize(9475, "Cell {0}", `${cellIndex + 1}`));
|
|
237
|
+
const nb = notebookDocument ? that.notebookService.getNotebookTextModel(notebookDocument?.uri) : undefined;
|
|
238
|
+
const cellLanguage = nb && cellIndex !== undefined ? nb.cells[cellIndex].language : undefined;
|
|
239
|
+
extraClasses = cellLanguage ? getIconClassesForLanguageId(cellLanguage) : undefined;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
else if (uri.scheme === Schemas.vscodeNotebookCellMetadata || uri.scheme === Schemas.vscodeNotebookCellMetadataDiff) {
|
|
243
|
+
description = ( localize(9476, "Metadata"));
|
|
244
|
+
}
|
|
245
|
+
else if (uri.scheme === Schemas.vscodeNotebookCellOutput || uri.scheme === Schemas.vscodeNotebookCellOutputDiff) {
|
|
246
|
+
description = ( localize(9477, "Output"));
|
|
247
|
+
}
|
|
248
|
+
label.element.setResource({ name, description }, { strikethrough: options.strikethrough, forceLabel: true, hideIcon: !extraClasses, extraClasses });
|
|
249
|
+
}
|
|
250
|
+
},
|
|
251
|
+
dispose() {
|
|
252
|
+
label.dispose();
|
|
253
|
+
}
|
|
254
|
+
};
|
|
255
|
+
}
|
|
256
|
+
};
|
|
257
|
+
WorkbenchUIElementFactory = ( __decorate([
|
|
258
|
+
( __param(0, IInstantiationService)),
|
|
259
|
+
( __param(1, INotebookDocumentService)),
|
|
260
|
+
( __param(2, INotebookService))
|
|
261
|
+
], WorkbenchUIElementFactory));
|
|
262
|
+
|
|
263
|
+
export { NotebookMultiTextDiffEditor };
|
package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookMultiDiffEditorInput.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { URI } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri";
|
|
2
|
+
import { ITextModelService } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/services/resolverService.service";
|
|
3
|
+
import { ITextResourceConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/services/textResourceConfiguration.service";
|
|
4
|
+
import { IInstantiationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation";
|
|
5
|
+
import { MultiDiffEditorInput } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/multiDiffEditor/browser/multiDiffEditorInput";
|
|
6
|
+
import { IResolvedMultiDiffSource, type IMultiDiffSourceResolver } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/multiDiffEditor/browser/multiDiffSourceResolverService";
|
|
7
|
+
import { IMultiDiffSourceResolverService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/multiDiffEditor/browser/multiDiffSourceResolverService.service";
|
|
8
|
+
import { NotebookDiffViewModel } from "./notebookDiffViewModel.js";
|
|
9
|
+
import { NotebookDiffEditorInput } from "../../common/notebookDiffEditorInput.js";
|
|
10
|
+
import { ITextFileService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/textfile/common/textfiles.service";
|
|
11
|
+
export declare const NotebookMultiDiffEditorScheme = "multi-cell-notebook-diff-editor";
|
|
12
|
+
export declare class NotebookMultiDiffEditorInput extends NotebookDiffEditorInput {
|
|
13
|
+
static readonly ID: string;
|
|
14
|
+
static create(instantiationService: IInstantiationService, resource: URI, name: string | undefined, description: string | undefined, originalResource: URI, viewType: string): NotebookMultiDiffEditorInput;
|
|
15
|
+
}
|
|
16
|
+
export declare class NotebookMultiDiffEditorWidgetInput extends MultiDiffEditorInput implements IMultiDiffSourceResolver {
|
|
17
|
+
private readonly notebookDiffViewModel;
|
|
18
|
+
static createInput(notebookDiffViewModel: NotebookDiffViewModel, instantiationService: IInstantiationService): NotebookMultiDiffEditorWidgetInput;
|
|
19
|
+
constructor(multiDiffSource: URI, notebookDiffViewModel: NotebookDiffViewModel, _textModelService: ITextModelService, _textResourceConfigurationService: ITextResourceConfigurationService, _instantiationService: IInstantiationService, _multiDiffSourceResolverService: IMultiDiffSourceResolverService, _textFileService: ITextFileService);
|
|
20
|
+
canHandleUri(uri: URI): boolean;
|
|
21
|
+
resolveDiffSource(_: URI): Promise<IResolvedMultiDiffSource>;
|
|
22
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
|
|
2
|
+
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
|
+
import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
|
|
4
|
+
import { ITextModelService } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/services/resolverService.service';
|
|
5
|
+
import { ITextResourceConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/services/textResourceConfiguration.service';
|
|
6
|
+
import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
|
|
7
|
+
import { MultiDiffEditorInput } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/multiDiffEditor/browser/multiDiffEditorInput';
|
|
8
|
+
import { IMultiDiffSourceResolverService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/multiDiffEditor/browser/multiDiffSourceResolverService.service';
|
|
9
|
+
import { NotebookDiffEditorInput } from '../../common/notebookDiffEditorInput.js';
|
|
10
|
+
import { NotebookEditorInput } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookEditorInput';
|
|
11
|
+
import { ITextFileService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/textfile/common/textfiles.service';
|
|
12
|
+
|
|
13
|
+
var NotebookMultiDiffEditorWidgetInput_1;
|
|
14
|
+
const NotebookMultiDiffEditorScheme = 'multi-cell-notebook-diff-editor';
|
|
15
|
+
class NotebookMultiDiffEditorInput extends NotebookDiffEditorInput {
|
|
16
|
+
static { this.ID = 'workbench.input.multiDiffNotebookInput'; }
|
|
17
|
+
static create(instantiationService, resource, name, description, originalResource, viewType) {
|
|
18
|
+
const original = NotebookEditorInput.getOrCreate(instantiationService, originalResource, undefined, viewType);
|
|
19
|
+
const modified = NotebookEditorInput.getOrCreate(instantiationService, resource, undefined, viewType);
|
|
20
|
+
return instantiationService.createInstance(NotebookMultiDiffEditorInput, name, description, original, modified, viewType);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
let NotebookMultiDiffEditorWidgetInput = NotebookMultiDiffEditorWidgetInput_1 = class NotebookMultiDiffEditorWidgetInput extends MultiDiffEditorInput {
|
|
24
|
+
static createInput(notebookDiffViewModel, instantiationService) {
|
|
25
|
+
const multiDiffSource = ( URI.parse(`${NotebookMultiDiffEditorScheme}:${( ( new Date()).getMilliseconds().toString()) + ( Math.random().toString())}`));
|
|
26
|
+
return instantiationService.createInstance(NotebookMultiDiffEditorWidgetInput_1, multiDiffSource, notebookDiffViewModel);
|
|
27
|
+
}
|
|
28
|
+
constructor(multiDiffSource, notebookDiffViewModel, _textModelService, _textResourceConfigurationService, _instantiationService, _multiDiffSourceResolverService, _textFileService) {
|
|
29
|
+
super(multiDiffSource, undefined, undefined, true, _textModelService, _textResourceConfigurationService, _instantiationService, _multiDiffSourceResolverService, _textFileService);
|
|
30
|
+
this.notebookDiffViewModel = notebookDiffViewModel;
|
|
31
|
+
this._register(_multiDiffSourceResolverService.registerResolver(this));
|
|
32
|
+
}
|
|
33
|
+
canHandleUri(uri) {
|
|
34
|
+
return ( uri.toString()) === ( this.multiDiffSource.toString());
|
|
35
|
+
}
|
|
36
|
+
async resolveDiffSource(_) {
|
|
37
|
+
return { resources: this.notebookDiffViewModel };
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
NotebookMultiDiffEditorWidgetInput = NotebookMultiDiffEditorWidgetInput_1 = ( __decorate([
|
|
41
|
+
( __param(2, ITextModelService)),
|
|
42
|
+
( __param(3, ITextResourceConfigurationService)),
|
|
43
|
+
( __param(4, IInstantiationService)),
|
|
44
|
+
( __param(5, IMultiDiffSourceResolverService)),
|
|
45
|
+
( __param(6, ITextFileService))
|
|
46
|
+
], NotebookMultiDiffEditorWidgetInput));
|
|
47
|
+
|
|
48
|
+
export { NotebookMultiDiffEditorInput, NotebookMultiDiffEditorScheme, NotebookMultiDiffEditorWidgetInput };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Event } from "@codingame/monaco-vscode-api/vscode/vs/base/common/event";
|
|
2
|
+
import { IDisposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
|
|
3
|
+
import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service";
|
|
4
|
+
export type UnchangedEditorRegionOptions = {
|
|
5
|
+
options: {
|
|
6
|
+
enabled: boolean;
|
|
7
|
+
contextLineCount: number;
|
|
8
|
+
minimumLineCount: number;
|
|
9
|
+
revealLineCount: number;
|
|
10
|
+
};
|
|
11
|
+
readonly onDidChangeEnablement: Event<boolean>;
|
|
12
|
+
};
|
|
13
|
+
export declare function getUnchangedRegionSettings(configurationService: IConfigurationService): (Readonly<UnchangedEditorRegionOptions> & IDisposable);
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
|
|
2
|
+
import { Emitter } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
|
|
3
|
+
import { DisposableStore } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
4
|
+
|
|
5
|
+
function getUnchangedRegionSettings(configurationService) {
|
|
6
|
+
return createHideUnchangedRegionOptions(configurationService);
|
|
7
|
+
}
|
|
8
|
+
function createHideUnchangedRegionOptions(configurationService) {
|
|
9
|
+
const disposables = ( new DisposableStore());
|
|
10
|
+
const unchangedRegionsEnablementEmitter = disposables.add(( new Emitter()));
|
|
11
|
+
const result = {
|
|
12
|
+
options: {
|
|
13
|
+
enabled: configurationService.getValue('diffEditor.hideUnchangedRegions.enabled'),
|
|
14
|
+
minimumLineCount: configurationService.getValue('diffEditor.hideUnchangedRegions.minimumLineCount'),
|
|
15
|
+
contextLineCount: configurationService.getValue('diffEditor.hideUnchangedRegions.contextLineCount'),
|
|
16
|
+
revealLineCount: configurationService.getValue('diffEditor.hideUnchangedRegions.revealLineCount'),
|
|
17
|
+
},
|
|
18
|
+
onDidChangeEnablement: unchangedRegionsEnablementEmitter.event.bind(unchangedRegionsEnablementEmitter),
|
|
19
|
+
dispose: () => disposables.dispose()
|
|
20
|
+
};
|
|
21
|
+
disposables.add(configurationService.onDidChangeConfiguration(e => {
|
|
22
|
+
if (e.affectsConfiguration('diffEditor.hideUnchangedRegions.minimumLineCount')) {
|
|
23
|
+
result.options.minimumLineCount = configurationService.getValue('diffEditor.hideUnchangedRegions.minimumLineCount');
|
|
24
|
+
}
|
|
25
|
+
if (e.affectsConfiguration('diffEditor.hideUnchangedRegions.contextLineCount')) {
|
|
26
|
+
result.options.contextLineCount = configurationService.getValue('diffEditor.hideUnchangedRegions.contextLineCount');
|
|
27
|
+
}
|
|
28
|
+
if (e.affectsConfiguration('diffEditor.hideUnchangedRegions.revealLineCount')) {
|
|
29
|
+
result.options.revealLineCount = configurationService.getValue('diffEditor.hideUnchangedRegions.revealLineCount');
|
|
30
|
+
}
|
|
31
|
+
if (e.affectsConfiguration('diffEditor.hideUnchangedRegions.enabled')) {
|
|
32
|
+
result.options.enabled = configurationService.getValue('diffEditor.hideUnchangedRegions.enabled');
|
|
33
|
+
unchangedRegionsEnablementEmitter.fire(result.options.enabled);
|
|
34
|
+
}
|
|
35
|
+
}));
|
|
36
|
+
return result;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export { getUnchangedRegionSettings };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { INotebookDocumentMetadataTextModel, INotebookTextModel, NotebookDocumentMetadata, TransientDocumentMetadata } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookCommon";
|
|
2
|
+
import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
|
|
3
|
+
import { URI } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri";
|
|
4
|
+
import { ITextBuffer } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/model";
|
|
5
|
+
export declare function getFormattedNotebookMetadataJSON(transientMetadata: TransientDocumentMetadata | undefined, metadata: NotebookDocumentMetadata): string;
|
|
6
|
+
export declare class NotebookDocumentMetadataTextModel extends Disposable implements INotebookDocumentMetadataTextModel {
|
|
7
|
+
readonly notebookModel: INotebookTextModel;
|
|
8
|
+
readonly uri: URI;
|
|
9
|
+
get metadata(): NotebookDocumentMetadata;
|
|
10
|
+
private readonly _onDidChange;
|
|
11
|
+
readonly onDidChange: import("@codingame/monaco-vscode-api/vscode/vs/base/common/event").Event<void>;
|
|
12
|
+
private _textBufferHash;
|
|
13
|
+
private _textBuffer?;
|
|
14
|
+
get textBuffer(): ITextBuffer;
|
|
15
|
+
constructor(notebookModel: INotebookTextModel);
|
|
16
|
+
getHash(): string;
|
|
17
|
+
getValue(): string;
|
|
18
|
+
private getFullModelRange;
|
|
19
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
|
|
2
|
+
import { toFormattedString } from '@codingame/monaco-vscode-api/vscode/vs/base/common/jsonFormatter';
|
|
3
|
+
import { NotebookMetadataUri, NotebookCellsChangeType } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
|
|
4
|
+
import { StringSHA1 } from '@codingame/monaco-vscode-api/vscode/vs/base/common/hash';
|
|
5
|
+
import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
6
|
+
import { DefaultEndOfLine, EndOfLinePreference } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/model';
|
|
7
|
+
import { Emitter } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
|
|
8
|
+
import { Range } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/core/range';
|
|
9
|
+
import { createTextBuffer } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/model/textModel';
|
|
10
|
+
|
|
11
|
+
function getFormattedNotebookMetadataJSON(transientMetadata, metadata) {
|
|
12
|
+
let filteredMetadata = {};
|
|
13
|
+
if (transientMetadata) {
|
|
14
|
+
const keys = ( new Set([...( Object.keys(metadata))]));
|
|
15
|
+
for (const key of keys) {
|
|
16
|
+
if (!(transientMetadata[key])) {
|
|
17
|
+
filteredMetadata[key] = metadata[key];
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
filteredMetadata = metadata;
|
|
23
|
+
}
|
|
24
|
+
const metadataSource = toFormattedString(filteredMetadata, {});
|
|
25
|
+
return metadataSource;
|
|
26
|
+
}
|
|
27
|
+
class NotebookDocumentMetadataTextModel extends Disposable {
|
|
28
|
+
get metadata() {
|
|
29
|
+
return this.notebookModel.metadata;
|
|
30
|
+
}
|
|
31
|
+
get textBuffer() {
|
|
32
|
+
if (this._textBuffer) {
|
|
33
|
+
return this._textBuffer;
|
|
34
|
+
}
|
|
35
|
+
const source = getFormattedNotebookMetadataJSON(this.notebookModel.transientOptions.transientDocumentMetadata, this.metadata);
|
|
36
|
+
this._textBuffer = this._register(createTextBuffer(source, DefaultEndOfLine.LF).textBuffer);
|
|
37
|
+
this._register(this._textBuffer.onDidChangeContent(() => {
|
|
38
|
+
this._onDidChange.fire();
|
|
39
|
+
}));
|
|
40
|
+
return this._textBuffer;
|
|
41
|
+
}
|
|
42
|
+
constructor(notebookModel) {
|
|
43
|
+
super();
|
|
44
|
+
this.notebookModel = notebookModel;
|
|
45
|
+
this._onDidChange = this._register(( new Emitter()));
|
|
46
|
+
this.onDidChange = this._onDidChange.event;
|
|
47
|
+
this._textBufferHash = null;
|
|
48
|
+
this.uri = NotebookMetadataUri.generate(this.notebookModel.uri);
|
|
49
|
+
this._register(this.notebookModel.onDidChangeContent((e) => {
|
|
50
|
+
if (( e.rawEvents.some(
|
|
51
|
+
event => event.kind === NotebookCellsChangeType.ChangeDocumentMetadata || event.kind === NotebookCellsChangeType.ModelChange
|
|
52
|
+
))) {
|
|
53
|
+
this._textBuffer?.dispose();
|
|
54
|
+
this._textBuffer = undefined;
|
|
55
|
+
this._textBufferHash = null;
|
|
56
|
+
this._onDidChange.fire();
|
|
57
|
+
}
|
|
58
|
+
}));
|
|
59
|
+
}
|
|
60
|
+
getHash() {
|
|
61
|
+
if (this._textBufferHash !== null) {
|
|
62
|
+
return this._textBufferHash;
|
|
63
|
+
}
|
|
64
|
+
const shaComputer = ( new StringSHA1());
|
|
65
|
+
const snapshot = this.textBuffer.createSnapshot(false);
|
|
66
|
+
let text;
|
|
67
|
+
while ((text = snapshot.read())) {
|
|
68
|
+
shaComputer.update(text);
|
|
69
|
+
}
|
|
70
|
+
this._textBufferHash = shaComputer.digest();
|
|
71
|
+
return this._textBufferHash;
|
|
72
|
+
}
|
|
73
|
+
getValue() {
|
|
74
|
+
const fullRange = this.getFullModelRange();
|
|
75
|
+
const eol = this.textBuffer.getEOL();
|
|
76
|
+
if (eol === '\n') {
|
|
77
|
+
return this.textBuffer.getValueInRange(fullRange, EndOfLinePreference.LF);
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
return this.textBuffer.getValueInRange(fullRange, EndOfLinePreference.CRLF);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
getFullModelRange() {
|
|
84
|
+
const lineCount = this.textBuffer.getLineCount();
|
|
85
|
+
return ( new Range(1, 1, lineCount, this.textBuffer.getLineLength(lineCount) + 1));
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export { NotebookDocumentMetadataTextModel, getFormattedNotebookMetadataJSON };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { CellKind, INotebookDiffResult } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookCommon";
|
|
2
|
+
export type CellDiffInfo = {
|
|
3
|
+
originalCellIndex: number;
|
|
4
|
+
modifiedCellIndex: number;
|
|
5
|
+
type: "unchanged" | "modified";
|
|
6
|
+
} | {
|
|
7
|
+
originalCellIndex: number;
|
|
8
|
+
type: "delete";
|
|
9
|
+
} | {
|
|
10
|
+
modifiedCellIndex: number;
|
|
11
|
+
type: "insert";
|
|
12
|
+
};
|
|
13
|
+
interface ICell {
|
|
14
|
+
cellKind: CellKind;
|
|
15
|
+
getHashValue(): number;
|
|
16
|
+
equal(cell: ICell): boolean;
|
|
17
|
+
}
|
|
18
|
+
export declare function computeDiff(originalModel: {
|
|
19
|
+
readonly cells: readonly ICell[];
|
|
20
|
+
}, modifiedModel: {
|
|
21
|
+
readonly cells: readonly ICell[];
|
|
22
|
+
}, diffResult: INotebookDiffResult): {
|
|
23
|
+
cellDiffInfo: CellDiffInfo[];
|
|
24
|
+
firstChangeIndex: number;
|
|
25
|
+
};
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
function computeDiff(originalModel, modifiedModel, diffResult) {
|
|
4
|
+
const cellChanges = diffResult.cellsDiff.changes;
|
|
5
|
+
const cellDiffInfo = [];
|
|
6
|
+
let originalCellIndex = 0;
|
|
7
|
+
let modifiedCellIndex = 0;
|
|
8
|
+
let firstChangeIndex = -1;
|
|
9
|
+
for (let i = 0; i < cellChanges.length; i++) {
|
|
10
|
+
const change = cellChanges[i];
|
|
11
|
+
for (let j = 0; j < change.originalStart - originalCellIndex; j++) {
|
|
12
|
+
const originalCell = originalModel.cells[originalCellIndex + j];
|
|
13
|
+
const modifiedCell = modifiedModel.cells[modifiedCellIndex + j];
|
|
14
|
+
if (originalCell.getHashValue() === modifiedCell.getHashValue()) {
|
|
15
|
+
cellDiffInfo.push({
|
|
16
|
+
originalCellIndex: originalCellIndex + j,
|
|
17
|
+
modifiedCellIndex: modifiedCellIndex + j,
|
|
18
|
+
type: 'unchanged'
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
if (firstChangeIndex === -1) {
|
|
23
|
+
firstChangeIndex = cellDiffInfo.length;
|
|
24
|
+
}
|
|
25
|
+
cellDiffInfo.push({
|
|
26
|
+
originalCellIndex: originalCellIndex + j,
|
|
27
|
+
modifiedCellIndex: modifiedCellIndex + j,
|
|
28
|
+
type: 'modified'
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
const modifiedLCS = computeModifiedLCS(change, originalModel, modifiedModel);
|
|
33
|
+
if (modifiedLCS.length && firstChangeIndex === -1) {
|
|
34
|
+
firstChangeIndex = cellDiffInfo.length;
|
|
35
|
+
}
|
|
36
|
+
cellDiffInfo.push(...modifiedLCS);
|
|
37
|
+
originalCellIndex = change.originalStart + change.originalLength;
|
|
38
|
+
modifiedCellIndex = change.modifiedStart + change.modifiedLength;
|
|
39
|
+
}
|
|
40
|
+
for (let i = originalCellIndex; i < originalModel.cells.length; i++) {
|
|
41
|
+
cellDiffInfo.push({
|
|
42
|
+
originalCellIndex: i,
|
|
43
|
+
modifiedCellIndex: i - originalCellIndex + modifiedCellIndex,
|
|
44
|
+
type: 'unchanged'
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
return {
|
|
48
|
+
cellDiffInfo,
|
|
49
|
+
firstChangeIndex
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
function computeModifiedLCS(change, originalModel, modifiedModel) {
|
|
53
|
+
const result = [];
|
|
54
|
+
const modifiedLen = Math.min(change.originalLength, change.modifiedLength);
|
|
55
|
+
for (let j = 0; j < modifiedLen; j++) {
|
|
56
|
+
const originalCell = originalModel.cells[change.originalStart + j];
|
|
57
|
+
const modifiedCell = modifiedModel.cells[change.modifiedStart + j];
|
|
58
|
+
if (originalCell.cellKind !== modifiedCell.cellKind) {
|
|
59
|
+
result.push({
|
|
60
|
+
originalCellIndex: change.originalStart + j,
|
|
61
|
+
type: 'delete'
|
|
62
|
+
});
|
|
63
|
+
result.push({
|
|
64
|
+
modifiedCellIndex: change.modifiedStart + j,
|
|
65
|
+
type: 'insert'
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
const isTheSame = originalCell.equal(modifiedCell);
|
|
70
|
+
result.push({
|
|
71
|
+
originalCellIndex: change.originalStart + j,
|
|
72
|
+
modifiedCellIndex: change.modifiedStart + j,
|
|
73
|
+
type: isTheSame ? 'unchanged' : 'modified'
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
for (let j = modifiedLen; j < change.originalLength; j++) {
|
|
78
|
+
result.push({
|
|
79
|
+
originalCellIndex: change.originalStart + j,
|
|
80
|
+
type: 'delete'
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
for (let j = modifiedLen; j < change.modifiedLength; j++) {
|
|
84
|
+
result.push({
|
|
85
|
+
modifiedCellIndex: change.modifiedStart + j,
|
|
86
|
+
type: 'insert'
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
return result;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export { computeDiff };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { IResourceDiffEditorInput, IResourceSideBySideEditorInput, IUntypedEditorInput } from "@codingame/monaco-vscode-api/vscode/vs/workbench/common/editor";
|
|
2
|
+
import { EditorInput } from "@codingame/monaco-vscode-api/vscode/vs/workbench/common/editor/editorInput";
|
|
3
|
+
import { EditorModel } from "@codingame/monaco-vscode-api/vscode/vs/workbench/common/editor/editorModel";
|
|
4
|
+
import { URI } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri";
|
|
5
|
+
import { IInstantiationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation";
|
|
6
|
+
import { INotebookDiffEditorModel, IResolvedNotebookEditorModel } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookCommon";
|
|
7
|
+
import { DiffEditorInput } from "@codingame/monaco-vscode-api/vscode/vs/workbench/common/editor/diffEditorInput";
|
|
8
|
+
import { NotebookEditorInput } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookEditorInput";
|
|
9
|
+
import { IEditorService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service";
|
|
10
|
+
declare class NotebookDiffEditorModel extends EditorModel implements INotebookDiffEditorModel {
|
|
11
|
+
readonly original: IResolvedNotebookEditorModel;
|
|
12
|
+
readonly modified: IResolvedNotebookEditorModel;
|
|
13
|
+
constructor(original: IResolvedNotebookEditorModel, modified: IResolvedNotebookEditorModel);
|
|
14
|
+
}
|
|
15
|
+
export declare class NotebookDiffEditorInput extends DiffEditorInput {
|
|
16
|
+
readonly original: NotebookEditorInput;
|
|
17
|
+
readonly modified: NotebookEditorInput;
|
|
18
|
+
readonly viewType: string;
|
|
19
|
+
static create(instantiationService: IInstantiationService, resource: URI, name: string | undefined, description: string | undefined, originalResource: URI, viewType: string): NotebookDiffEditorInput;
|
|
20
|
+
static readonly ID: string;
|
|
21
|
+
private _modifiedTextModel;
|
|
22
|
+
private _originalTextModel;
|
|
23
|
+
get resource(): URI;
|
|
24
|
+
get editorId(): string;
|
|
25
|
+
private _cachedModel;
|
|
26
|
+
constructor(name: string | undefined, description: string | undefined, original: NotebookEditorInput, modified: NotebookEditorInput, viewType: string, editorService: IEditorService);
|
|
27
|
+
get typeId(): string;
|
|
28
|
+
resolve(): Promise<NotebookDiffEditorModel>;
|
|
29
|
+
toUntyped(): IResourceDiffEditorInput & IResourceSideBySideEditorInput;
|
|
30
|
+
matches(otherInput: EditorInput | IUntypedEditorInput): boolean;
|
|
31
|
+
dispose(): void;
|
|
32
|
+
}
|
|
33
|
+
export {};
|