@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,594 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { ResourceTextEdit } from '@codingame/monaco-vscode-api/vscode/vs/editor/browser/services/bulkEditService';
|
|
3
|
-
import { Position } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/core/position';
|
|
4
|
-
import { Range } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/core/range';
|
|
5
|
-
import { EndOfLinePreference } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/model';
|
|
6
|
-
import { PLAINTEXT_LANGUAGE_ID } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/languages/modesRegistry';
|
|
7
|
-
import { ResourceNotebookCellEdit } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/bulkEdit/browser/bulkCellEdits';
|
|
8
|
-
import { CellEditState, expandCellRangesWithHiddenCells, CellFocusMode } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/browser/notebookBrowser';
|
|
9
|
-
import { cloneNotebookCellTextModel } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/model/notebookCellTextModel';
|
|
10
|
-
import { CellEditType, SelectionStateType, CellKind } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookCommon';
|
|
11
|
-
import { cellRangeContains, cellRangesToIndexes } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/notebook/common/notebookRange';
|
|
12
|
-
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
13
|
-
|
|
14
|
-
async function changeCellToKind(kind, context, language, mime) {
|
|
15
|
-
const { notebookEditor } = context;
|
|
16
|
-
if (!notebookEditor.hasModel()) {
|
|
17
|
-
return;
|
|
18
|
-
}
|
|
19
|
-
if (notebookEditor.isReadOnly) {
|
|
20
|
-
return;
|
|
21
|
-
}
|
|
22
|
-
if (context.ui && context.cell) {
|
|
23
|
-
const { cell } = context;
|
|
24
|
-
if (cell.cellKind === kind) {
|
|
25
|
-
return;
|
|
26
|
-
}
|
|
27
|
-
const text = cell.getText();
|
|
28
|
-
const idx = notebookEditor.getCellIndex(cell);
|
|
29
|
-
if (language === undefined) {
|
|
30
|
-
const availableLanguages = notebookEditor.activeKernel?.supportedLanguages ?? [];
|
|
31
|
-
language = availableLanguages[0] ?? PLAINTEXT_LANGUAGE_ID;
|
|
32
|
-
}
|
|
33
|
-
notebookEditor.textModel.applyEdits([
|
|
34
|
-
{
|
|
35
|
-
editType: CellEditType.Replace,
|
|
36
|
-
index: idx,
|
|
37
|
-
count: 1,
|
|
38
|
-
cells: [{
|
|
39
|
-
cellKind: kind,
|
|
40
|
-
source: text,
|
|
41
|
-
language: language,
|
|
42
|
-
mime: mime ?? cell.mime,
|
|
43
|
-
outputs: cell.model.outputs,
|
|
44
|
-
metadata: cell.metadata,
|
|
45
|
-
}]
|
|
46
|
-
}
|
|
47
|
-
], true, {
|
|
48
|
-
kind: SelectionStateType.Index,
|
|
49
|
-
focus: notebookEditor.getFocus(),
|
|
50
|
-
selections: notebookEditor.getSelections()
|
|
51
|
-
}, () => {
|
|
52
|
-
return {
|
|
53
|
-
kind: SelectionStateType.Index,
|
|
54
|
-
focus: notebookEditor.getFocus(),
|
|
55
|
-
selections: notebookEditor.getSelections()
|
|
56
|
-
};
|
|
57
|
-
}, undefined, true);
|
|
58
|
-
const newCell = notebookEditor.cellAt(idx);
|
|
59
|
-
await notebookEditor.focusNotebookCell(newCell, cell.getEditState() === CellEditState.Editing ? 'editor' : 'container');
|
|
60
|
-
}
|
|
61
|
-
else if (context.selectedCells) {
|
|
62
|
-
const selectedCells = context.selectedCells;
|
|
63
|
-
const rawEdits = [];
|
|
64
|
-
selectedCells.forEach(cell => {
|
|
65
|
-
if (cell.cellKind === kind) {
|
|
66
|
-
return;
|
|
67
|
-
}
|
|
68
|
-
const text = cell.getText();
|
|
69
|
-
const idx = notebookEditor.getCellIndex(cell);
|
|
70
|
-
if (language === undefined) {
|
|
71
|
-
const availableLanguages = notebookEditor.activeKernel?.supportedLanguages ?? [];
|
|
72
|
-
language = availableLanguages[0] ?? PLAINTEXT_LANGUAGE_ID;
|
|
73
|
-
}
|
|
74
|
-
rawEdits.push({
|
|
75
|
-
editType: CellEditType.Replace,
|
|
76
|
-
index: idx,
|
|
77
|
-
count: 1,
|
|
78
|
-
cells: [{
|
|
79
|
-
cellKind: kind,
|
|
80
|
-
source: text,
|
|
81
|
-
language: language,
|
|
82
|
-
mime: mime ?? cell.mime,
|
|
83
|
-
outputs: cell.model.outputs,
|
|
84
|
-
metadata: cell.metadata,
|
|
85
|
-
}]
|
|
86
|
-
});
|
|
87
|
-
});
|
|
88
|
-
notebookEditor.textModel.applyEdits(rawEdits, true, {
|
|
89
|
-
kind: SelectionStateType.Index,
|
|
90
|
-
focus: notebookEditor.getFocus(),
|
|
91
|
-
selections: notebookEditor.getSelections()
|
|
92
|
-
}, () => {
|
|
93
|
-
return {
|
|
94
|
-
kind: SelectionStateType.Index,
|
|
95
|
-
focus: notebookEditor.getFocus(),
|
|
96
|
-
selections: notebookEditor.getSelections()
|
|
97
|
-
};
|
|
98
|
-
}, undefined, true);
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
function runDeleteAction(editor, cell) {
|
|
102
|
-
const textModel = editor.textModel;
|
|
103
|
-
const selections = editor.getSelections();
|
|
104
|
-
const targetCellIndex = editor.getCellIndex(cell);
|
|
105
|
-
const containingSelection = selections.find(selection => selection.start <= targetCellIndex && targetCellIndex < selection.end);
|
|
106
|
-
const computeUndoRedo = !editor.isReadOnly || textModel.viewType === 'interactive';
|
|
107
|
-
if (containingSelection) {
|
|
108
|
-
const edits = ( selections.reverse().map(selection => ({
|
|
109
|
-
editType: CellEditType.Replace, index: selection.start, count: selection.end - selection.start, cells: []
|
|
110
|
-
})));
|
|
111
|
-
const nextCellAfterContainingSelection = containingSelection.end >= editor.getLength() ? undefined : editor.cellAt(containingSelection.end);
|
|
112
|
-
textModel.applyEdits(edits, true, { kind: SelectionStateType.Index, focus: editor.getFocus(), selections: editor.getSelections() }, () => {
|
|
113
|
-
if (nextCellAfterContainingSelection) {
|
|
114
|
-
const cellIndex = textModel.cells.findIndex(cell => cell.handle === nextCellAfterContainingSelection.handle);
|
|
115
|
-
return { kind: SelectionStateType.Index, focus: { start: cellIndex, end: cellIndex + 1 }, selections: [{ start: cellIndex, end: cellIndex + 1 }] };
|
|
116
|
-
}
|
|
117
|
-
else {
|
|
118
|
-
if (textModel.length) {
|
|
119
|
-
const lastCellIndex = textModel.length - 1;
|
|
120
|
-
return { kind: SelectionStateType.Index, focus: { start: lastCellIndex, end: lastCellIndex + 1 }, selections: [{ start: lastCellIndex, end: lastCellIndex + 1 }] };
|
|
121
|
-
}
|
|
122
|
-
else {
|
|
123
|
-
return { kind: SelectionStateType.Index, focus: { start: 0, end: 0 }, selections: [{ start: 0, end: 0 }] };
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
}, undefined, computeUndoRedo);
|
|
127
|
-
}
|
|
128
|
-
else {
|
|
129
|
-
const focus = editor.getFocus();
|
|
130
|
-
const edits = [{
|
|
131
|
-
editType: CellEditType.Replace, index: targetCellIndex, count: 1, cells: []
|
|
132
|
-
}];
|
|
133
|
-
const finalSelections = [];
|
|
134
|
-
for (let i = 0; i < selections.length; i++) {
|
|
135
|
-
const selection = selections[i];
|
|
136
|
-
if (selection.end <= targetCellIndex) {
|
|
137
|
-
finalSelections.push(selection);
|
|
138
|
-
}
|
|
139
|
-
else if (selection.start > targetCellIndex) {
|
|
140
|
-
finalSelections.push({ start: selection.start - 1, end: selection.end - 1 });
|
|
141
|
-
}
|
|
142
|
-
else {
|
|
143
|
-
finalSelections.push({ start: targetCellIndex, end: targetCellIndex + 1 });
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
if (editor.cellAt(focus.start) === cell) {
|
|
147
|
-
const newFocus = focus.end === textModel.length ? { start: focus.start - 1, end: focus.end - 1 } : focus;
|
|
148
|
-
textModel.applyEdits(edits, true, { kind: SelectionStateType.Index, focus: editor.getFocus(), selections: editor.getSelections() }, () => ({
|
|
149
|
-
kind: SelectionStateType.Index, focus: newFocus, selections: finalSelections
|
|
150
|
-
}), undefined, computeUndoRedo);
|
|
151
|
-
}
|
|
152
|
-
else {
|
|
153
|
-
const newFocus = focus.start > targetCellIndex ? { start: focus.start - 1, end: focus.end - 1 } : focus;
|
|
154
|
-
textModel.applyEdits(edits, true, { kind: SelectionStateType.Index, focus: editor.getFocus(), selections: editor.getSelections() }, () => ({
|
|
155
|
-
kind: SelectionStateType.Index, focus: newFocus, selections: finalSelections
|
|
156
|
-
}), undefined, computeUndoRedo);
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
async function moveCellRange(context, direction) {
|
|
161
|
-
if (!context.notebookEditor.hasModel()) {
|
|
162
|
-
return;
|
|
163
|
-
}
|
|
164
|
-
const editor = context.notebookEditor;
|
|
165
|
-
const textModel = editor.textModel;
|
|
166
|
-
if (editor.isReadOnly) {
|
|
167
|
-
return;
|
|
168
|
-
}
|
|
169
|
-
let range = undefined;
|
|
170
|
-
if (context.cell) {
|
|
171
|
-
const idx = editor.getCellIndex(context.cell);
|
|
172
|
-
range = { start: idx, end: idx + 1 };
|
|
173
|
-
}
|
|
174
|
-
else {
|
|
175
|
-
const selections = editor.getSelections();
|
|
176
|
-
const modelRanges = expandCellRangesWithHiddenCells(editor, selections);
|
|
177
|
-
range = modelRanges[0];
|
|
178
|
-
}
|
|
179
|
-
if (!range || range.start === range.end) {
|
|
180
|
-
return;
|
|
181
|
-
}
|
|
182
|
-
if (direction === 'up') {
|
|
183
|
-
if (range.start === 0) {
|
|
184
|
-
return;
|
|
185
|
-
}
|
|
186
|
-
const indexAbove = range.start - 1;
|
|
187
|
-
const finalSelection = { start: range.start - 1, end: range.end - 1 };
|
|
188
|
-
const focus = context.notebookEditor.getFocus();
|
|
189
|
-
const newFocus = cellRangeContains(range, focus) ? { start: focus.start - 1, end: focus.end - 1 } : { start: range.start - 1, end: range.start };
|
|
190
|
-
textModel.applyEdits([
|
|
191
|
-
{
|
|
192
|
-
editType: CellEditType.Move,
|
|
193
|
-
index: indexAbove,
|
|
194
|
-
length: 1,
|
|
195
|
-
newIdx: range.end - 1
|
|
196
|
-
}
|
|
197
|
-
], true, {
|
|
198
|
-
kind: SelectionStateType.Index,
|
|
199
|
-
focus: editor.getFocus(),
|
|
200
|
-
selections: editor.getSelections()
|
|
201
|
-
}, () => ({ kind: SelectionStateType.Index, focus: newFocus, selections: [finalSelection] }), undefined, true);
|
|
202
|
-
const focusRange = editor.getSelections()[0] ?? editor.getFocus();
|
|
203
|
-
editor.revealCellRangeInView(focusRange);
|
|
204
|
-
}
|
|
205
|
-
else {
|
|
206
|
-
if (range.end >= textModel.length) {
|
|
207
|
-
return;
|
|
208
|
-
}
|
|
209
|
-
const indexBelow = range.end;
|
|
210
|
-
const finalSelection = { start: range.start + 1, end: range.end + 1 };
|
|
211
|
-
const focus = editor.getFocus();
|
|
212
|
-
const newFocus = cellRangeContains(range, focus) ? { start: focus.start + 1, end: focus.end + 1 } : { start: range.start + 1, end: range.start + 2 };
|
|
213
|
-
textModel.applyEdits([
|
|
214
|
-
{
|
|
215
|
-
editType: CellEditType.Move,
|
|
216
|
-
index: indexBelow,
|
|
217
|
-
length: 1,
|
|
218
|
-
newIdx: range.start
|
|
219
|
-
}
|
|
220
|
-
], true, {
|
|
221
|
-
kind: SelectionStateType.Index,
|
|
222
|
-
focus: editor.getFocus(),
|
|
223
|
-
selections: editor.getSelections()
|
|
224
|
-
}, () => ({ kind: SelectionStateType.Index, focus: newFocus, selections: [finalSelection] }), undefined, true);
|
|
225
|
-
const focusRange = editor.getSelections()[0] ?? editor.getFocus();
|
|
226
|
-
editor.revealCellRangeInView(focusRange);
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
async function copyCellRange(context, direction) {
|
|
230
|
-
const editor = context.notebookEditor;
|
|
231
|
-
if (!editor.hasModel()) {
|
|
232
|
-
return;
|
|
233
|
-
}
|
|
234
|
-
const textModel = editor.textModel;
|
|
235
|
-
if (editor.isReadOnly) {
|
|
236
|
-
return;
|
|
237
|
-
}
|
|
238
|
-
let range = undefined;
|
|
239
|
-
if (context.ui) {
|
|
240
|
-
const targetCell = context.cell;
|
|
241
|
-
const targetCellIndex = editor.getCellIndex(targetCell);
|
|
242
|
-
range = { start: targetCellIndex, end: targetCellIndex + 1 };
|
|
243
|
-
}
|
|
244
|
-
else {
|
|
245
|
-
const selections = editor.getSelections();
|
|
246
|
-
const modelRanges = expandCellRangesWithHiddenCells(editor, selections);
|
|
247
|
-
range = modelRanges[0];
|
|
248
|
-
}
|
|
249
|
-
if (!range || range.start === range.end) {
|
|
250
|
-
return;
|
|
251
|
-
}
|
|
252
|
-
if (direction === 'up') {
|
|
253
|
-
const focus = editor.getFocus();
|
|
254
|
-
const selections = editor.getSelections();
|
|
255
|
-
textModel.applyEdits([
|
|
256
|
-
{
|
|
257
|
-
editType: CellEditType.Replace,
|
|
258
|
-
index: range.end,
|
|
259
|
-
count: 0,
|
|
260
|
-
cells: ( cellRangesToIndexes([range]).map(index => cloneNotebookCellTextModel(editor.cellAt(index).model)))
|
|
261
|
-
}
|
|
262
|
-
], true, {
|
|
263
|
-
kind: SelectionStateType.Index,
|
|
264
|
-
focus: focus,
|
|
265
|
-
selections: selections
|
|
266
|
-
}, () => ({ kind: SelectionStateType.Index, focus: focus, selections: selections }), undefined, true);
|
|
267
|
-
}
|
|
268
|
-
else {
|
|
269
|
-
const focus = editor.getFocus();
|
|
270
|
-
const selections = editor.getSelections();
|
|
271
|
-
const newCells = ( cellRangesToIndexes([range]).map(index => cloneNotebookCellTextModel(editor.cellAt(index).model)));
|
|
272
|
-
const countDelta = newCells.length;
|
|
273
|
-
const newFocus = context.ui ? focus : { start: focus.start + countDelta, end: focus.end + countDelta };
|
|
274
|
-
const newSelections = context.ui ? selections : [{ start: range.start + countDelta, end: range.end + countDelta }];
|
|
275
|
-
textModel.applyEdits([
|
|
276
|
-
{
|
|
277
|
-
editType: CellEditType.Replace,
|
|
278
|
-
index: range.end,
|
|
279
|
-
count: 0,
|
|
280
|
-
cells: ( cellRangesToIndexes([range]).map(index => cloneNotebookCellTextModel(editor.cellAt(index).model)))
|
|
281
|
-
}
|
|
282
|
-
], true, {
|
|
283
|
-
kind: SelectionStateType.Index,
|
|
284
|
-
focus: focus,
|
|
285
|
-
selections: selections
|
|
286
|
-
}, () => ({ kind: SelectionStateType.Index, focus: newFocus, selections: newSelections }), undefined, true);
|
|
287
|
-
const focusRange = editor.getSelections()[0] ?? editor.getFocus();
|
|
288
|
-
editor.revealCellRangeInView(focusRange);
|
|
289
|
-
}
|
|
290
|
-
}
|
|
291
|
-
async function joinSelectedCells(bulkEditService, notificationService, context) {
|
|
292
|
-
const editor = context.notebookEditor;
|
|
293
|
-
if (editor.isReadOnly) {
|
|
294
|
-
return;
|
|
295
|
-
}
|
|
296
|
-
const edits = [];
|
|
297
|
-
const cells = [];
|
|
298
|
-
for (const selection of editor.getSelections()) {
|
|
299
|
-
cells.push(...editor.getCellsInRange(selection));
|
|
300
|
-
}
|
|
301
|
-
if (cells.length <= 1) {
|
|
302
|
-
return;
|
|
303
|
-
}
|
|
304
|
-
const cellKind = cells[0].cellKind;
|
|
305
|
-
const isSameKind = cells.every(cell => cell.cellKind === cellKind);
|
|
306
|
-
if (!isSameKind) {
|
|
307
|
-
const message = ( localize(9348, "Cannot join cells of different kinds"));
|
|
308
|
-
return notificationService.warn(message);
|
|
309
|
-
}
|
|
310
|
-
const firstCell = cells[0];
|
|
311
|
-
const insertContent = ( cells.map(cell => cell.getText())).join(firstCell.textBuffer.getEOL());
|
|
312
|
-
const firstSelection = editor.getSelections()[0];
|
|
313
|
-
edits.push(( new ResourceNotebookCellEdit(editor.textModel.uri, {
|
|
314
|
-
editType: CellEditType.Replace,
|
|
315
|
-
index: firstSelection.start,
|
|
316
|
-
count: firstSelection.end - firstSelection.start,
|
|
317
|
-
cells: [{
|
|
318
|
-
cellKind: firstCell.cellKind,
|
|
319
|
-
source: insertContent,
|
|
320
|
-
language: firstCell.language,
|
|
321
|
-
mime: firstCell.mime,
|
|
322
|
-
outputs: firstCell.model.outputs,
|
|
323
|
-
metadata: firstCell.metadata,
|
|
324
|
-
}]
|
|
325
|
-
})));
|
|
326
|
-
for (const selection of editor.getSelections().slice(1)) {
|
|
327
|
-
edits.push(( new ResourceNotebookCellEdit(editor.textModel.uri, {
|
|
328
|
-
editType: CellEditType.Replace,
|
|
329
|
-
index: selection.start,
|
|
330
|
-
count: selection.end - selection.start,
|
|
331
|
-
cells: []
|
|
332
|
-
})));
|
|
333
|
-
}
|
|
334
|
-
if (edits.length) {
|
|
335
|
-
await bulkEditService.apply(edits, { quotableLabel: ( localize(9349, "Join Notebook Cells")) });
|
|
336
|
-
}
|
|
337
|
-
}
|
|
338
|
-
async function joinNotebookCells(editor, range, direction, constraint) {
|
|
339
|
-
if (editor.isReadOnly) {
|
|
340
|
-
return null;
|
|
341
|
-
}
|
|
342
|
-
const textModel = editor.textModel;
|
|
343
|
-
const cells = editor.getCellsInRange(range);
|
|
344
|
-
if (!cells.length) {
|
|
345
|
-
return null;
|
|
346
|
-
}
|
|
347
|
-
if (range.start === 0 && direction === 'above') {
|
|
348
|
-
return null;
|
|
349
|
-
}
|
|
350
|
-
if (range.end === textModel.length && direction === 'below') {
|
|
351
|
-
return null;
|
|
352
|
-
}
|
|
353
|
-
if (direction === 'above') {
|
|
354
|
-
const above = editor.cellAt(range.start - 1);
|
|
355
|
-
const insertContent = ( cells.map(cell => (cell.textBuffer.getEOL() ?? '') + cell.getText())).join('');
|
|
356
|
-
const aboveCellLineCount = above.textBuffer.getLineCount();
|
|
357
|
-
const aboveCellLastLineEndColumn = above.textBuffer.getLineLength(aboveCellLineCount);
|
|
358
|
-
return {
|
|
359
|
-
edits: [
|
|
360
|
-
( new ResourceTextEdit(above.uri, { range: ( new Range(
|
|
361
|
-
aboveCellLineCount,
|
|
362
|
-
aboveCellLastLineEndColumn + 1,
|
|
363
|
-
aboveCellLineCount,
|
|
364
|
-
aboveCellLastLineEndColumn + 1
|
|
365
|
-
)), text: insertContent })),
|
|
366
|
-
( new ResourceNotebookCellEdit(textModel.uri, {
|
|
367
|
-
editType: CellEditType.Replace,
|
|
368
|
-
index: range.start,
|
|
369
|
-
count: range.end - range.start,
|
|
370
|
-
cells: []
|
|
371
|
-
}))
|
|
372
|
-
],
|
|
373
|
-
cell: above,
|
|
374
|
-
endFocus: { start: range.start - 1, end: range.start },
|
|
375
|
-
endSelections: [{ start: range.start - 1, end: range.start }]
|
|
376
|
-
};
|
|
377
|
-
}
|
|
378
|
-
else {
|
|
379
|
-
const below = editor.cellAt(range.end);
|
|
380
|
-
const cell = cells[0];
|
|
381
|
-
const restCells = [...cells.slice(1), below];
|
|
382
|
-
const insertContent = ( restCells.map(cl => (cl.textBuffer.getEOL() ?? '') + cl.getText())).join('');
|
|
383
|
-
const cellLineCount = cell.textBuffer.getLineCount();
|
|
384
|
-
const cellLastLineEndColumn = cell.textBuffer.getLineLength(cellLineCount);
|
|
385
|
-
return {
|
|
386
|
-
edits: [
|
|
387
|
-
( new ResourceTextEdit(cell.uri, { range: ( new Range(
|
|
388
|
-
cellLineCount,
|
|
389
|
-
cellLastLineEndColumn + 1,
|
|
390
|
-
cellLineCount,
|
|
391
|
-
cellLastLineEndColumn + 1
|
|
392
|
-
)), text: insertContent })),
|
|
393
|
-
( new ResourceNotebookCellEdit(textModel.uri, {
|
|
394
|
-
editType: CellEditType.Replace,
|
|
395
|
-
index: range.start + 1,
|
|
396
|
-
count: range.end - range.start,
|
|
397
|
-
cells: []
|
|
398
|
-
}))
|
|
399
|
-
],
|
|
400
|
-
cell,
|
|
401
|
-
endFocus: { start: range.start, end: range.start + 1 },
|
|
402
|
-
endSelections: [{ start: range.start, end: range.start + 1 }]
|
|
403
|
-
};
|
|
404
|
-
}
|
|
405
|
-
}
|
|
406
|
-
async function joinCellsWithSurrounds(bulkEditService, context, direction) {
|
|
407
|
-
const editor = context.notebookEditor;
|
|
408
|
-
const textModel = editor.textModel;
|
|
409
|
-
const viewModel = editor.getViewModel();
|
|
410
|
-
let ret = null;
|
|
411
|
-
if (context.ui) {
|
|
412
|
-
const focusMode = context.cell.focusMode;
|
|
413
|
-
const cellIndex = editor.getCellIndex(context.cell);
|
|
414
|
-
ret = await joinNotebookCells(editor, { start: cellIndex, end: cellIndex + 1 }, direction);
|
|
415
|
-
if (!ret) {
|
|
416
|
-
return;
|
|
417
|
-
}
|
|
418
|
-
await bulkEditService.apply(ret?.edits, { quotableLabel: 'Join Notebook Cells' });
|
|
419
|
-
viewModel.updateSelectionsState({ kind: SelectionStateType.Index, focus: ret.endFocus, selections: ret.endSelections });
|
|
420
|
-
ret.cell.updateEditState(CellEditState.Editing, 'joinCellsWithSurrounds');
|
|
421
|
-
editor.revealCellRangeInView(editor.getFocus());
|
|
422
|
-
if (focusMode === CellFocusMode.Editor) {
|
|
423
|
-
ret.cell.focusMode = CellFocusMode.Editor;
|
|
424
|
-
}
|
|
425
|
-
}
|
|
426
|
-
else {
|
|
427
|
-
const selections = editor.getSelections();
|
|
428
|
-
if (!selections.length) {
|
|
429
|
-
return;
|
|
430
|
-
}
|
|
431
|
-
const focus = editor.getFocus();
|
|
432
|
-
const focusMode = editor.cellAt(focus.start)?.focusMode;
|
|
433
|
-
const edits = [];
|
|
434
|
-
let cell = null;
|
|
435
|
-
const cells = [];
|
|
436
|
-
for (let i = selections.length - 1; i >= 0; i--) {
|
|
437
|
-
const selection = selections[i];
|
|
438
|
-
const containFocus = cellRangeContains(selection, focus);
|
|
439
|
-
if (selection.end >= textModel.length && direction === 'below'
|
|
440
|
-
|| selection.start === 0 && direction === 'above') {
|
|
441
|
-
if (containFocus) {
|
|
442
|
-
cell = editor.cellAt(focus.start);
|
|
443
|
-
}
|
|
444
|
-
cells.push(...editor.getCellsInRange(selection));
|
|
445
|
-
continue;
|
|
446
|
-
}
|
|
447
|
-
const singleRet = await joinNotebookCells(editor, selection, direction);
|
|
448
|
-
if (!singleRet) {
|
|
449
|
-
return;
|
|
450
|
-
}
|
|
451
|
-
edits.push(...singleRet.edits);
|
|
452
|
-
cells.push(singleRet.cell);
|
|
453
|
-
if (containFocus) {
|
|
454
|
-
cell = singleRet.cell;
|
|
455
|
-
}
|
|
456
|
-
}
|
|
457
|
-
if (!edits.length) {
|
|
458
|
-
return;
|
|
459
|
-
}
|
|
460
|
-
if (!cell || !cells.length) {
|
|
461
|
-
return;
|
|
462
|
-
}
|
|
463
|
-
await bulkEditService.apply(edits, { quotableLabel: 'Join Notebook Cells' });
|
|
464
|
-
cells.forEach(cell => {
|
|
465
|
-
cell.updateEditState(CellEditState.Editing, 'joinCellsWithSurrounds');
|
|
466
|
-
});
|
|
467
|
-
viewModel.updateSelectionsState({ kind: SelectionStateType.Handle, primary: cell.handle, selections: ( cells.map(cell => cell.handle)) });
|
|
468
|
-
editor.revealCellRangeInView(editor.getFocus());
|
|
469
|
-
const newFocusedCell = editor.cellAt(editor.getFocus().start);
|
|
470
|
-
if (focusMode === CellFocusMode.Editor && newFocusedCell) {
|
|
471
|
-
newFocusedCell.focusMode = CellFocusMode.Editor;
|
|
472
|
-
}
|
|
473
|
-
}
|
|
474
|
-
}
|
|
475
|
-
function _splitPointsToBoundaries(splitPoints, textBuffer) {
|
|
476
|
-
const boundaries = [];
|
|
477
|
-
const lineCnt = textBuffer.getLineCount();
|
|
478
|
-
const getLineLen = (lineNumber) => {
|
|
479
|
-
return textBuffer.getLineLength(lineNumber);
|
|
480
|
-
};
|
|
481
|
-
splitPoints = splitPoints.sort((l, r) => {
|
|
482
|
-
const lineDiff = l.lineNumber - r.lineNumber;
|
|
483
|
-
const columnDiff = l.column - r.column;
|
|
484
|
-
return lineDiff !== 0 ? lineDiff : columnDiff;
|
|
485
|
-
});
|
|
486
|
-
for (let sp of splitPoints) {
|
|
487
|
-
if (getLineLen(sp.lineNumber) + 1 === sp.column && sp.column !== 1 && sp.lineNumber < lineCnt) {
|
|
488
|
-
sp = ( new Position(sp.lineNumber + 1, 1));
|
|
489
|
-
}
|
|
490
|
-
_pushIfAbsent(boundaries, sp);
|
|
491
|
-
}
|
|
492
|
-
if (boundaries.length === 0) {
|
|
493
|
-
return null;
|
|
494
|
-
}
|
|
495
|
-
const modelStart = ( new Position(1, 1));
|
|
496
|
-
const modelEnd = ( new Position(lineCnt, getLineLen(lineCnt) + 1));
|
|
497
|
-
return [modelStart, ...boundaries, modelEnd];
|
|
498
|
-
}
|
|
499
|
-
function _pushIfAbsent(positions, p) {
|
|
500
|
-
const last = positions.length > 0 ? positions[positions.length - 1] : undefined;
|
|
501
|
-
if (!last || last.lineNumber !== p.lineNumber || last.column !== p.column) {
|
|
502
|
-
positions.push(p);
|
|
503
|
-
}
|
|
504
|
-
}
|
|
505
|
-
function computeCellLinesContents(cell, splitPoints) {
|
|
506
|
-
const rangeBoundaries = _splitPointsToBoundaries(splitPoints, cell.textBuffer);
|
|
507
|
-
if (!rangeBoundaries) {
|
|
508
|
-
return null;
|
|
509
|
-
}
|
|
510
|
-
const newLineModels = [];
|
|
511
|
-
for (let i = 1; i < rangeBoundaries.length; i++) {
|
|
512
|
-
const start = rangeBoundaries[i - 1];
|
|
513
|
-
const end = rangeBoundaries[i];
|
|
514
|
-
newLineModels.push(cell.textBuffer.getValueInRange(( new Range(start.lineNumber, start.column, end.lineNumber, end.column)), EndOfLinePreference.TextDefined));
|
|
515
|
-
}
|
|
516
|
-
return newLineModels;
|
|
517
|
-
}
|
|
518
|
-
function insertCell(languageService, editor, index, type, direction = 'above', initialText = '', ui = false, kernelHistoryService) {
|
|
519
|
-
const viewModel = editor.getViewModel();
|
|
520
|
-
const activeKernel = editor.activeKernel;
|
|
521
|
-
if (viewModel.options.isReadOnly) {
|
|
522
|
-
return null;
|
|
523
|
-
}
|
|
524
|
-
const cell = editor.cellAt(index);
|
|
525
|
-
const nextIndex = ui ? viewModel.getNextVisibleCellIndex(index) : index + 1;
|
|
526
|
-
let language;
|
|
527
|
-
if (type === CellKind.Code) {
|
|
528
|
-
const supportedLanguages = activeKernel?.supportedLanguages ?? languageService.getRegisteredLanguageIds();
|
|
529
|
-
const defaultLanguage = supportedLanguages[0] || PLAINTEXT_LANGUAGE_ID;
|
|
530
|
-
if (cell?.cellKind === CellKind.Code) {
|
|
531
|
-
language = cell.language;
|
|
532
|
-
}
|
|
533
|
-
else if (cell?.cellKind === CellKind.Markup) {
|
|
534
|
-
const nearestCodeCellIndex = viewModel.nearestCodeCellIndex(index);
|
|
535
|
-
if (nearestCodeCellIndex > -1) {
|
|
536
|
-
language = viewModel.cellAt(nearestCodeCellIndex).language;
|
|
537
|
-
}
|
|
538
|
-
else {
|
|
539
|
-
language = defaultLanguage;
|
|
540
|
-
}
|
|
541
|
-
}
|
|
542
|
-
else if (!cell && viewModel.length === 0) {
|
|
543
|
-
const lastKernels = kernelHistoryService?.getKernels(viewModel.notebookDocument);
|
|
544
|
-
if (lastKernels?.all.length) {
|
|
545
|
-
const lastKernel = lastKernels.all[0];
|
|
546
|
-
language = lastKernel.supportedLanguages[0] || defaultLanguage;
|
|
547
|
-
}
|
|
548
|
-
else {
|
|
549
|
-
language = defaultLanguage;
|
|
550
|
-
}
|
|
551
|
-
}
|
|
552
|
-
else {
|
|
553
|
-
if (cell === undefined && direction === 'above') {
|
|
554
|
-
language = viewModel.viewCells.find(cell => cell.cellKind === CellKind.Code)?.language || defaultLanguage;
|
|
555
|
-
}
|
|
556
|
-
else {
|
|
557
|
-
language = defaultLanguage;
|
|
558
|
-
}
|
|
559
|
-
}
|
|
560
|
-
if (!supportedLanguages.includes(language)) {
|
|
561
|
-
language = defaultLanguage;
|
|
562
|
-
}
|
|
563
|
-
}
|
|
564
|
-
else {
|
|
565
|
-
language = 'markdown';
|
|
566
|
-
}
|
|
567
|
-
const insertIndex = cell ?
|
|
568
|
-
(direction === 'above' ? index : nextIndex) :
|
|
569
|
-
index;
|
|
570
|
-
return insertCellAtIndex(viewModel, insertIndex, initialText, language, type, undefined, [], true);
|
|
571
|
-
}
|
|
572
|
-
function insertCellAtIndex(viewModel, index, source, language, type, metadata, outputs, synchronous, pushUndoStop) {
|
|
573
|
-
const endSelections = { kind: SelectionStateType.Index, focus: { start: index, end: index + 1 }, selections: [{ start: index, end: index + 1 }] };
|
|
574
|
-
viewModel.notebookDocument.applyEdits([
|
|
575
|
-
{
|
|
576
|
-
editType: CellEditType.Replace,
|
|
577
|
-
index,
|
|
578
|
-
count: 0,
|
|
579
|
-
cells: [
|
|
580
|
-
{
|
|
581
|
-
cellKind: type,
|
|
582
|
-
language: language,
|
|
583
|
-
mime: undefined,
|
|
584
|
-
outputs: outputs,
|
|
585
|
-
metadata: metadata,
|
|
586
|
-
source: source
|
|
587
|
-
}
|
|
588
|
-
]
|
|
589
|
-
}
|
|
590
|
-
], synchronous, { kind: SelectionStateType.Index, focus: viewModel.getFocus(), selections: viewModel.getSelections() }, () => endSelections, undefined, !viewModel.options.isReadOnly);
|
|
591
|
-
return viewModel.cellAt(index);
|
|
592
|
-
}
|
|
593
|
-
|
|
594
|
-
export { changeCellToKind, computeCellLinesContents, copyCellRange, insertCell, insertCellAtIndex, joinCellsWithSurrounds, joinNotebookCells, joinSelectedCells, moveCellRange, runDeleteAction };
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { IDiffEditorConstructionOptions } from "@codingame/monaco-vscode-api/vscode/vs/editor/browser/editorBrowser";
|
|
2
|
-
import { IEditorOptions } from "@codingame/monaco-vscode-api/vscode/vs/editor/common/config/editorOptions";
|
|
3
|
-
export declare function getEditorPadding(lineCount: number): {
|
|
4
|
-
top: number;
|
|
5
|
-
bottom: number;
|
|
6
|
-
};
|
|
7
|
-
export declare const fixedEditorOptions: IEditorOptions;
|
|
8
|
-
export declare const fixedDiffEditorOptions: IDiffEditorConstructionOptions;
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const fixedEditorPaddingSingleLineCells = {
|
|
4
|
-
top: 24,
|
|
5
|
-
bottom: 24
|
|
6
|
-
};
|
|
7
|
-
const fixedEditorPadding = {
|
|
8
|
-
top: 12,
|
|
9
|
-
bottom: 12
|
|
10
|
-
};
|
|
11
|
-
function getEditorPadding(lineCount) {
|
|
12
|
-
return lineCount === 1 ? fixedEditorPaddingSingleLineCells : fixedEditorPadding;
|
|
13
|
-
}
|
|
14
|
-
const fixedEditorOptions = {
|
|
15
|
-
padding: fixedEditorPadding,
|
|
16
|
-
scrollBeyondLastLine: false,
|
|
17
|
-
scrollbar: {
|
|
18
|
-
verticalScrollbarSize: 14,
|
|
19
|
-
horizontal: 'auto',
|
|
20
|
-
vertical: 'auto',
|
|
21
|
-
useShadows: true,
|
|
22
|
-
verticalHasArrows: false,
|
|
23
|
-
horizontalHasArrows: false,
|
|
24
|
-
alwaysConsumeMouseWheel: false,
|
|
25
|
-
},
|
|
26
|
-
renderLineHighlightOnlyWhenFocus: true,
|
|
27
|
-
overviewRulerLanes: 0,
|
|
28
|
-
overviewRulerBorder: false,
|
|
29
|
-
selectOnLineNumbers: false,
|
|
30
|
-
wordWrap: 'off',
|
|
31
|
-
lineNumbers: 'off',
|
|
32
|
-
glyphMargin: true,
|
|
33
|
-
fixedOverflowWidgets: true,
|
|
34
|
-
minimap: { enabled: false },
|
|
35
|
-
renderValidationDecorations: 'on',
|
|
36
|
-
renderLineHighlight: 'none',
|
|
37
|
-
readOnly: true
|
|
38
|
-
};
|
|
39
|
-
const fixedDiffEditorOptions = {
|
|
40
|
-
...fixedEditorOptions,
|
|
41
|
-
glyphMargin: true,
|
|
42
|
-
enableSplitViewResizing: false,
|
|
43
|
-
renderIndicators: true,
|
|
44
|
-
renderMarginRevertIcon: false,
|
|
45
|
-
readOnly: false,
|
|
46
|
-
isInEmbeddedEditor: true,
|
|
47
|
-
renderOverviewRuler: false,
|
|
48
|
-
wordWrap: 'off',
|
|
49
|
-
diffWordWrap: 'off',
|
|
50
|
-
diffAlgorithm: 'advanced',
|
|
51
|
-
renderSideBySide: true,
|
|
52
|
-
useInlineViewWhenSpaceIsLimited: false
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
export { fixedDiffEditorOptions, fixedEditorOptions, getEditorPadding };
|