@codingame/monaco-vscode-katex-common 25.1.1 → 26.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/vscode/src/vs/platform/actionWidget/browser/actionWidgetDropdown.d.ts +23 -2
- package/vscode/src/vs/platform/actionWidget/browser/actionWidgetDropdown.js +64 -27
- package/vscode/src/vs/platform/actions/browser/actionWidgetDropdownActionViewItem.d.ts +3 -1
- package/vscode/src/vs/platform/actions/browser/actionWidgetDropdownActionViewItem.js +31 -28
- package/vscode/src/vs/platform/actions/browser/buttonbar.d.ts +2 -0
- package/vscode/src/vs/platform/actions/browser/buttonbar.js +71 -50
- package/vscode/src/vs/platform/editor/browser/editor.js +17 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatAccessibilityProvider.js +112 -129
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContinueInAction.d.ts +10 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContinueInAction.js +110 -85
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatElicitationActions.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatExecuteActions.d.ts +21 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatExecuteActions.js +308 -216
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatTitleActions.js +153 -148
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionHoverWidget.d.ts +27 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionHoverWidget.js +247 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsControl.d.ts +71 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsControl.js +347 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsFilter.d.ts +44 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsFilter.js +287 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsOpener.d.ts +20 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsOpener.js +89 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsViewer.d.ts +188 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsViewer.js +677 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/media/agentSessionHoverWidget.css +98 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/media/agentsessionsviewer.css +263 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentModel.js +34 -25
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentWidgets.d.ts +19 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentWidgets.js +762 -359
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatImplicitContext.d.ts +22 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatImplicitContext.js +188 -99
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/implicitContextAttachment.d.ts +9 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/implicitContextAttachment.js +166 -113
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingActions.d.ts +12 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingActions.js +279 -213
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.d.ts +46 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.js +533 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.d.ts +28 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.js +382 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationWidget.d.ts +101 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationWidget.js +509 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/media/chatEditingEditorOverlay.css +130 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/media/chatEditingExplanationWidget.css +276 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionPickerActionItem.d.ts +24 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionPickerActionItem.js +128 -52
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessions.contribution.d.ts +153 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessions.contribution.js +1218 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/media/chatSessionPickerActionItem.css +14 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/searchableOptionPickerActionItem.d.ts +39 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/searchableOptionPickerActionItem.js +193 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewWelcomeController.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewWelcomeController.js +93 -89
- package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewsWelcome.js +5 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatAgentHover.js +42 -47
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentMarkdownRenderer.js +58 -56
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAgentCommandContentPart.js +18 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAnonymousRateLimitedPart.js +17 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAttachmentsContentPart.d.ts +6 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatAttachmentsContentPart.js +132 -68
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatChangesSummaryPart.d.ts +0 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatChangesSummaryPart.js +68 -47
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCodeCitationContentPart.js +14 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCollapsibleContentPart.d.ts +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCollapsibleContentPart.js +36 -24
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCollapsibleMarkdownContentPart.d.ts +18 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCollapsibleMarkdownContentPart.js +32 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCollections.d.ts +7 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCollections.js +15 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCommandContentPart.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatCommandContentPart.js +22 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatConfirmationContentPart.d.ts +0 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatConfirmationContentPart.js +34 -27
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatConfirmationWidget.d.ts +1 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatConfirmationWidget.js +198 -135
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatContentCodePools.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatContentCodePools.js +38 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatDiffBlockPart.js +29 -27
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatElicitationContentPart.d.ts +0 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatElicitationContentPart.js +41 -36
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatErrorConfirmationPart.d.ts +0 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatErrorConfirmationPart.js +23 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatErrorContentPart.js +13 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatExtensionsContentPart.d.ts +0 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatExtensionsContentPart.js +20 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatInlineAnchorWidget.d.ts +11 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatInlineAnchorWidget.js +291 -152
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownContentPart.d.ts +2 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownContentPart.js +227 -162
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownDecorationsRenderer.js +68 -72
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMcpServersInteractionContentPart.d.ts +2 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMcpServersInteractionContentPart.js +76 -75
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMultiDiffContentPart.d.ts +2 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMultiDiffContentPart.js +96 -76
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatProgressContentPart.d.ts +4 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatProgressContentPart.js +74 -38
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatPullRequestContentPart.d.ts +0 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatPullRequestContentPart.js +11 -25
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuestionCarouselPart.d.ts +107 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuestionCarouselPart.js +814 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuotaExceededPart.d.ts +0 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatQuotaExceededPart.js +34 -29
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatReferencesContentPart.d.ts +8 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatReferencesContentPart.js +236 -197
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSubagentContentPart.d.ts +123 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSubagentContentPart.js +492 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSuggestNextWidget.js +75 -47
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTaskContentPart.d.ts +2 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTaskContentPart.js +31 -20
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTextEditContentPart.d.ts +0 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTextEditContentPart.js +42 -36
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatThinkingContentPart.d.ts +55 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatThinkingContentPart.js +714 -148
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTipContentPart.d.ts +7 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTipContentPart.js +21 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTodoListWidget.d.ts +2 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTodoListWidget.js +143 -153
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatToolInputOutputContentPart.d.ts +14 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatToolInputOutputContentPart.js +79 -61
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatToolOutputContentSubPart.d.ts +10 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatToolOutputContentSubPart.js +209 -77
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTreeContentPart.d.ts +9 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTreeContentPart.js +71 -54
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatWorkspaceEditContentPart.d.ts +18 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatWorkspaceEditContentPart.js +83 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/codeBlockPart.d.ts +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/codeBlockPart.js +248 -190
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatConfirmationWidget.css +1 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatInlineAnchorWidget.css +23 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatPullRequestContent.css +5 -41
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatQuestionCarousel.css +493 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatSubagentContent.css +63 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatTerminalToolProgressPart.css +9 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatThinkingContent.css +121 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatTipContent.css +37 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/abstractToolConfirmationSubPart.js +51 -45
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatExtensionsInstallToolSubPart.js +46 -42
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatInputOutputMarkdownProgressPart.d.ts +4 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatInputOutputMarkdownProgressPart.js +99 -67
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMcpAppModel.d.ts +112 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMcpAppModel.js +634 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMcpAppSubPart.d.ts +49 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatMcpAppSubPart.js +132 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatResultListSubPart.js +15 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolConfirmationSubPart.js +196 -149
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolProgressPart.d.ts +17 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatTerminalToolProgressPart.js +577 -193
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolConfirmationSubPart.js +119 -86
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolInvocationPart.d.ts +10 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolInvocationPart.js +165 -36
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolInvocationSubPart.d.ts +0 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolInvocationSubPart.js +5 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolOutputPart.d.ts +5 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolOutputPart.js +75 -65
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolPartUtilities.js +30 -28
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolPostExecuteConfirmationPart.d.ts +1 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolPostExecuteConfirmationPart.js +102 -106
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolProgressPart.js +44 -20
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolStreamingSubPart.d.ts +19 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolStreamingSubPart.js +67 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/terminalToolAutoExpand.d.ts +57 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/terminalToolAutoExpand.js +69 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatDragAndDrop.js +122 -82
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListRenderer.d.ts +39 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListRenderer.js +1110 -597
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListWidget.d.ts +291 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatListWidget.js +485 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatOptions.js +38 -28
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidget.d.ts +9 -20
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidget.js +650 -689
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatFollowups.js +21 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.d.ts +102 -36
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPart.js +1253 -790
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPartWidgets.d.ts +0 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPartWidgets.js +11 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPickerActionItem.d.ts +34 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputPickerActionItem.js +55 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatSelectedTools.d.ts +6 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatSelectedTools.js +51 -35
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/delegationSessionPickerActionItem.d.ts +22 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/delegationSessionPickerActionItem.js +102 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modePickerActionItem.d.ts +16 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modePickerActionItem.js +192 -44
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modelPickerActionItem.d.ts +11 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/modelPickerActionItem.js +99 -66
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/sessionTargetPickerActionItem.d.ts +47 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/sessionTargetPickerActionItem.js +188 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/workspacePickerActionItem.d.ts +20 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/workspacePickerActionItem.js +115 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/media/chat.css +129 -167
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/media/chatViewWelcome.css +16 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageDetails.d.ts +37 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageDetails.js +143 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageWidget.d.ts +56 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatContextUsageWidget.js +206 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/media/chatContextUsageDetails.css +152 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/media/chatContextUsageWidget.css +67 -0
- package/vscode/src/vs/workbench/contrib/chat/common/widget/annotations.d.ts +22 -0
- package/vscode/src/vs/workbench/contrib/chat/common/widget/annotations.js +170 -0
- package/vscode/src/vs/workbench/contrib/chat/common/widget/chatColors.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/common/widget/chatColors.js +80 -19
- package/vscode/src/vs/workbench/contrib/chat/common/widget/chatWidgetHistoryService.js +20 -28
- package/vscode/src/vs/workbench/contrib/chat/common/widget/codeBlockModelCollection.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/chat/common/widget/codeBlockModelCollection.js +22 -19
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAffordance.d.ts +15 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAffordance.js +122 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.d.ts +19 -104
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.js +316 -1040
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatEditorAffordance.d.ts +28 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatEditorAffordance.js +162 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatGutterAffordance.d.ts +21 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatGutterAffordance.js +98 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatOverlayWidget.d.ts +68 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatOverlayWidget.js +416 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatWidget.d.ts +1 -6
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatWidget.js +194 -215
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatZoneWidget.d.ts +0 -1
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatZoneWidget.js +74 -104
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/media/inlineChat.css +45 -91
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/media/inlineChatEditorAffordance.css +22 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/media/inlineChatOverlayWidget.css +98 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.d.ts +5 -2
- package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.js +96 -68
- package/vscode/src/vs/workbench/contrib/interactive/browser/interactiveCommon.d.ts +7 -0
- package/vscode/src/vs/workbench/contrib/interactive/browser/interactiveCommon.js +11 -0
- package/vscode/src/vs/workbench/contrib/interactive/browser/replInputHintContentWidget.d.ts +20 -0
- package/vscode/src/vs/workbench/contrib/interactive/browser/replInputHintContentWidget.js +150 -0
- package/vscode/src/vs/workbench/contrib/markdown/browser/markedKatexSupport.js +141 -147
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpToolCallUI.d.ts +64 -0
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpToolCallUI.js +200 -0
- package/vscode/src/vs/workbench/contrib/mcp/common/modelContextProtocolApps.d.ts +548 -0
- package/vscode/src/vs/workbench/contrib/mcp/common/modelContextProtocolApps.js +23 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/executionStatusBarItemController.d.ts +22 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/executionStatusBarItemController.js +338 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/notebookVisibleCellObserver.d.ts +18 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/notebookVisibleCellObserver.js +58 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindWidget.d.ts +75 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindWidget.js +364 -0
- package/vscode/src/vs/workbench/contrib/replNotebook/browser/interactiveEditor.css +21 -0
- package/vscode/src/vs/workbench/contrib/replNotebook/browser/media/interactive.css +36 -0
- package/vscode/src/vs/workbench/contrib/replNotebook/browser/replEditor.d.ts +110 -0
- package/vscode/src/vs/workbench/contrib/replNotebook/browser/replEditor.js +692 -0
- package/vscode/src/vs/workbench/contrib/replNotebook/browser/replEditorInput.d.ts +40 -0
- package/vscode/src/vs/workbench/contrib/replNotebook/browser/replEditorInput.js +158 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/chatTerminalCommandMirror.d.ts +80 -21
- package/vscode/src/vs/workbench/contrib/terminal/browser/chatTerminalCommandMirror.js +440 -82
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatInputRelatedFilesContrib.d.ts +0 -34
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatInputRelatedFilesContrib.js +0 -139
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletions.d.ts +0 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletions.js +0 -1081
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSession.d.ts +0 -199
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSession.js +0 -482
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionService.d.ts +0 -28
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionService.js +0 -37
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.d.ts +0 -94
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.js +0 -495
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatStrategies.d.ts +0 -72
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatStrategies.js +0 -454
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/utils.d.ts +0 -13
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/utils.js +0 -66
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpPromptArgumentPick.d.ts +0 -41
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpPromptArgumentPick.js +0 -372
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/chat/notebookChatUtils.d.ts +0 -4
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/chat/notebookChatUtils.js +0 -58
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/cellOperations.d.ts +0 -26
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/cellOperations.js +0 -594
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffCellEditorOptions.d.ts +0 -8
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffCellEditorOptions.js +0 -55
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffComponents.d.ts +0 -273
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffComponents.js +0 -1746
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementOutputs.d.ts +0 -50
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementOutputs.js +0 -269
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementViewModel.d.ts +0 -258
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementViewModel.js +0 -806
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffNestedCellViewModel.d.ts +0 -41
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffNestedCellViewModel.js +0 -116
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/editorHeightCalculator.d.ts +0 -17
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/editorHeightCalculator.js +0 -62
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/eventDispatcher.d.ts +0 -27
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/eventDispatcher.js +0 -40
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookCellDiffDecorator.d.ts +0 -23
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookCellDiffDecorator.js +0 -295
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookDeletedCellDecorator.d.ts +0 -51
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookDeletedCellDecorator.js +0 -241
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInlineDiff.d.ts +0 -24
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInlineDiff.js +0 -146
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInlineDiffWidget.d.ts +0 -28
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInlineDiffWidget.js +0 -90
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInsertedCellDecorator.d.ts +0 -10
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInsertedCellDecorator.js +0 -41
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookOriginalCellModelFactory.d.ts +0 -21
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookOriginalCellModelFactory.js +0 -42
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookOriginalModelRefFactory.d.ts +0 -25
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookOriginalModelRefFactory.js +0 -77
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiff.css +0 -469
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditor.d.ts +0 -149
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditor.js +0 -823
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditorBrowser.d.ts +0 -180
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditorBrowser.js +0 -29
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffList.d.ts +0 -102
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffList.js +0 -567
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffOverviewRuler.d.ts +0 -30
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffOverviewRuler.js +0 -189
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffViewModel.d.ts +0 -75
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffViewModel.js +0 -439
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookMultiDiffEditor.d.ts +0 -57
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookMultiDiffEditor.js +0 -263
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookMultiDiffEditorInput.d.ts +0 -22
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookMultiDiffEditorInput.js +0 -48
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/unchangedEditorRegions.d.ts +0 -13
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/unchangedEditorRegions.js +0 -39
- package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookMetadataTextModel.d.ts +0 -19
- package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookMetadataTextModel.js +0 -89
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookDiff.d.ts +0 -26
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookDiff.js +0 -92
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookDiffEditorInput.d.ts +0 -33
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookDiffEditorInput.js +0 -108
|
@@ -1,806 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { Emitter } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
|
|
3
|
-
import { hash } from '@codingame/monaco-vscode-api/vscode/vs/base/common/hash';
|
|
4
|
-
import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
5
|
-
import { DiffEditorWidget } from '@codingame/monaco-vscode-api/vscode/vs/editor/browser/widget/diffEditor/diffEditorWidget';
|
|
6
|
-
import { getEditorPadding } from './diffCellEditorOptions.js';
|
|
7
|
-
import { DiffNestedCellViewModel } from './diffNestedCellViewModel.js';
|
|
8
|
-
import { NotebookDiffViewEventType } from './eventDispatcher.js';
|
|
9
|
-
import { DIFF_CELL_MARGIN, DiffSide } from './notebookDiffEditorBrowser.js';
|
|
10
|
-
import { CellLayoutState } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/browser/notebookBrowser';
|
|
11
|
-
import { getFormattedMetadataJSON } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/model/notebookCellTextModel';
|
|
12
|
-
import { CellUri } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
|
|
13
|
-
import { Schemas } from '@codingame/monaco-vscode-api/vscode/vs/base/common/network';
|
|
14
|
-
import { NotebookDocumentMetadataTextModel } from '../../common/model/notebookMetadataTextModel.js';
|
|
15
|
-
|
|
16
|
-
const PropertyHeaderHeight = 25;
|
|
17
|
-
const HeightOfHiddenLinesRegionInDiffEditor = 24;
|
|
18
|
-
const DefaultLineHeight = 17;
|
|
19
|
-
var PropertyFoldingState;
|
|
20
|
-
(function (PropertyFoldingState) {
|
|
21
|
-
PropertyFoldingState[PropertyFoldingState["Expanded"] = 0] = "Expanded";
|
|
22
|
-
PropertyFoldingState[PropertyFoldingState["Collapsed"] = 1] = "Collapsed";
|
|
23
|
-
})(PropertyFoldingState || (PropertyFoldingState = {}));
|
|
24
|
-
const OUTPUT_EDITOR_HEIGHT_MAGIC = 1440;
|
|
25
|
-
class DiffElementViewModelBase extends Disposable {
|
|
26
|
-
constructor(mainDocumentTextModel, editorEventDispatcher, initData) {
|
|
27
|
-
super();
|
|
28
|
-
this.mainDocumentTextModel = mainDocumentTextModel;
|
|
29
|
-
this.editorEventDispatcher = editorEventDispatcher;
|
|
30
|
-
this.initData = initData;
|
|
31
|
-
this._layoutInfoEmitter = this._register(( new Emitter()));
|
|
32
|
-
this.onDidLayoutChange = this._layoutInfoEmitter.event;
|
|
33
|
-
this._register(this.editorEventDispatcher.onDidChangeLayout(e => this._layoutInfoEmitter.fire({ outerWidth: true })));
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
class DiffElementPlaceholderViewModel extends DiffElementViewModelBase {
|
|
37
|
-
constructor(mainDocumentTextModel, editorEventDispatcher, initData) {
|
|
38
|
-
super(mainDocumentTextModel, editorEventDispatcher, initData);
|
|
39
|
-
this.type = 'placeholder';
|
|
40
|
-
this.hiddenCells = [];
|
|
41
|
-
this._unfoldHiddenCells = this._register(( new Emitter()));
|
|
42
|
-
this.onUnfoldHiddenCells = this._unfoldHiddenCells.event;
|
|
43
|
-
this.renderOutput = false;
|
|
44
|
-
}
|
|
45
|
-
get totalHeight() {
|
|
46
|
-
return 24 + (2 * DIFF_CELL_MARGIN);
|
|
47
|
-
}
|
|
48
|
-
getHeight(_) {
|
|
49
|
-
return this.totalHeight;
|
|
50
|
-
}
|
|
51
|
-
layoutChange() {
|
|
52
|
-
}
|
|
53
|
-
showHiddenCells() {
|
|
54
|
-
this._unfoldHiddenCells.fire();
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
class NotebookDocumentMetadataViewModel extends DiffElementViewModelBase {
|
|
58
|
-
set editorHeight(height) {
|
|
59
|
-
this._layout({ editorHeight: height });
|
|
60
|
-
}
|
|
61
|
-
get editorHeight() {
|
|
62
|
-
throw ( new Error('Use Cell.layoutInfo.editorHeight'));
|
|
63
|
-
}
|
|
64
|
-
set editorMargin(margin) {
|
|
65
|
-
this._layout({ editorMargin: margin });
|
|
66
|
-
}
|
|
67
|
-
get editorMargin() {
|
|
68
|
-
throw ( new Error('Use Cell.layoutInfo.editorMargin'));
|
|
69
|
-
}
|
|
70
|
-
get layoutInfo() {
|
|
71
|
-
return this._layoutInfo;
|
|
72
|
-
}
|
|
73
|
-
get totalHeight() {
|
|
74
|
-
return this.layoutInfo.totalHeight;
|
|
75
|
-
}
|
|
76
|
-
constructor(originalDocumentTextModel, modifiedDocumentTextModel, type, editorEventDispatcher, initData, notebookService, editorHeightCalculator) {
|
|
77
|
-
super(originalDocumentTextModel, editorEventDispatcher, initData);
|
|
78
|
-
this.originalDocumentTextModel = originalDocumentTextModel;
|
|
79
|
-
this.modifiedDocumentTextModel = modifiedDocumentTextModel;
|
|
80
|
-
this.type = type;
|
|
81
|
-
this.editorHeightCalculator = editorHeightCalculator;
|
|
82
|
-
this.renderOutput = false;
|
|
83
|
-
this._sourceEditorViewState = null;
|
|
84
|
-
const cellStatusHeight = PropertyHeaderHeight;
|
|
85
|
-
this._layoutInfo = {
|
|
86
|
-
width: 0,
|
|
87
|
-
editorHeight: 0,
|
|
88
|
-
editorMargin: 0,
|
|
89
|
-
metadataHeight: 0,
|
|
90
|
-
cellStatusHeight,
|
|
91
|
-
metadataStatusHeight: 0,
|
|
92
|
-
rawOutputHeight: 0,
|
|
93
|
-
outputTotalHeight: 0,
|
|
94
|
-
outputStatusHeight: 0,
|
|
95
|
-
outputMetadataHeight: 0,
|
|
96
|
-
bodyMargin: 32,
|
|
97
|
-
totalHeight: 82 + cellStatusHeight + 0,
|
|
98
|
-
layoutState: CellLayoutState.Uninitialized
|
|
99
|
-
};
|
|
100
|
-
this.cellFoldingState = type === 'modifiedMetadata' ? PropertyFoldingState.Expanded : PropertyFoldingState.Collapsed;
|
|
101
|
-
this.originalMetadata = this._register(( new NotebookDocumentMetadataTextModel(originalDocumentTextModel)));
|
|
102
|
-
this.modifiedMetadata = this._register(( new NotebookDocumentMetadataTextModel(modifiedDocumentTextModel)));
|
|
103
|
-
}
|
|
104
|
-
async computeHeights() {
|
|
105
|
-
if (this.type === 'unchangedMetadata') {
|
|
106
|
-
this.editorHeight = this.editorHeightCalculator.computeHeightFromLines(this.originalMetadata.textBuffer.getLineCount());
|
|
107
|
-
}
|
|
108
|
-
else {
|
|
109
|
-
const original = this.originalMetadata.uri;
|
|
110
|
-
const modified = this.modifiedMetadata.uri;
|
|
111
|
-
this.editorHeight = await this.editorHeightCalculator.diffAndComputeHeight(original, modified);
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
layoutChange() {
|
|
115
|
-
this._layout({ recomputeOutput: true });
|
|
116
|
-
}
|
|
117
|
-
_layout(delta) {
|
|
118
|
-
const width = delta.width !== undefined ? delta.width : this._layoutInfo.width;
|
|
119
|
-
const editorHeight = delta.editorHeight !== undefined ? delta.editorHeight : this._layoutInfo.editorHeight;
|
|
120
|
-
const editorMargin = delta.editorMargin !== undefined ? delta.editorMargin : this._layoutInfo.editorMargin;
|
|
121
|
-
const cellStatusHeight = delta.cellStatusHeight !== undefined ? delta.cellStatusHeight : this._layoutInfo.cellStatusHeight;
|
|
122
|
-
const bodyMargin = delta.bodyMargin !== undefined ? delta.bodyMargin : this._layoutInfo.bodyMargin;
|
|
123
|
-
const totalHeight = editorHeight
|
|
124
|
-
+ editorMargin
|
|
125
|
-
+ cellStatusHeight
|
|
126
|
-
+ bodyMargin;
|
|
127
|
-
const newLayout = {
|
|
128
|
-
width: width,
|
|
129
|
-
editorHeight: editorHeight,
|
|
130
|
-
editorMargin: editorMargin,
|
|
131
|
-
metadataHeight: 0,
|
|
132
|
-
cellStatusHeight,
|
|
133
|
-
metadataStatusHeight: 0,
|
|
134
|
-
outputTotalHeight: 0,
|
|
135
|
-
outputStatusHeight: 0,
|
|
136
|
-
bodyMargin: bodyMargin,
|
|
137
|
-
rawOutputHeight: 0,
|
|
138
|
-
outputMetadataHeight: 0,
|
|
139
|
-
totalHeight: totalHeight,
|
|
140
|
-
layoutState: CellLayoutState.Measured
|
|
141
|
-
};
|
|
142
|
-
let somethingChanged = false;
|
|
143
|
-
const changeEvent = {};
|
|
144
|
-
if (newLayout.width !== this._layoutInfo.width) {
|
|
145
|
-
changeEvent.width = true;
|
|
146
|
-
somethingChanged = true;
|
|
147
|
-
}
|
|
148
|
-
if (newLayout.editorHeight !== this._layoutInfo.editorHeight) {
|
|
149
|
-
changeEvent.editorHeight = true;
|
|
150
|
-
somethingChanged = true;
|
|
151
|
-
}
|
|
152
|
-
if (newLayout.editorMargin !== this._layoutInfo.editorMargin) {
|
|
153
|
-
changeEvent.editorMargin = true;
|
|
154
|
-
somethingChanged = true;
|
|
155
|
-
}
|
|
156
|
-
if (newLayout.cellStatusHeight !== this._layoutInfo.cellStatusHeight) {
|
|
157
|
-
changeEvent.cellStatusHeight = true;
|
|
158
|
-
somethingChanged = true;
|
|
159
|
-
}
|
|
160
|
-
if (newLayout.bodyMargin !== this._layoutInfo.bodyMargin) {
|
|
161
|
-
changeEvent.bodyMargin = true;
|
|
162
|
-
somethingChanged = true;
|
|
163
|
-
}
|
|
164
|
-
if (newLayout.totalHeight !== this._layoutInfo.totalHeight) {
|
|
165
|
-
changeEvent.totalHeight = true;
|
|
166
|
-
somethingChanged = true;
|
|
167
|
-
}
|
|
168
|
-
if (somethingChanged) {
|
|
169
|
-
this._layoutInfo = newLayout;
|
|
170
|
-
this._fireLayoutChangeEvent(changeEvent);
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
getHeight(lineHeight) {
|
|
174
|
-
if (this._layoutInfo.layoutState === CellLayoutState.Uninitialized) {
|
|
175
|
-
const editorHeight = this.cellFoldingState === PropertyFoldingState.Collapsed ? 0 : this.computeInputEditorHeight(lineHeight);
|
|
176
|
-
return this._computeTotalHeight(editorHeight);
|
|
177
|
-
}
|
|
178
|
-
else {
|
|
179
|
-
return this._layoutInfo.totalHeight;
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
_computeTotalHeight(editorHeight) {
|
|
183
|
-
const totalHeight = editorHeight
|
|
184
|
-
+ this._layoutInfo.editorMargin
|
|
185
|
-
+ this._layoutInfo.metadataHeight
|
|
186
|
-
+ this._layoutInfo.cellStatusHeight
|
|
187
|
-
+ this._layoutInfo.metadataStatusHeight
|
|
188
|
-
+ this._layoutInfo.outputTotalHeight
|
|
189
|
-
+ this._layoutInfo.outputStatusHeight
|
|
190
|
-
+ this._layoutInfo.outputMetadataHeight
|
|
191
|
-
+ this._layoutInfo.bodyMargin;
|
|
192
|
-
return totalHeight;
|
|
193
|
-
}
|
|
194
|
-
computeInputEditorHeight(_lineHeight) {
|
|
195
|
-
return this.editorHeightCalculator.computeHeightFromLines(Math.max(this.originalMetadata.textBuffer.getLineCount(), this.modifiedMetadata.textBuffer.getLineCount()));
|
|
196
|
-
}
|
|
197
|
-
_fireLayoutChangeEvent(state) {
|
|
198
|
-
this._layoutInfoEmitter.fire(state);
|
|
199
|
-
this.editorEventDispatcher.emit([{ type: NotebookDiffViewEventType.CellLayoutChanged, source: this._layoutInfo }]);
|
|
200
|
-
}
|
|
201
|
-
getComputedCellContainerWidth(layoutInfo, diffEditor, fullWidth) {
|
|
202
|
-
if (fullWidth) {
|
|
203
|
-
return layoutInfo.width - 2 * DIFF_CELL_MARGIN + (diffEditor ? DiffEditorWidget.ENTIRE_DIFF_OVERVIEW_WIDTH : 0) - 2;
|
|
204
|
-
}
|
|
205
|
-
return (layoutInfo.width - 2 * DIFF_CELL_MARGIN + (diffEditor ? DiffEditorWidget.ENTIRE_DIFF_OVERVIEW_WIDTH : 0)) / 2 - 18 - 2;
|
|
206
|
-
}
|
|
207
|
-
getSourceEditorViewState() {
|
|
208
|
-
return this._sourceEditorViewState;
|
|
209
|
-
}
|
|
210
|
-
saveSpirceEditorViewState(viewState) {
|
|
211
|
-
this._sourceEditorViewState = viewState;
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
class DiffElementCellViewModelBase extends DiffElementViewModelBase {
|
|
215
|
-
hideUnchangedCells() {
|
|
216
|
-
this._hideUnchangedCells.fire();
|
|
217
|
-
}
|
|
218
|
-
set rawOutputHeight(height) {
|
|
219
|
-
this._layout({ rawOutputHeight: Math.min(OUTPUT_EDITOR_HEIGHT_MAGIC, height) });
|
|
220
|
-
}
|
|
221
|
-
get rawOutputHeight() {
|
|
222
|
-
throw ( new Error('Use Cell.layoutInfo.rawOutputHeight'));
|
|
223
|
-
}
|
|
224
|
-
set outputStatusHeight(height) {
|
|
225
|
-
this._layout({ outputStatusHeight: height });
|
|
226
|
-
}
|
|
227
|
-
get outputStatusHeight() {
|
|
228
|
-
throw ( new Error('Use Cell.layoutInfo.outputStatusHeight'));
|
|
229
|
-
}
|
|
230
|
-
set outputMetadataHeight(height) {
|
|
231
|
-
this._layout({ outputMetadataHeight: height });
|
|
232
|
-
}
|
|
233
|
-
get outputMetadataHeight() {
|
|
234
|
-
throw ( new Error('Use Cell.layoutInfo.outputStatusHeight'));
|
|
235
|
-
}
|
|
236
|
-
set editorHeight(height) {
|
|
237
|
-
this._layout({ editorHeight: height });
|
|
238
|
-
}
|
|
239
|
-
get editorHeight() {
|
|
240
|
-
throw ( new Error('Use Cell.layoutInfo.editorHeight'));
|
|
241
|
-
}
|
|
242
|
-
set editorMargin(margin) {
|
|
243
|
-
this._layout({ editorMargin: margin });
|
|
244
|
-
}
|
|
245
|
-
get editorMargin() {
|
|
246
|
-
throw ( new Error('Use Cell.layoutInfo.editorMargin'));
|
|
247
|
-
}
|
|
248
|
-
set metadataStatusHeight(height) {
|
|
249
|
-
this._layout({ metadataStatusHeight: height });
|
|
250
|
-
}
|
|
251
|
-
get metadataStatusHeight() {
|
|
252
|
-
throw ( new Error('Use Cell.layoutInfo.outputStatusHeight'));
|
|
253
|
-
}
|
|
254
|
-
set metadataHeight(height) {
|
|
255
|
-
this._layout({ metadataHeight: height });
|
|
256
|
-
}
|
|
257
|
-
get metadataHeight() {
|
|
258
|
-
throw ( new Error('Use Cell.layoutInfo.metadataHeight'));
|
|
259
|
-
}
|
|
260
|
-
set renderOutput(value) {
|
|
261
|
-
this._renderOutput = value;
|
|
262
|
-
this._layout({ recomputeOutput: true });
|
|
263
|
-
this._stateChangeEmitter.fire({ renderOutput: this._renderOutput });
|
|
264
|
-
}
|
|
265
|
-
get renderOutput() {
|
|
266
|
-
return this._renderOutput;
|
|
267
|
-
}
|
|
268
|
-
get layoutInfo() {
|
|
269
|
-
return this._layoutInfo;
|
|
270
|
-
}
|
|
271
|
-
get totalHeight() {
|
|
272
|
-
return this.layoutInfo.totalHeight;
|
|
273
|
-
}
|
|
274
|
-
get ignoreOutputs() {
|
|
275
|
-
return this.configurationService.getValue('notebook.diff.ignoreOutputs') || !!(this.mainDocumentTextModel?.transientOptions.transientOutputs);
|
|
276
|
-
}
|
|
277
|
-
get ignoreMetadata() {
|
|
278
|
-
return this.configurationService.getValue('notebook.diff.ignoreMetadata');
|
|
279
|
-
}
|
|
280
|
-
constructor(mainDocumentTextModel, original, modified, type, editorEventDispatcher, initData, notebookService, index, configurationService, diffEditorHeightCalculator) {
|
|
281
|
-
super(mainDocumentTextModel, editorEventDispatcher, initData);
|
|
282
|
-
this.type = type;
|
|
283
|
-
this.index = index;
|
|
284
|
-
this.configurationService = configurationService;
|
|
285
|
-
this.diffEditorHeightCalculator = diffEditorHeightCalculator;
|
|
286
|
-
this._stateChangeEmitter = this._register(( new Emitter()));
|
|
287
|
-
this.onDidStateChange = this._stateChangeEmitter.event;
|
|
288
|
-
this._hideUnchangedCells = this._register(( new Emitter()));
|
|
289
|
-
this.onHideUnchangedCells = this._hideUnchangedCells.event;
|
|
290
|
-
this._renderOutput = true;
|
|
291
|
-
this._sourceEditorViewState = null;
|
|
292
|
-
this._outputEditorViewState = null;
|
|
293
|
-
this._metadataEditorViewState = null;
|
|
294
|
-
this.original = original ? this._register(( new DiffNestedCellViewModel(original, notebookService))) : undefined;
|
|
295
|
-
this.modified = modified ? this._register(( new DiffNestedCellViewModel(modified, notebookService))) : undefined;
|
|
296
|
-
const editorHeight = this._estimateEditorHeight(initData.fontInfo);
|
|
297
|
-
const cellStatusHeight = PropertyHeaderHeight;
|
|
298
|
-
this._layoutInfo = {
|
|
299
|
-
width: 0,
|
|
300
|
-
editorHeight: editorHeight,
|
|
301
|
-
editorMargin: 0,
|
|
302
|
-
metadataHeight: 0,
|
|
303
|
-
cellStatusHeight,
|
|
304
|
-
metadataStatusHeight: this.ignoreMetadata ? 0 : PropertyHeaderHeight,
|
|
305
|
-
rawOutputHeight: 0,
|
|
306
|
-
outputTotalHeight: 0,
|
|
307
|
-
outputStatusHeight: this.ignoreOutputs ? 0 : PropertyHeaderHeight,
|
|
308
|
-
outputMetadataHeight: 0,
|
|
309
|
-
bodyMargin: 32,
|
|
310
|
-
totalHeight: 82 + cellStatusHeight + editorHeight,
|
|
311
|
-
layoutState: CellLayoutState.Uninitialized
|
|
312
|
-
};
|
|
313
|
-
this.cellFoldingState = modified?.getTextBufferHash() !== original?.getTextBufferHash() ? PropertyFoldingState.Expanded : PropertyFoldingState.Collapsed;
|
|
314
|
-
this.metadataFoldingState = PropertyFoldingState.Collapsed;
|
|
315
|
-
this.outputFoldingState = PropertyFoldingState.Collapsed;
|
|
316
|
-
}
|
|
317
|
-
layoutChange() {
|
|
318
|
-
this._layout({ recomputeOutput: true });
|
|
319
|
-
}
|
|
320
|
-
_estimateEditorHeight(fontInfo) {
|
|
321
|
-
const lineHeight = fontInfo?.lineHeight ?? 17;
|
|
322
|
-
switch (this.type) {
|
|
323
|
-
case 'unchanged':
|
|
324
|
-
case 'insert':
|
|
325
|
-
{
|
|
326
|
-
const lineCount = this.modified.textModel.textBuffer.getLineCount();
|
|
327
|
-
const editorHeight = lineCount * lineHeight + getEditorPadding(lineCount).top + getEditorPadding(lineCount).bottom;
|
|
328
|
-
return editorHeight;
|
|
329
|
-
}
|
|
330
|
-
case 'delete':
|
|
331
|
-
case 'modified':
|
|
332
|
-
{
|
|
333
|
-
const lineCount = this.original.textModel.textBuffer.getLineCount();
|
|
334
|
-
const editorHeight = lineCount * lineHeight + getEditorPadding(lineCount).top + getEditorPadding(lineCount).bottom;
|
|
335
|
-
return editorHeight;
|
|
336
|
-
}
|
|
337
|
-
}
|
|
338
|
-
}
|
|
339
|
-
_layout(delta) {
|
|
340
|
-
const width = delta.width !== undefined ? delta.width : this._layoutInfo.width;
|
|
341
|
-
const editorHeight = delta.editorHeight !== undefined ? delta.editorHeight : this._layoutInfo.editorHeight;
|
|
342
|
-
const editorMargin = delta.editorMargin !== undefined ? delta.editorMargin : this._layoutInfo.editorMargin;
|
|
343
|
-
const metadataHeight = delta.metadataHeight !== undefined ? delta.metadataHeight : this._layoutInfo.metadataHeight;
|
|
344
|
-
const cellStatusHeight = delta.cellStatusHeight !== undefined ? delta.cellStatusHeight : this._layoutInfo.cellStatusHeight;
|
|
345
|
-
const metadataStatusHeight = delta.metadataStatusHeight !== undefined ? delta.metadataStatusHeight : this._layoutInfo.metadataStatusHeight;
|
|
346
|
-
const rawOutputHeight = delta.rawOutputHeight !== undefined ? delta.rawOutputHeight : this._layoutInfo.rawOutputHeight;
|
|
347
|
-
const outputStatusHeight = delta.outputStatusHeight !== undefined ? delta.outputStatusHeight : this._layoutInfo.outputStatusHeight;
|
|
348
|
-
const bodyMargin = delta.bodyMargin !== undefined ? delta.bodyMargin : this._layoutInfo.bodyMargin;
|
|
349
|
-
const outputMetadataHeight = delta.outputMetadataHeight !== undefined ? delta.outputMetadataHeight : this._layoutInfo.outputMetadataHeight;
|
|
350
|
-
const outputHeight = this.ignoreOutputs ? 0 : (delta.recomputeOutput || delta.rawOutputHeight !== undefined || delta.outputMetadataHeight !== undefined) ? this._getOutputTotalHeight(rawOutputHeight, outputMetadataHeight) : this._layoutInfo.outputTotalHeight;
|
|
351
|
-
const totalHeight = editorHeight
|
|
352
|
-
+ editorMargin
|
|
353
|
-
+ cellStatusHeight
|
|
354
|
-
+ metadataHeight
|
|
355
|
-
+ metadataStatusHeight
|
|
356
|
-
+ outputHeight
|
|
357
|
-
+ outputStatusHeight
|
|
358
|
-
+ bodyMargin;
|
|
359
|
-
const newLayout = {
|
|
360
|
-
width: width,
|
|
361
|
-
editorHeight: editorHeight,
|
|
362
|
-
editorMargin: editorMargin,
|
|
363
|
-
metadataHeight: metadataHeight,
|
|
364
|
-
cellStatusHeight,
|
|
365
|
-
metadataStatusHeight: metadataStatusHeight,
|
|
366
|
-
outputTotalHeight: outputHeight,
|
|
367
|
-
outputStatusHeight: outputStatusHeight,
|
|
368
|
-
bodyMargin: bodyMargin,
|
|
369
|
-
rawOutputHeight: rawOutputHeight,
|
|
370
|
-
outputMetadataHeight: outputMetadataHeight,
|
|
371
|
-
totalHeight: totalHeight,
|
|
372
|
-
layoutState: CellLayoutState.Measured
|
|
373
|
-
};
|
|
374
|
-
let somethingChanged = false;
|
|
375
|
-
const changeEvent = {};
|
|
376
|
-
if (newLayout.width !== this._layoutInfo.width) {
|
|
377
|
-
changeEvent.width = true;
|
|
378
|
-
somethingChanged = true;
|
|
379
|
-
}
|
|
380
|
-
if (newLayout.editorHeight !== this._layoutInfo.editorHeight) {
|
|
381
|
-
changeEvent.editorHeight = true;
|
|
382
|
-
somethingChanged = true;
|
|
383
|
-
}
|
|
384
|
-
if (newLayout.editorMargin !== this._layoutInfo.editorMargin) {
|
|
385
|
-
changeEvent.editorMargin = true;
|
|
386
|
-
somethingChanged = true;
|
|
387
|
-
}
|
|
388
|
-
if (newLayout.metadataHeight !== this._layoutInfo.metadataHeight) {
|
|
389
|
-
changeEvent.metadataHeight = true;
|
|
390
|
-
somethingChanged = true;
|
|
391
|
-
}
|
|
392
|
-
if (newLayout.cellStatusHeight !== this._layoutInfo.cellStatusHeight) {
|
|
393
|
-
changeEvent.cellStatusHeight = true;
|
|
394
|
-
somethingChanged = true;
|
|
395
|
-
}
|
|
396
|
-
if (newLayout.metadataStatusHeight !== this._layoutInfo.metadataStatusHeight) {
|
|
397
|
-
changeEvent.metadataStatusHeight = true;
|
|
398
|
-
somethingChanged = true;
|
|
399
|
-
}
|
|
400
|
-
if (newLayout.outputTotalHeight !== this._layoutInfo.outputTotalHeight) {
|
|
401
|
-
changeEvent.outputTotalHeight = true;
|
|
402
|
-
somethingChanged = true;
|
|
403
|
-
}
|
|
404
|
-
if (newLayout.outputStatusHeight !== this._layoutInfo.outputStatusHeight) {
|
|
405
|
-
changeEvent.outputStatusHeight = true;
|
|
406
|
-
somethingChanged = true;
|
|
407
|
-
}
|
|
408
|
-
if (newLayout.bodyMargin !== this._layoutInfo.bodyMargin) {
|
|
409
|
-
changeEvent.bodyMargin = true;
|
|
410
|
-
somethingChanged = true;
|
|
411
|
-
}
|
|
412
|
-
if (newLayout.outputMetadataHeight !== this._layoutInfo.outputMetadataHeight) {
|
|
413
|
-
changeEvent.outputMetadataHeight = true;
|
|
414
|
-
somethingChanged = true;
|
|
415
|
-
}
|
|
416
|
-
if (newLayout.totalHeight !== this._layoutInfo.totalHeight) {
|
|
417
|
-
changeEvent.totalHeight = true;
|
|
418
|
-
somethingChanged = true;
|
|
419
|
-
}
|
|
420
|
-
if (somethingChanged) {
|
|
421
|
-
this._layoutInfo = newLayout;
|
|
422
|
-
this._fireLayoutChangeEvent(changeEvent);
|
|
423
|
-
}
|
|
424
|
-
}
|
|
425
|
-
getHeight(lineHeight) {
|
|
426
|
-
if (this._layoutInfo.layoutState === CellLayoutState.Uninitialized) {
|
|
427
|
-
const editorHeight = this.cellFoldingState === PropertyFoldingState.Collapsed ? 0 : this.computeInputEditorHeight(lineHeight);
|
|
428
|
-
return this._computeTotalHeight(editorHeight);
|
|
429
|
-
}
|
|
430
|
-
else {
|
|
431
|
-
return this._layoutInfo.totalHeight;
|
|
432
|
-
}
|
|
433
|
-
}
|
|
434
|
-
_computeTotalHeight(editorHeight) {
|
|
435
|
-
const totalHeight = editorHeight
|
|
436
|
-
+ this._layoutInfo.editorMargin
|
|
437
|
-
+ this._layoutInfo.metadataHeight
|
|
438
|
-
+ this._layoutInfo.cellStatusHeight
|
|
439
|
-
+ this._layoutInfo.metadataStatusHeight
|
|
440
|
-
+ this._layoutInfo.outputTotalHeight
|
|
441
|
-
+ this._layoutInfo.outputStatusHeight
|
|
442
|
-
+ this._layoutInfo.outputMetadataHeight
|
|
443
|
-
+ this._layoutInfo.bodyMargin;
|
|
444
|
-
return totalHeight;
|
|
445
|
-
}
|
|
446
|
-
computeInputEditorHeight(lineHeight) {
|
|
447
|
-
const lineCount = Math.max(this.original?.textModel.textBuffer.getLineCount() ?? 1, this.modified?.textModel.textBuffer.getLineCount() ?? 1);
|
|
448
|
-
return this.diffEditorHeightCalculator.computeHeightFromLines(lineCount);
|
|
449
|
-
}
|
|
450
|
-
_getOutputTotalHeight(rawOutputHeight, metadataHeight) {
|
|
451
|
-
if (this.outputFoldingState === PropertyFoldingState.Collapsed) {
|
|
452
|
-
return 0;
|
|
453
|
-
}
|
|
454
|
-
if (this.renderOutput) {
|
|
455
|
-
if (this.isOutputEmpty()) {
|
|
456
|
-
return 24;
|
|
457
|
-
}
|
|
458
|
-
return this.getRichOutputTotalHeight() + metadataHeight;
|
|
459
|
-
}
|
|
460
|
-
else {
|
|
461
|
-
return rawOutputHeight;
|
|
462
|
-
}
|
|
463
|
-
}
|
|
464
|
-
_fireLayoutChangeEvent(state) {
|
|
465
|
-
this._layoutInfoEmitter.fire(state);
|
|
466
|
-
this.editorEventDispatcher.emit([{ type: NotebookDiffViewEventType.CellLayoutChanged, source: this._layoutInfo }]);
|
|
467
|
-
}
|
|
468
|
-
getComputedCellContainerWidth(layoutInfo, diffEditor, fullWidth) {
|
|
469
|
-
if (fullWidth) {
|
|
470
|
-
return layoutInfo.width - 2 * DIFF_CELL_MARGIN + (diffEditor ? DiffEditorWidget.ENTIRE_DIFF_OVERVIEW_WIDTH : 0) - 2;
|
|
471
|
-
}
|
|
472
|
-
return (layoutInfo.width - 2 * DIFF_CELL_MARGIN + (diffEditor ? DiffEditorWidget.ENTIRE_DIFF_OVERVIEW_WIDTH : 0)) / 2 - 18 - 2;
|
|
473
|
-
}
|
|
474
|
-
getOutputEditorViewState() {
|
|
475
|
-
return this._outputEditorViewState;
|
|
476
|
-
}
|
|
477
|
-
saveOutputEditorViewState(viewState) {
|
|
478
|
-
this._outputEditorViewState = viewState;
|
|
479
|
-
}
|
|
480
|
-
getMetadataEditorViewState() {
|
|
481
|
-
return this._metadataEditorViewState;
|
|
482
|
-
}
|
|
483
|
-
saveMetadataEditorViewState(viewState) {
|
|
484
|
-
this._metadataEditorViewState = viewState;
|
|
485
|
-
}
|
|
486
|
-
getSourceEditorViewState() {
|
|
487
|
-
return this._sourceEditorViewState;
|
|
488
|
-
}
|
|
489
|
-
saveSpirceEditorViewState(viewState) {
|
|
490
|
-
this._sourceEditorViewState = viewState;
|
|
491
|
-
}
|
|
492
|
-
}
|
|
493
|
-
class SideBySideDiffElementViewModel extends DiffElementCellViewModelBase {
|
|
494
|
-
get originalDocument() {
|
|
495
|
-
return this.otherDocumentTextModel;
|
|
496
|
-
}
|
|
497
|
-
get modifiedDocument() {
|
|
498
|
-
return this.mainDocumentTextModel;
|
|
499
|
-
}
|
|
500
|
-
constructor(mainDocumentTextModel, otherDocumentTextModel, original, modified, type, editorEventDispatcher, initData, notebookService, configurationService, index, diffEditorHeightCalculator) {
|
|
501
|
-
super(mainDocumentTextModel, original, modified, type, editorEventDispatcher, initData, notebookService, index, configurationService, diffEditorHeightCalculator);
|
|
502
|
-
this.otherDocumentTextModel = otherDocumentTextModel;
|
|
503
|
-
this.type = type;
|
|
504
|
-
this.cellFoldingState = this.modified.textModel.getValue() !== this.original.textModel.getValue() ? PropertyFoldingState.Expanded : PropertyFoldingState.Collapsed;
|
|
505
|
-
this.metadataFoldingState = PropertyFoldingState.Collapsed;
|
|
506
|
-
this.outputFoldingState = PropertyFoldingState.Collapsed;
|
|
507
|
-
if (this.checkMetadataIfModified()) {
|
|
508
|
-
this.metadataFoldingState = PropertyFoldingState.Expanded;
|
|
509
|
-
}
|
|
510
|
-
if (this.checkIfOutputsModified()) {
|
|
511
|
-
this.outputFoldingState = PropertyFoldingState.Expanded;
|
|
512
|
-
}
|
|
513
|
-
this._register(this.original.onDidChangeOutputLayout(() => {
|
|
514
|
-
this._layout({ recomputeOutput: true });
|
|
515
|
-
}));
|
|
516
|
-
this._register(this.modified.onDidChangeOutputLayout(() => {
|
|
517
|
-
this._layout({ recomputeOutput: true });
|
|
518
|
-
}));
|
|
519
|
-
this._register(this.modified.textModel.onDidChangeContent(() => {
|
|
520
|
-
if (mainDocumentTextModel.transientOptions.cellContentMetadata) {
|
|
521
|
-
const cellMetadataKeys = [...( Object.keys(mainDocumentTextModel.transientOptions.cellContentMetadata))];
|
|
522
|
-
const modifiedMedataRaw = Object.assign({}, this.modified.metadata);
|
|
523
|
-
const originalCellMetadata = this.original.metadata;
|
|
524
|
-
for (const key of cellMetadataKeys) {
|
|
525
|
-
if (Object.hasOwn(originalCellMetadata, key)) {
|
|
526
|
-
modifiedMedataRaw[key] = originalCellMetadata[key];
|
|
527
|
-
}
|
|
528
|
-
}
|
|
529
|
-
this.modified.textModel.metadata = modifiedMedataRaw;
|
|
530
|
-
}
|
|
531
|
-
}));
|
|
532
|
-
}
|
|
533
|
-
checkIfInputModified() {
|
|
534
|
-
if (this.original.textModel.getTextBufferHash() === this.modified.textModel.getTextBufferHash()) {
|
|
535
|
-
return false;
|
|
536
|
-
}
|
|
537
|
-
return {
|
|
538
|
-
reason: 'Cell content has changed',
|
|
539
|
-
};
|
|
540
|
-
}
|
|
541
|
-
checkIfOutputsModified() {
|
|
542
|
-
if (this.mainDocumentTextModel.transientOptions.transientOutputs || this.ignoreOutputs) {
|
|
543
|
-
return false;
|
|
544
|
-
}
|
|
545
|
-
const ret = outputsEqual(this.original?.outputs ?? [], this.modified?.outputs ?? []);
|
|
546
|
-
if (ret === OutputComparison.Unchanged) {
|
|
547
|
-
return false;
|
|
548
|
-
}
|
|
549
|
-
return {
|
|
550
|
-
reason: ret === OutputComparison.Metadata ? 'Output metadata has changed' : undefined,
|
|
551
|
-
kind: ret
|
|
552
|
-
};
|
|
553
|
-
}
|
|
554
|
-
checkMetadataIfModified() {
|
|
555
|
-
if (this.ignoreMetadata) {
|
|
556
|
-
return false;
|
|
557
|
-
}
|
|
558
|
-
const modified = hash(getFormattedMetadataJSON(this.mainDocumentTextModel.transientOptions.transientCellMetadata, this.original?.metadata || {}, this.original?.language)) !== hash(getFormattedMetadataJSON(this.mainDocumentTextModel.transientOptions.transientCellMetadata, this.modified?.metadata ?? {}, this.modified?.language));
|
|
559
|
-
if (modified) {
|
|
560
|
-
return { reason: undefined };
|
|
561
|
-
}
|
|
562
|
-
else {
|
|
563
|
-
return false;
|
|
564
|
-
}
|
|
565
|
-
}
|
|
566
|
-
updateOutputHeight(diffSide, index, height) {
|
|
567
|
-
if (diffSide === DiffSide.Original) {
|
|
568
|
-
this.original.updateOutputHeight(index, height);
|
|
569
|
-
}
|
|
570
|
-
else {
|
|
571
|
-
this.modified.updateOutputHeight(index, height);
|
|
572
|
-
}
|
|
573
|
-
}
|
|
574
|
-
getOutputOffsetInContainer(diffSide, index) {
|
|
575
|
-
if (diffSide === DiffSide.Original) {
|
|
576
|
-
return this.original.getOutputOffset(index);
|
|
577
|
-
}
|
|
578
|
-
else {
|
|
579
|
-
return this.modified.getOutputOffset(index);
|
|
580
|
-
}
|
|
581
|
-
}
|
|
582
|
-
getOutputOffsetInCell(diffSide, index) {
|
|
583
|
-
const offsetInOutputsContainer = this.getOutputOffsetInContainer(diffSide, index);
|
|
584
|
-
return this._layoutInfo.editorHeight
|
|
585
|
-
+ this._layoutInfo.editorMargin
|
|
586
|
-
+ this._layoutInfo.metadataHeight
|
|
587
|
-
+ this._layoutInfo.cellStatusHeight
|
|
588
|
-
+ this._layoutInfo.metadataStatusHeight
|
|
589
|
-
+ this._layoutInfo.outputStatusHeight
|
|
590
|
-
+ this._layoutInfo.bodyMargin / 2
|
|
591
|
-
+ offsetInOutputsContainer;
|
|
592
|
-
}
|
|
593
|
-
isOutputEmpty() {
|
|
594
|
-
if (this.mainDocumentTextModel.transientOptions.transientOutputs) {
|
|
595
|
-
return true;
|
|
596
|
-
}
|
|
597
|
-
if (this.checkIfOutputsModified()) {
|
|
598
|
-
return false;
|
|
599
|
-
}
|
|
600
|
-
return (this.original?.outputs || []).length === 0;
|
|
601
|
-
}
|
|
602
|
-
getRichOutputTotalHeight() {
|
|
603
|
-
return Math.max(this.original.getOutputTotalHeight(), this.modified.getOutputTotalHeight());
|
|
604
|
-
}
|
|
605
|
-
getNestedCellViewModel(diffSide) {
|
|
606
|
-
return diffSide === DiffSide.Original ? this.original : this.modified;
|
|
607
|
-
}
|
|
608
|
-
getCellByUri(cellUri) {
|
|
609
|
-
if (( cellUri.toString()) === ( this.original.uri.toString())) {
|
|
610
|
-
return this.original;
|
|
611
|
-
}
|
|
612
|
-
else {
|
|
613
|
-
return this.modified;
|
|
614
|
-
}
|
|
615
|
-
}
|
|
616
|
-
computeInputEditorHeight(lineHeight) {
|
|
617
|
-
if (this.type === 'modified' &&
|
|
618
|
-
typeof this.editorHeightWithUnchangedLinesCollapsed === 'number' &&
|
|
619
|
-
this.checkIfInputModified()) {
|
|
620
|
-
return this.editorHeightWithUnchangedLinesCollapsed;
|
|
621
|
-
}
|
|
622
|
-
return super.computeInputEditorHeight(lineHeight);
|
|
623
|
-
}
|
|
624
|
-
async computeModifiedInputEditorHeight() {
|
|
625
|
-
if (this.checkIfInputModified()) {
|
|
626
|
-
this.editorHeightWithUnchangedLinesCollapsed = this._layoutInfo.editorHeight = await this.diffEditorHeightCalculator.diffAndComputeHeight(this.original.uri, this.modified.uri);
|
|
627
|
-
}
|
|
628
|
-
}
|
|
629
|
-
async computeModifiedMetadataEditorHeight() {
|
|
630
|
-
if (this.checkMetadataIfModified()) {
|
|
631
|
-
const originalMetadataUri = CellUri.generateCellPropertyUri(this.originalDocument.uri, this.original.handle, Schemas.vscodeNotebookCellMetadata);
|
|
632
|
-
const modifiedMetadataUri = CellUri.generateCellPropertyUri(this.modifiedDocument.uri, this.modified.handle, Schemas.vscodeNotebookCellMetadata);
|
|
633
|
-
this._layoutInfo.metadataHeight = await this.diffEditorHeightCalculator.diffAndComputeHeight(originalMetadataUri, modifiedMetadataUri);
|
|
634
|
-
}
|
|
635
|
-
}
|
|
636
|
-
async computeEditorHeights() {
|
|
637
|
-
if (this.type === 'unchanged') {
|
|
638
|
-
return;
|
|
639
|
-
}
|
|
640
|
-
await Promise.all([this.computeModifiedInputEditorHeight(), this.computeModifiedMetadataEditorHeight()]);
|
|
641
|
-
}
|
|
642
|
-
}
|
|
643
|
-
class SingleSideDiffElementViewModel extends DiffElementCellViewModelBase {
|
|
644
|
-
get cellViewModel() {
|
|
645
|
-
return this.type === 'insert' ? this.modified : this.original;
|
|
646
|
-
}
|
|
647
|
-
get originalDocument() {
|
|
648
|
-
if (this.type === 'insert') {
|
|
649
|
-
return this.otherDocumentTextModel;
|
|
650
|
-
}
|
|
651
|
-
else {
|
|
652
|
-
return this.mainDocumentTextModel;
|
|
653
|
-
}
|
|
654
|
-
}
|
|
655
|
-
get modifiedDocument() {
|
|
656
|
-
if (this.type === 'insert') {
|
|
657
|
-
return this.mainDocumentTextModel;
|
|
658
|
-
}
|
|
659
|
-
else {
|
|
660
|
-
return this.otherDocumentTextModel;
|
|
661
|
-
}
|
|
662
|
-
}
|
|
663
|
-
constructor(mainDocumentTextModel, otherDocumentTextModel, original, modified, type, editorEventDispatcher, initData, notebookService, configurationService, diffEditorHeightCalculator, index) {
|
|
664
|
-
super(mainDocumentTextModel, original, modified, type, editorEventDispatcher, initData, notebookService, index, configurationService, diffEditorHeightCalculator);
|
|
665
|
-
this.otherDocumentTextModel = otherDocumentTextModel;
|
|
666
|
-
this.type = type;
|
|
667
|
-
this._register(this.cellViewModel.onDidChangeOutputLayout(() => {
|
|
668
|
-
this._layout({ recomputeOutput: true });
|
|
669
|
-
}));
|
|
670
|
-
}
|
|
671
|
-
checkIfInputModified() {
|
|
672
|
-
return {
|
|
673
|
-
reason: 'Cell content has changed',
|
|
674
|
-
};
|
|
675
|
-
}
|
|
676
|
-
getNestedCellViewModel(diffSide) {
|
|
677
|
-
return this.type === 'insert' ? this.modified : this.original;
|
|
678
|
-
}
|
|
679
|
-
checkIfOutputsModified() {
|
|
680
|
-
return false;
|
|
681
|
-
}
|
|
682
|
-
checkMetadataIfModified() {
|
|
683
|
-
return false;
|
|
684
|
-
}
|
|
685
|
-
updateOutputHeight(diffSide, index, height) {
|
|
686
|
-
this.cellViewModel?.updateOutputHeight(index, height);
|
|
687
|
-
}
|
|
688
|
-
getOutputOffsetInContainer(diffSide, index) {
|
|
689
|
-
return this.cellViewModel.getOutputOffset(index);
|
|
690
|
-
}
|
|
691
|
-
getOutputOffsetInCell(diffSide, index) {
|
|
692
|
-
const offsetInOutputsContainer = this.cellViewModel.getOutputOffset(index);
|
|
693
|
-
return this._layoutInfo.editorHeight
|
|
694
|
-
+ this._layoutInfo.editorMargin
|
|
695
|
-
+ this._layoutInfo.metadataHeight
|
|
696
|
-
+ this._layoutInfo.cellStatusHeight
|
|
697
|
-
+ this._layoutInfo.metadataStatusHeight
|
|
698
|
-
+ this._layoutInfo.outputStatusHeight
|
|
699
|
-
+ this._layoutInfo.bodyMargin / 2
|
|
700
|
-
+ offsetInOutputsContainer;
|
|
701
|
-
}
|
|
702
|
-
isOutputEmpty() {
|
|
703
|
-
if (this.mainDocumentTextModel.transientOptions.transientOutputs) {
|
|
704
|
-
return true;
|
|
705
|
-
}
|
|
706
|
-
return (this.original?.outputs || this.modified?.outputs || []).length === 0;
|
|
707
|
-
}
|
|
708
|
-
getRichOutputTotalHeight() {
|
|
709
|
-
return this.cellViewModel?.getOutputTotalHeight() ?? 0;
|
|
710
|
-
}
|
|
711
|
-
getCellByUri(cellUri) {
|
|
712
|
-
return this.cellViewModel;
|
|
713
|
-
}
|
|
714
|
-
}
|
|
715
|
-
var OutputComparison;
|
|
716
|
-
(function (OutputComparison) {
|
|
717
|
-
OutputComparison[OutputComparison["Unchanged"] = 0] = "Unchanged";
|
|
718
|
-
OutputComparison[OutputComparison["Metadata"] = 1] = "Metadata";
|
|
719
|
-
OutputComparison[OutputComparison["Other"] = 2] = "Other";
|
|
720
|
-
})(OutputComparison || (OutputComparison = {}));
|
|
721
|
-
function outputEqual(a, b) {
|
|
722
|
-
if (hash(a.metadata) === hash(b.metadata)) {
|
|
723
|
-
return OutputComparison.Other;
|
|
724
|
-
}
|
|
725
|
-
for (let j = 0; j < a.outputs.length; j++) {
|
|
726
|
-
const aOutputItem = a.outputs[j];
|
|
727
|
-
const bOutputItem = b.outputs[j];
|
|
728
|
-
if (aOutputItem.mime !== bOutputItem.mime) {
|
|
729
|
-
return OutputComparison.Other;
|
|
730
|
-
}
|
|
731
|
-
if (aOutputItem.data.buffer.length !== bOutputItem.data.buffer.length) {
|
|
732
|
-
return OutputComparison.Other;
|
|
733
|
-
}
|
|
734
|
-
for (let k = 0; k < aOutputItem.data.buffer.length; k++) {
|
|
735
|
-
if (aOutputItem.data.buffer[k] !== bOutputItem.data.buffer[k]) {
|
|
736
|
-
return OutputComparison.Other;
|
|
737
|
-
}
|
|
738
|
-
}
|
|
739
|
-
}
|
|
740
|
-
return OutputComparison.Metadata;
|
|
741
|
-
}
|
|
742
|
-
function outputsEqual(original, modified) {
|
|
743
|
-
if (original.length !== modified.length) {
|
|
744
|
-
return OutputComparison.Other;
|
|
745
|
-
}
|
|
746
|
-
const len = original.length;
|
|
747
|
-
for (let i = 0; i < len; i++) {
|
|
748
|
-
const a = original[i];
|
|
749
|
-
const b = modified[i];
|
|
750
|
-
if (hash(a.metadata) !== hash(b.metadata)) {
|
|
751
|
-
return OutputComparison.Metadata;
|
|
752
|
-
}
|
|
753
|
-
if (a.outputs.length !== b.outputs.length) {
|
|
754
|
-
return OutputComparison.Other;
|
|
755
|
-
}
|
|
756
|
-
for (let j = 0; j < a.outputs.length; j++) {
|
|
757
|
-
const aOutputItem = a.outputs[j];
|
|
758
|
-
const bOutputItem = b.outputs[j];
|
|
759
|
-
if (aOutputItem.mime !== bOutputItem.mime) {
|
|
760
|
-
return OutputComparison.Other;
|
|
761
|
-
}
|
|
762
|
-
if (aOutputItem.data.buffer.length !== bOutputItem.data.buffer.length) {
|
|
763
|
-
return OutputComparison.Other;
|
|
764
|
-
}
|
|
765
|
-
for (let k = 0; k < aOutputItem.data.buffer.length; k++) {
|
|
766
|
-
if (aOutputItem.data.buffer[k] !== bOutputItem.data.buffer[k]) {
|
|
767
|
-
return OutputComparison.Other;
|
|
768
|
-
}
|
|
769
|
-
}
|
|
770
|
-
}
|
|
771
|
-
}
|
|
772
|
-
return OutputComparison.Unchanged;
|
|
773
|
-
}
|
|
774
|
-
function getStreamOutputData(outputs) {
|
|
775
|
-
if (!outputs.length) {
|
|
776
|
-
return null;
|
|
777
|
-
}
|
|
778
|
-
const first = outputs[0];
|
|
779
|
-
const mime = first.mime;
|
|
780
|
-
const sameStream = !outputs.find(op => op.mime !== mime);
|
|
781
|
-
if (sameStream) {
|
|
782
|
-
return ( outputs.map(opit => ( opit.data.toString()))).join('');
|
|
783
|
-
}
|
|
784
|
-
else {
|
|
785
|
-
return null;
|
|
786
|
-
}
|
|
787
|
-
}
|
|
788
|
-
function getFormattedOutputJSON(outputs) {
|
|
789
|
-
if (outputs.length === 1) {
|
|
790
|
-
const streamOutputData = getStreamOutputData(outputs[0].outputs);
|
|
791
|
-
if (streamOutputData) {
|
|
792
|
-
return streamOutputData;
|
|
793
|
-
}
|
|
794
|
-
}
|
|
795
|
-
return JSON.stringify(( outputs.map(output => {
|
|
796
|
-
return ({
|
|
797
|
-
metadata: output.metadata,
|
|
798
|
-
outputItems: ( output.outputs.map(opit => ({
|
|
799
|
-
mimeType: opit.mime,
|
|
800
|
-
data: ( opit.data.toString())
|
|
801
|
-
})))
|
|
802
|
-
});
|
|
803
|
-
})), undefined, '\t');
|
|
804
|
-
}
|
|
805
|
-
|
|
806
|
-
export { DefaultLineHeight, DiffElementCellViewModelBase, DiffElementPlaceholderViewModel, DiffElementViewModelBase, HeightOfHiddenLinesRegionInDiffEditor, NotebookDocumentMetadataViewModel, OUTPUT_EDITOR_HEIGHT_MAGIC, OutputComparison, PropertyFoldingState, SideBySideDiffElementViewModel, SingleSideDiffElementViewModel, getFormattedOutputJSON, getStreamOutputData, outputEqual };
|