@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,51 @@
|
|
|
1
|
+
import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
|
|
2
|
+
import { ILanguageService } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/languages/language.service";
|
|
3
|
+
import { NotebookTextModel } from "@codingame/monaco-vscode-notebook-service-override/vscode/vs/workbench/contrib/notebook/common/model/notebookTextModel";
|
|
4
|
+
import { CellDiffInfo } from "../notebookDiffViewModel.js";
|
|
5
|
+
import { INotebookEditor } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/browser/notebookBrowser";
|
|
6
|
+
import { MenuId } from "@codingame/monaco-vscode-api/vscode/vs/platform/actions/common/actions";
|
|
7
|
+
import { IInstantiationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation";
|
|
8
|
+
import { IActionViewItemProvider } from "@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/actionbar/actionbar";
|
|
9
|
+
export interface INotebookDeletedCellDecorator {
|
|
10
|
+
getTop(deletedIndex: number): number | undefined;
|
|
11
|
+
}
|
|
12
|
+
export declare class NotebookDeletedCellDecorator extends Disposable implements INotebookDeletedCellDecorator {
|
|
13
|
+
private readonly _notebookEditor;
|
|
14
|
+
private readonly toolbar;
|
|
15
|
+
private readonly languageService;
|
|
16
|
+
private readonly instantiationService;
|
|
17
|
+
private readonly zoneRemover;
|
|
18
|
+
private readonly createdViewZones;
|
|
19
|
+
private readonly deletedCellInfos;
|
|
20
|
+
constructor(_notebookEditor: INotebookEditor, toolbar: {
|
|
21
|
+
menuId: MenuId;
|
|
22
|
+
className: string;
|
|
23
|
+
telemetrySource?: string;
|
|
24
|
+
argFactory: (deletedCellIndex: number) => any;
|
|
25
|
+
actionViewItemProvider?: IActionViewItemProvider;
|
|
26
|
+
} | undefined, languageService: ILanguageService, instantiationService: IInstantiationService);
|
|
27
|
+
getTop(deletedIndex: number): number | undefined;
|
|
28
|
+
reveal(deletedIndex: number): void;
|
|
29
|
+
apply(diffInfo: CellDiffInfo[], original: NotebookTextModel): void;
|
|
30
|
+
clear(): void;
|
|
31
|
+
private _createWidget;
|
|
32
|
+
private _createWidgetImpl;
|
|
33
|
+
}
|
|
34
|
+
export declare class NotebookDeletedCellWidget extends Disposable {
|
|
35
|
+
private readonly _notebookEditor;
|
|
36
|
+
private readonly _toolbarOptions;
|
|
37
|
+
private readonly code;
|
|
38
|
+
private readonly language;
|
|
39
|
+
private readonly _originalIndex;
|
|
40
|
+
private readonly languageService;
|
|
41
|
+
private readonly instantiationService;
|
|
42
|
+
private readonly container;
|
|
43
|
+
constructor(_notebookEditor: INotebookEditor, _toolbarOptions: {
|
|
44
|
+
menuId: MenuId;
|
|
45
|
+
className: string;
|
|
46
|
+
telemetrySource?: string;
|
|
47
|
+
argFactory: (deletedCellIndex: number) => any;
|
|
48
|
+
actionViewItemProvider?: IActionViewItemProvider;
|
|
49
|
+
} | undefined, code: string, language: string, container: HTMLElement, _originalIndex: number, languageService: ILanguageService, instantiationService: IInstantiationService);
|
|
50
|
+
render(): Promise<number>;
|
|
51
|
+
}
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
|
|
2
|
+
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
|
+
import { createTrustedTypesPolicy } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/trustedTypes';
|
|
4
|
+
import { Disposable, DisposableStore, toDisposable, dispose } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
5
|
+
import { splitLines } from '@codingame/monaco-vscode-api/vscode/vs/base/common/strings';
|
|
6
|
+
import { EditorOption } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/config/editorOptions';
|
|
7
|
+
import { ILanguageService } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/languages/language.service';
|
|
8
|
+
import { tokenizeToString } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/languages/textToHtmlTokenizer';
|
|
9
|
+
import { DefaultLineHeight } from '../diffElementViewModel.js';
|
|
10
|
+
import { NotebookOverviewRulerLane } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/browser/notebookBrowser';
|
|
11
|
+
import { createElement, append, $ } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/dom';
|
|
12
|
+
import { MenuWorkbenchToolBar, HiddenItemStrategy } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/browser/toolbar';
|
|
13
|
+
import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
|
|
14
|
+
import { ServiceCollection } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/serviceCollection';
|
|
15
|
+
import { IContextKeyService } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey.service';
|
|
16
|
+
import { overviewRulerDeletedForeground } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/scm/common/quickDiff';
|
|
17
|
+
|
|
18
|
+
const ttPolicy = createTrustedTypesPolicy('notebookRenderer', { createHTML: value => value });
|
|
19
|
+
let NotebookDeletedCellDecorator = class NotebookDeletedCellDecorator extends Disposable {
|
|
20
|
+
constructor(_notebookEditor, toolbar, languageService, instantiationService) {
|
|
21
|
+
super();
|
|
22
|
+
this._notebookEditor = _notebookEditor;
|
|
23
|
+
this.toolbar = toolbar;
|
|
24
|
+
this.languageService = languageService;
|
|
25
|
+
this.instantiationService = instantiationService;
|
|
26
|
+
this.zoneRemover = this._register(( new DisposableStore()));
|
|
27
|
+
this.createdViewZones = ( new Map());
|
|
28
|
+
this.deletedCellInfos = ( new Map());
|
|
29
|
+
}
|
|
30
|
+
getTop(deletedIndex) {
|
|
31
|
+
const info = this.deletedCellInfos.get(deletedIndex);
|
|
32
|
+
if (!info) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
if (info.previousIndex === -1) {
|
|
36
|
+
return 0;
|
|
37
|
+
}
|
|
38
|
+
const cells = this._notebookEditor.getCellsInRange({ start: info.previousIndex, end: info.previousIndex + 1 });
|
|
39
|
+
if (!cells.length) {
|
|
40
|
+
return this._notebookEditor.getLayoutInfo().height + info.offset;
|
|
41
|
+
}
|
|
42
|
+
const cell = cells[0];
|
|
43
|
+
const cellHeight = this._notebookEditor.getHeightOfElement(cell);
|
|
44
|
+
const top = this._notebookEditor.getAbsoluteTopOfElement(cell);
|
|
45
|
+
return top + cellHeight + info.offset;
|
|
46
|
+
}
|
|
47
|
+
reveal(deletedIndex) {
|
|
48
|
+
const top = this.getTop(deletedIndex);
|
|
49
|
+
if (typeof top === 'number') {
|
|
50
|
+
this._notebookEditor.focusContainer();
|
|
51
|
+
this._notebookEditor.revealOffsetInCenterIfOutsideViewport(top);
|
|
52
|
+
const info = this.deletedCellInfos.get(deletedIndex);
|
|
53
|
+
if (info) {
|
|
54
|
+
const prevIndex = info.previousIndex === -1 ? 0 : info.previousIndex;
|
|
55
|
+
this._notebookEditor.setFocus({ start: prevIndex, end: prevIndex });
|
|
56
|
+
this._notebookEditor.setSelections([{ start: prevIndex, end: prevIndex }]);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
apply(diffInfo, original) {
|
|
61
|
+
this.clear();
|
|
62
|
+
let currentIndex = -1;
|
|
63
|
+
const deletedCellsToRender = { cells: [], index: 0 };
|
|
64
|
+
diffInfo.forEach(diff => {
|
|
65
|
+
if (diff.type === 'delete') {
|
|
66
|
+
const deletedCell = original.cells[diff.originalCellIndex];
|
|
67
|
+
if (deletedCell) {
|
|
68
|
+
deletedCellsToRender.cells.push({ cell: deletedCell, originalIndex: diff.originalCellIndex, previousIndex: currentIndex });
|
|
69
|
+
deletedCellsToRender.index = currentIndex;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
if (deletedCellsToRender.cells.length) {
|
|
74
|
+
this._createWidget(deletedCellsToRender.index + 1, deletedCellsToRender.cells);
|
|
75
|
+
deletedCellsToRender.cells.length = 0;
|
|
76
|
+
}
|
|
77
|
+
currentIndex = diff.modifiedCellIndex;
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
if (deletedCellsToRender.cells.length) {
|
|
81
|
+
this._createWidget(deletedCellsToRender.index + 1, deletedCellsToRender.cells);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
clear() {
|
|
85
|
+
this.deletedCellInfos.clear();
|
|
86
|
+
this.zoneRemover.clear();
|
|
87
|
+
}
|
|
88
|
+
_createWidget(index, cells) {
|
|
89
|
+
this._createWidgetImpl(index, cells);
|
|
90
|
+
}
|
|
91
|
+
async _createWidgetImpl(index, cells) {
|
|
92
|
+
const rootContainer = createElement('div');
|
|
93
|
+
const widgets = [];
|
|
94
|
+
const heights = await Promise.all(( cells.map(async (cell) => {
|
|
95
|
+
const widget = ( new NotebookDeletedCellWidget(
|
|
96
|
+
this._notebookEditor,
|
|
97
|
+
this.toolbar,
|
|
98
|
+
cell.cell.getValue(),
|
|
99
|
+
cell.cell.language,
|
|
100
|
+
rootContainer,
|
|
101
|
+
cell.originalIndex,
|
|
102
|
+
this.languageService,
|
|
103
|
+
this.instantiationService
|
|
104
|
+
));
|
|
105
|
+
widgets.push(widget);
|
|
106
|
+
const height = await widget.render();
|
|
107
|
+
this.deletedCellInfos.set(cell.originalIndex, { height, previousIndex: cell.previousIndex, offset: 0 });
|
|
108
|
+
return height;
|
|
109
|
+
})));
|
|
110
|
+
Array.from(( this.deletedCellInfos.keys())).sort((a, b) => a - b).forEach((originalIndex) => {
|
|
111
|
+
const previousDeletedCell = this.deletedCellInfos.get(originalIndex - 1);
|
|
112
|
+
if (previousDeletedCell) {
|
|
113
|
+
const deletedCell = this.deletedCellInfos.get(originalIndex);
|
|
114
|
+
if (deletedCell) {
|
|
115
|
+
deletedCell.offset = previousDeletedCell.height + previousDeletedCell.offset;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
const totalHeight = heights.reduce((prev, curr) => prev + curr, 0);
|
|
120
|
+
this._notebookEditor.changeViewZones(accessor => {
|
|
121
|
+
const notebookViewZone = {
|
|
122
|
+
afterModelPosition: index,
|
|
123
|
+
heightInPx: totalHeight + 4,
|
|
124
|
+
domNode: rootContainer
|
|
125
|
+
};
|
|
126
|
+
const id = accessor.addZone(notebookViewZone);
|
|
127
|
+
accessor.layoutZone(id);
|
|
128
|
+
this.createdViewZones.set(index, id);
|
|
129
|
+
const deletedCellOverviewRulereDecorationIds = this._notebookEditor.deltaCellDecorations([], [{
|
|
130
|
+
viewZoneId: id,
|
|
131
|
+
options: {
|
|
132
|
+
overviewRuler: {
|
|
133
|
+
color: overviewRulerDeletedForeground,
|
|
134
|
+
position: NotebookOverviewRulerLane.Center,
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}]);
|
|
138
|
+
this.zoneRemover.add(toDisposable(() => {
|
|
139
|
+
if (this.createdViewZones.get(index) === id) {
|
|
140
|
+
this.createdViewZones.delete(index);
|
|
141
|
+
}
|
|
142
|
+
if (!this._notebookEditor.isDisposed) {
|
|
143
|
+
this._notebookEditor.changeViewZones(accessor => {
|
|
144
|
+
accessor.removeZone(id);
|
|
145
|
+
dispose(widgets);
|
|
146
|
+
});
|
|
147
|
+
this._notebookEditor.deltaCellDecorations(deletedCellOverviewRulereDecorationIds, []);
|
|
148
|
+
}
|
|
149
|
+
}));
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
NotebookDeletedCellDecorator = ( __decorate([
|
|
154
|
+
( __param(2, ILanguageService)),
|
|
155
|
+
( __param(3, IInstantiationService))
|
|
156
|
+
], NotebookDeletedCellDecorator));
|
|
157
|
+
let NotebookDeletedCellWidget = class NotebookDeletedCellWidget extends Disposable {
|
|
158
|
+
constructor(_notebookEditor, _toolbarOptions, code, language, container, _originalIndex, languageService, instantiationService) {
|
|
159
|
+
super();
|
|
160
|
+
this._notebookEditor = _notebookEditor;
|
|
161
|
+
this._toolbarOptions = _toolbarOptions;
|
|
162
|
+
this.code = code;
|
|
163
|
+
this.language = language;
|
|
164
|
+
this._originalIndex = _originalIndex;
|
|
165
|
+
this.languageService = languageService;
|
|
166
|
+
this.instantiationService = instantiationService;
|
|
167
|
+
this.container = append(container, createElement('div'));
|
|
168
|
+
this._register(toDisposable(() => {
|
|
169
|
+
container.removeChild(this.container);
|
|
170
|
+
}));
|
|
171
|
+
}
|
|
172
|
+
async render() {
|
|
173
|
+
const code = this.code;
|
|
174
|
+
const languageId = this.language;
|
|
175
|
+
const codeHtml = await tokenizeToString(this.languageService, code, languageId);
|
|
176
|
+
const fontInfo = this._notebookEditor.getBaseCellEditorOptions(languageId).value;
|
|
177
|
+
const fontFamilyVar = '--notebook-editor-font-family';
|
|
178
|
+
const fontSizeVar = '--notebook-editor-font-size';
|
|
179
|
+
const fontWeightVar = '--notebook-editor-font-weight';
|
|
180
|
+
const editor = ( this._notebookEditor.codeEditors.map(c => c[1])).find(c => c);
|
|
181
|
+
const layoutInfo = editor?.getOptions().get(EditorOption.layoutInfo);
|
|
182
|
+
const style = ``
|
|
183
|
+
+ `font-family: var(${fontFamilyVar});`
|
|
184
|
+
+ `font-weight: var(${fontWeightVar});`
|
|
185
|
+
+ `font-size: var(${fontSizeVar});`
|
|
186
|
+
+ fontInfo.lineHeight ? `line-height: ${fontInfo.lineHeight}px;` : ''
|
|
187
|
+
+ layoutInfo?.contentLeft ? `margin-left: ${layoutInfo}px;` : ''
|
|
188
|
+
+ `white-space: pre;`;
|
|
189
|
+
const rootContainer = this.container;
|
|
190
|
+
rootContainer.classList.add('code-cell-row');
|
|
191
|
+
if (this._toolbarOptions) {
|
|
192
|
+
const toolbar = createElement('div');
|
|
193
|
+
toolbar.className = this._toolbarOptions.className;
|
|
194
|
+
rootContainer.appendChild(toolbar);
|
|
195
|
+
const scopedInstaService = this._register(this.instantiationService.createChild(( new ServiceCollection([IContextKeyService, this._notebookEditor.scopedContextKeyService]))));
|
|
196
|
+
const toolbarWidget = scopedInstaService.createInstance(MenuWorkbenchToolBar, toolbar, this._toolbarOptions.menuId, {
|
|
197
|
+
telemetrySource: this._toolbarOptions.telemetrySource,
|
|
198
|
+
hiddenItemStrategy: HiddenItemStrategy.NoHide,
|
|
199
|
+
toolbarOptions: { primaryGroup: () => true },
|
|
200
|
+
menuOptions: {
|
|
201
|
+
renderShortTitle: true,
|
|
202
|
+
arg: this._toolbarOptions.argFactory(this._originalIndex),
|
|
203
|
+
},
|
|
204
|
+
actionViewItemProvider: this._toolbarOptions.actionViewItemProvider
|
|
205
|
+
});
|
|
206
|
+
this._store.add(toolbarWidget);
|
|
207
|
+
toolbar.style.position = 'absolute';
|
|
208
|
+
toolbar.style.right = '40px';
|
|
209
|
+
toolbar.style.zIndex = '10';
|
|
210
|
+
toolbar.classList.add('hover');
|
|
211
|
+
}
|
|
212
|
+
const container = append(rootContainer, $('.cell-inner-container'));
|
|
213
|
+
container.style.position = 'relative';
|
|
214
|
+
const focusIndicatorLeft = append(container, $('.cell-focus-indicator.cell-focus-indicator-side.cell-focus-indicator-left'));
|
|
215
|
+
const cellContainer = append(container, $('.cell.code'));
|
|
216
|
+
append(focusIndicatorLeft, $('div.execution-count-label'));
|
|
217
|
+
const editorPart = append(cellContainer, $('.cell-editor-part'));
|
|
218
|
+
let editorContainer = append(editorPart, $('.cell-editor-container'));
|
|
219
|
+
editorContainer = append(editorContainer, $('.code', { style }));
|
|
220
|
+
if (fontInfo.fontFamily) {
|
|
221
|
+
editorContainer.style.setProperty(fontFamilyVar, fontInfo.fontFamily);
|
|
222
|
+
}
|
|
223
|
+
if (fontInfo.fontSize) {
|
|
224
|
+
editorContainer.style.setProperty(fontSizeVar, `${fontInfo.fontSize}px`);
|
|
225
|
+
}
|
|
226
|
+
if (fontInfo.fontWeight) {
|
|
227
|
+
editorContainer.style.setProperty(fontWeightVar, fontInfo.fontWeight);
|
|
228
|
+
}
|
|
229
|
+
editorContainer.innerHTML = (ttPolicy?.createHTML(codeHtml) || codeHtml);
|
|
230
|
+
const lineCount = splitLines(code).length;
|
|
231
|
+
const height = (lineCount * (fontInfo.lineHeight || DefaultLineHeight)) + 12 + 12;
|
|
232
|
+
const totalHeight = height + 16 + 16;
|
|
233
|
+
return totalHeight;
|
|
234
|
+
}
|
|
235
|
+
};
|
|
236
|
+
NotebookDeletedCellWidget = ( __decorate([
|
|
237
|
+
( __param(6, ILanguageService)),
|
|
238
|
+
( __param(7, IInstantiationService))
|
|
239
|
+
], NotebookDeletedCellWidget));
|
|
240
|
+
|
|
241
|
+
export { NotebookDeletedCellDecorator, NotebookDeletedCellWidget };
|
package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInlineDiff.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
|
|
2
|
+
import { IInstantiationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation";
|
|
3
|
+
import { INotebookEditorWorkerService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/services/notebookWorkerService.service";
|
|
4
|
+
import { INotebookEditorContribution, INotebookEditor } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/browser/notebookBrowser";
|
|
5
|
+
import { INotebookLoggingService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookLoggingService.service";
|
|
6
|
+
export declare class NotebookInlineDiffDecorationContribution extends Disposable implements INotebookEditorContribution {
|
|
7
|
+
private readonly notebookEditor;
|
|
8
|
+
private readonly notebookEditorWorkerService;
|
|
9
|
+
private readonly instantiationService;
|
|
10
|
+
private readonly logService;
|
|
11
|
+
static ID: string;
|
|
12
|
+
private previous?;
|
|
13
|
+
private insertedCellDecorator;
|
|
14
|
+
private deletedCellDecorator;
|
|
15
|
+
private readonly cellDecorators;
|
|
16
|
+
private cachedNotebookDiff?;
|
|
17
|
+
private listeners;
|
|
18
|
+
constructor(notebookEditor: INotebookEditor, notebookEditorWorkerService: INotebookEditorWorkerService, instantiationService: IInstantiationService, logService: INotebookLoggingService);
|
|
19
|
+
private clear;
|
|
20
|
+
dispose(): void;
|
|
21
|
+
private initialize;
|
|
22
|
+
private _update;
|
|
23
|
+
private updateCells;
|
|
24
|
+
}
|
package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInlineDiff.js
ADDED
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
|
|
2
|
+
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
|
+
import { Event } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
|
|
4
|
+
import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
5
|
+
import '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/index';
|
|
6
|
+
import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
|
|
7
|
+
import { INotebookEditorWorkerService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/services/notebookWorkerService.service';
|
|
8
|
+
import { registerNotebookContribution } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/browser/notebookEditorExtensions';
|
|
9
|
+
import { NotebookCellDiffDecorator } from './notebookCellDiffDecorator.js';
|
|
10
|
+
import { NotebookDeletedCellDecorator } from './notebookDeletedCellDecorator.js';
|
|
11
|
+
import { NotebookInsertedCellDecorator } from './notebookInsertedCellDecorator.js';
|
|
12
|
+
import { INotebookLoggingService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookLoggingService.service';
|
|
13
|
+
import { computeDiff } from '../../../common/notebookDiff.js';
|
|
14
|
+
import '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/extensions';
|
|
15
|
+
import './notebookOriginalModelRefFactory.js';
|
|
16
|
+
import './notebookOriginalCellModelFactory.js';
|
|
17
|
+
import { autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/reactions/autorun';
|
|
18
|
+
|
|
19
|
+
let NotebookInlineDiffDecorationContribution = class NotebookInlineDiffDecorationContribution extends Disposable {
|
|
20
|
+
static { this.ID = 'workbench.notebook.inlineDiffDecoration'; }
|
|
21
|
+
constructor(notebookEditor, notebookEditorWorkerService, instantiationService, logService) {
|
|
22
|
+
super();
|
|
23
|
+
this.notebookEditor = notebookEditor;
|
|
24
|
+
this.notebookEditorWorkerService = notebookEditorWorkerService;
|
|
25
|
+
this.instantiationService = instantiationService;
|
|
26
|
+
this.logService = logService;
|
|
27
|
+
this.cellDecorators = ( new Map());
|
|
28
|
+
this.listeners = [];
|
|
29
|
+
this.logService.debug('inlineDiff', 'Watching for previous model');
|
|
30
|
+
this._register(autorun((reader) => {
|
|
31
|
+
this.previous = this.notebookEditor.notebookOptions.previousModelToCompare.read(reader);
|
|
32
|
+
if (this.previous) {
|
|
33
|
+
this.logService.debug('inlineDiff', 'Previous model set');
|
|
34
|
+
if (this.notebookEditor.hasModel()) {
|
|
35
|
+
this.initialize();
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
this.logService.debug('inlineDiff', 'Waiting for model to attach');
|
|
39
|
+
this.listeners.push(Event.once(this.notebookEditor.onDidAttachViewModel)(() => this.initialize()));
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}));
|
|
43
|
+
}
|
|
44
|
+
clear() {
|
|
45
|
+
this.listeners.forEach(l => l.dispose());
|
|
46
|
+
this.cellDecorators.forEach((v, cell) => {
|
|
47
|
+
v.dispose();
|
|
48
|
+
this.cellDecorators.delete(cell);
|
|
49
|
+
});
|
|
50
|
+
this.insertedCellDecorator?.dispose();
|
|
51
|
+
this.deletedCellDecorator?.dispose();
|
|
52
|
+
this.cachedNotebookDiff = undefined;
|
|
53
|
+
this.listeners = [];
|
|
54
|
+
this.logService.debug('inlineDiff', 'Cleared decorations and listeners');
|
|
55
|
+
}
|
|
56
|
+
dispose() {
|
|
57
|
+
this.logService.debug('inlineDiff', 'Disposing');
|
|
58
|
+
this.clear();
|
|
59
|
+
super.dispose();
|
|
60
|
+
}
|
|
61
|
+
initialize() {
|
|
62
|
+
this.clear();
|
|
63
|
+
if (!this.previous) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
this.insertedCellDecorator = this.instantiationService.createInstance(NotebookInsertedCellDecorator, this.notebookEditor);
|
|
67
|
+
this.deletedCellDecorator = this.instantiationService.createInstance(NotebookDeletedCellDecorator, this.notebookEditor, undefined);
|
|
68
|
+
this._update();
|
|
69
|
+
const onVisibleChange = Event.debounce(this.notebookEditor.onDidChangeVisibleRanges, (e) => e, 100, undefined, undefined, undefined, this._store);
|
|
70
|
+
this.listeners.push(onVisibleChange(() => this._update()));
|
|
71
|
+
this.listeners.push(this.notebookEditor.onDidChangeModel(() => this._update()));
|
|
72
|
+
if (this.notebookEditor.textModel) {
|
|
73
|
+
const onContentChange = Event.debounce(this.notebookEditor.textModel.onDidChangeContent, (_, event) => event, 100, undefined, undefined, undefined, this._store);
|
|
74
|
+
const onOriginalContentChange = Event.debounce(this.previous.onDidChangeContent, (_, event) => event, 100, undefined, undefined, undefined, this._store);
|
|
75
|
+
this.listeners.push(onContentChange(() => this._update()));
|
|
76
|
+
this.listeners.push(onOriginalContentChange(() => this._update()));
|
|
77
|
+
}
|
|
78
|
+
this.logService.debug('inlineDiff', 'Initialized');
|
|
79
|
+
}
|
|
80
|
+
async _update() {
|
|
81
|
+
const current = this.notebookEditor.getViewModel()?.notebookDocument;
|
|
82
|
+
if (!this.previous || !current) {
|
|
83
|
+
this.logService.debug('inlineDiff', 'Update skipped - no original or current document');
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
if (!this.cachedNotebookDiff ||
|
|
87
|
+
this.cachedNotebookDiff.originalVersion !== this.previous.versionId ||
|
|
88
|
+
this.cachedNotebookDiff.version !== current.versionId) {
|
|
89
|
+
let diffInfo = { cellDiffInfo: [] };
|
|
90
|
+
try {
|
|
91
|
+
const notebookDiff = await this.notebookEditorWorkerService.computeDiff(this.previous.uri, current.uri);
|
|
92
|
+
diffInfo = computeDiff(this.previous, current, notebookDiff);
|
|
93
|
+
}
|
|
94
|
+
catch (e) {
|
|
95
|
+
this.logService.error('inlineDiff', 'Error computing diff:\n' + e);
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
this.cachedNotebookDiff = { cellDiffInfo: diffInfo.cellDiffInfo, originalVersion: this.previous.versionId, version: current.versionId };
|
|
99
|
+
this.insertedCellDecorator?.apply(diffInfo.cellDiffInfo);
|
|
100
|
+
this.deletedCellDecorator?.apply(diffInfo.cellDiffInfo, this.previous);
|
|
101
|
+
}
|
|
102
|
+
await this.updateCells(this.previous, current, this.cachedNotebookDiff.cellDiffInfo);
|
|
103
|
+
}
|
|
104
|
+
async updateCells(original, modified, cellDiffs) {
|
|
105
|
+
const validDiffDecorators = ( new Set());
|
|
106
|
+
cellDiffs.forEach((diff) => {
|
|
107
|
+
if (diff.type === 'modified') {
|
|
108
|
+
const modifiedCell = modified.cells[diff.modifiedCellIndex];
|
|
109
|
+
const originalCell = original.cells[diff.originalCellIndex];
|
|
110
|
+
const editor = this.notebookEditor.codeEditors.find(([vm,]) => vm.handle === modifiedCell.handle)?.[1];
|
|
111
|
+
if (editor) {
|
|
112
|
+
const currentDecorator = this.cellDecorators.get(modifiedCell);
|
|
113
|
+
if ((currentDecorator?.modifiedCell !== modifiedCell || currentDecorator?.originalCell !== originalCell)) {
|
|
114
|
+
currentDecorator?.dispose();
|
|
115
|
+
const decorator = this.instantiationService.createInstance(NotebookCellDiffDecorator, this.notebookEditor, modifiedCell, originalCell, editor);
|
|
116
|
+
this.cellDecorators.set(modifiedCell, decorator);
|
|
117
|
+
validDiffDecorators.add(decorator);
|
|
118
|
+
this._register(editor.onDidDispose(() => {
|
|
119
|
+
decorator.dispose();
|
|
120
|
+
if (this.cellDecorators.get(modifiedCell) === decorator) {
|
|
121
|
+
this.cellDecorators.delete(modifiedCell);
|
|
122
|
+
}
|
|
123
|
+
}));
|
|
124
|
+
}
|
|
125
|
+
else if (currentDecorator) {
|
|
126
|
+
validDiffDecorators.add(currentDecorator);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
this.cellDecorators.forEach((v, cell) => {
|
|
132
|
+
if (!( validDiffDecorators.has(v))) {
|
|
133
|
+
v.dispose();
|
|
134
|
+
this.cellDecorators.delete(cell);
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
NotebookInlineDiffDecorationContribution = ( __decorate([
|
|
140
|
+
( __param(1, INotebookEditorWorkerService)),
|
|
141
|
+
( __param(2, IInstantiationService)),
|
|
142
|
+
( __param(3, INotebookLoggingService))
|
|
143
|
+
], NotebookInlineDiffDecorationContribution));
|
|
144
|
+
registerNotebookContribution(NotebookInlineDiffDecorationContribution.ID, NotebookInlineDiffDecorationContribution);
|
|
145
|
+
|
|
146
|
+
export { NotebookInlineDiffDecorationContribution };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as DOM from "@codingame/monaco-vscode-api/vscode/vs/base/browser/dom";
|
|
2
|
+
import { CodeWindow } from "@codingame/monaco-vscode-api/vscode/vs/base/browser/window";
|
|
3
|
+
import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
|
|
4
|
+
import { IInstantiationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation";
|
|
5
|
+
import { NotebookTextModel } from "@codingame/monaco-vscode-notebook-service-override/vscode/vs/workbench/contrib/notebook/common/model/notebookTextModel";
|
|
6
|
+
import { NotebookDiffEditorInput } from "../../../common/notebookDiffEditorInput.js";
|
|
7
|
+
import { INotebookEditorOptions } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/browser/notebookBrowser";
|
|
8
|
+
import { NotebookEditorWidget } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/browser/notebookEditorWidget";
|
|
9
|
+
import { NotebookOptions } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/browser/notebookOptions";
|
|
10
|
+
import { INotebookEditorService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/browser/services/notebookEditorService.service";
|
|
11
|
+
export declare class NotebookInlineDiffWidget extends Disposable {
|
|
12
|
+
private readonly rootElement;
|
|
13
|
+
private readonly groupId;
|
|
14
|
+
private readonly window;
|
|
15
|
+
private readonly options;
|
|
16
|
+
private dimension;
|
|
17
|
+
private readonly instantiationService;
|
|
18
|
+
private readonly widgetService;
|
|
19
|
+
private widget;
|
|
20
|
+
private position;
|
|
21
|
+
get editorWidget(): NotebookEditorWidget | undefined;
|
|
22
|
+
constructor(rootElement: HTMLElement, groupId: number, window: CodeWindow, options: NotebookOptions, dimension: DOM.Dimension | undefined, instantiationService: IInstantiationService, widgetService: INotebookEditorService);
|
|
23
|
+
show(input: NotebookDiffEditorInput, model: NotebookTextModel | undefined, previousModel: NotebookTextModel | undefined, options: INotebookEditorOptions | undefined): Promise<void>;
|
|
24
|
+
hide(): void;
|
|
25
|
+
setLayout(dimension: DOM.Dimension, position: DOM.IDomPosition): void;
|
|
26
|
+
private createNotebookWidget;
|
|
27
|
+
dispose(): void;
|
|
28
|
+
}
|
package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInlineDiffWidget.js
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
|
|
2
|
+
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
|
+
import { setParentFlowTo } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/dom';
|
|
4
|
+
import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
5
|
+
import { EditorExtensionsRegistry } from '@codingame/monaco-vscode-api/vscode/vs/editor/browser/editorExtensions';
|
|
6
|
+
import { MenuId } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/common/actions';
|
|
7
|
+
import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
|
|
8
|
+
import { NotebookInlineDiffDecorationContribution } from './notebookInlineDiff.js';
|
|
9
|
+
import { NotebookEditorExtensionsRegistry } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/browser/notebookEditorExtensions';
|
|
10
|
+
import { INotebookEditorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/browser/services/notebookEditorService.service';
|
|
11
|
+
|
|
12
|
+
let NotebookInlineDiffWidget = class NotebookInlineDiffWidget extends Disposable {
|
|
13
|
+
get editorWidget() {
|
|
14
|
+
return this.widget.value;
|
|
15
|
+
}
|
|
16
|
+
constructor(rootElement, groupId, window, options, dimension, instantiationService, widgetService) {
|
|
17
|
+
super();
|
|
18
|
+
this.rootElement = rootElement;
|
|
19
|
+
this.groupId = groupId;
|
|
20
|
+
this.window = window;
|
|
21
|
+
this.options = options;
|
|
22
|
+
this.dimension = dimension;
|
|
23
|
+
this.instantiationService = instantiationService;
|
|
24
|
+
this.widgetService = widgetService;
|
|
25
|
+
this.widget = { value: undefined };
|
|
26
|
+
}
|
|
27
|
+
async show(input, model, previousModel, options) {
|
|
28
|
+
if (!this.widget.value) {
|
|
29
|
+
this.createNotebookWidget(input, this.groupId, this.rootElement);
|
|
30
|
+
}
|
|
31
|
+
if (this.dimension) {
|
|
32
|
+
this.widget.value?.layout(this.dimension, this.rootElement, this.position);
|
|
33
|
+
}
|
|
34
|
+
if (model) {
|
|
35
|
+
await this.widget.value?.setOptions({ ...options });
|
|
36
|
+
this.widget.value?.notebookOptions.previousModelToCompare.set(previousModel, undefined);
|
|
37
|
+
await this.widget.value.setModel(model, options?.viewState);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
hide() {
|
|
41
|
+
if (this.widget.value) {
|
|
42
|
+
this.widget.value.notebookOptions.previousModelToCompare.set(undefined, undefined);
|
|
43
|
+
this.widget.value.onWillHide();
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
setLayout(dimension, position) {
|
|
47
|
+
this.dimension = dimension;
|
|
48
|
+
this.position = position;
|
|
49
|
+
}
|
|
50
|
+
createNotebookWidget(input, groupId, rootElement) {
|
|
51
|
+
const contributions = NotebookEditorExtensionsRegistry.getSomeEditorContributions([NotebookInlineDiffDecorationContribution.ID]);
|
|
52
|
+
const menuIds = {
|
|
53
|
+
notebookToolbar: MenuId.NotebookToolbar,
|
|
54
|
+
cellTitleToolbar: MenuId.NotebookCellTitle,
|
|
55
|
+
cellDeleteToolbar: MenuId.NotebookCellDelete,
|
|
56
|
+
cellInsertToolbar: MenuId.NotebookCellBetween,
|
|
57
|
+
cellTopInsertToolbar: MenuId.NotebookCellListTop,
|
|
58
|
+
cellExecuteToolbar: MenuId.NotebookCellExecute,
|
|
59
|
+
cellExecutePrimary: undefined,
|
|
60
|
+
};
|
|
61
|
+
const skipContributions = [
|
|
62
|
+
'editor.contrib.review',
|
|
63
|
+
'editor.contrib.floatingClickMenu',
|
|
64
|
+
'editor.contrib.dirtydiff',
|
|
65
|
+
'editor.contrib.testingOutputPeek',
|
|
66
|
+
'editor.contrib.testingDecorations',
|
|
67
|
+
'store.contrib.stickyScrollController',
|
|
68
|
+
'editor.contrib.findController',
|
|
69
|
+
'editor.contrib.emptyTextEditorHint',
|
|
70
|
+
];
|
|
71
|
+
const cellEditorContributions = EditorExtensionsRegistry.getEditorContributions().filter(c => skipContributions.indexOf(c.id) === -1);
|
|
72
|
+
this.widget = this.instantiationService.invokeFunction(this.widgetService.retrieveWidget, groupId, input, { contributions, menuIds, cellEditorContributions, options: this.options }, this.dimension, this.window);
|
|
73
|
+
if (this.rootElement && this.widget.value.getDomNode()) {
|
|
74
|
+
this.rootElement.setAttribute('aria-flowto', this.widget.value.getDomNode().id || '');
|
|
75
|
+
setParentFlowTo(this.widget.value.getDomNode(), this.rootElement);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
dispose() {
|
|
79
|
+
super.dispose();
|
|
80
|
+
if (this.widget.value) {
|
|
81
|
+
this.widget.value.dispose();
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
NotebookInlineDiffWidget = ( __decorate([
|
|
86
|
+
( __param(5, IInstantiationService)),
|
|
87
|
+
( __param(6, INotebookEditorService))
|
|
88
|
+
], NotebookInlineDiffWidget));
|
|
89
|
+
|
|
90
|
+
export { NotebookInlineDiffWidget };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
|
|
2
|
+
import { CellDiffInfo } from "../notebookDiffViewModel.js";
|
|
3
|
+
import { INotebookEditor } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/browser/notebookBrowser";
|
|
4
|
+
export declare class NotebookInsertedCellDecorator extends Disposable {
|
|
5
|
+
private readonly notebookEditor;
|
|
6
|
+
private readonly decorators;
|
|
7
|
+
constructor(notebookEditor: INotebookEditor);
|
|
8
|
+
apply(diffInfo: CellDiffInfo[]): void;
|
|
9
|
+
clear(): void;
|
|
10
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
|
|
2
|
+
import { Disposable, DisposableStore, toDisposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
3
|
+
import { NotebookOverviewRulerLane } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/browser/notebookBrowser';
|
|
4
|
+
import { overviewRulerAddedForeground } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/scm/common/quickDiff';
|
|
5
|
+
|
|
6
|
+
class NotebookInsertedCellDecorator extends Disposable {
|
|
7
|
+
constructor(notebookEditor) {
|
|
8
|
+
super();
|
|
9
|
+
this.notebookEditor = notebookEditor;
|
|
10
|
+
this.decorators = this._register(( new DisposableStore()));
|
|
11
|
+
}
|
|
12
|
+
apply(diffInfo) {
|
|
13
|
+
const model = this.notebookEditor.textModel;
|
|
14
|
+
if (!model) {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
const cells = ( diffInfo.filter(diff => diff.type === 'insert').map((diff) => model.cells[diff.modifiedCellIndex]));
|
|
18
|
+
const ids = this.notebookEditor.deltaCellDecorations([], ( cells.map(cell => ({
|
|
19
|
+
handle: cell.handle,
|
|
20
|
+
options: {
|
|
21
|
+
className: 'nb-insertHighlight', outputClassName: 'nb-insertHighlight', overviewRuler: {
|
|
22
|
+
color: overviewRulerAddedForeground,
|
|
23
|
+
modelRanges: [],
|
|
24
|
+
includeOutput: true,
|
|
25
|
+
position: NotebookOverviewRulerLane.Full
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}))));
|
|
29
|
+
this.clear();
|
|
30
|
+
this.decorators.add(toDisposable(() => {
|
|
31
|
+
if (!this.notebookEditor.isDisposed) {
|
|
32
|
+
this.notebookEditor.deltaCellDecorations(ids, []);
|
|
33
|
+
}
|
|
34
|
+
}));
|
|
35
|
+
}
|
|
36
|
+
clear() {
|
|
37
|
+
this.decorators.clear();
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export { NotebookInsertedCellDecorator };
|