@codingame/monaco-vscode-api 1.85.0 → 1.85.1
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/README.md +19 -10
- package/contributions.js +1 -0
- package/missing-services.js +91 -5
- package/monaco-editor-treemending.patch +957 -950
- package/package.json +6 -6
- package/vscode/src/vs/base/common/jsonFormatter.js +8 -1
- package/vscode/src/vs/platform/actions/browser/buttonbar.js +128 -0
- package/vscode/src/vs/platform/extensionManagement/common/extensionManagement.js +2 -1
- package/vscode/src/vs/platform/layout/browser/zIndexRegistry.js +58 -0
- package/vscode/src/vs/platform/terminal/common/capabilities/commandDetectionCapability.js +56 -1
- package/vscode/src/vs/workbench/browser/actions/layoutActions.js +186 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.js +191 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatActions.js +238 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatExecuteActions.js +75 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.js +205 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditorInput.js +168 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatFollowups.js +35 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatInputPart.js +340 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatListRenderer.js +1195 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatMarkdownDecorationsRenderer.js +115 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatOptions.js +81 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSlashCommandContentWidget.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSlashCommandContentWidget.js +62 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatWidget.js +583 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/codeBlockPart.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/codeBlockPart.js +290 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatDynamicVariables.js +167 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/media/chat.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatContextKeys.js +6 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatModel.js +562 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatParserTypes.js +31 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatProvider.js +24 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatRequestParser.js +193 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatService.js +22 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatSlashCommands.js +52 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatViewModel.js +258 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatWidgetHistoryService.js +37 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatWordCounter.js +25 -0
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/find/simpleFindWidget.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/find/simpleFindWidget.js +388 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentColors.js +61 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentFormActions.js +49 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentNode.js +647 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentReply.js +300 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadAdditionalActions.js +60 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadBody.js +249 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadHeader.js +107 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadWidget.js +333 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/media/review.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/reactionsAction.js +99 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/timestamp.js +55 -0
- package/vscode/src/vs/workbench/contrib/comments/common/commentsConfiguration.js +2 -0
- package/vscode/src/vs/workbench/contrib/contextmenu/browser/contextmenu.contribution.js +20 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/breakpointEditorContribution.js +855 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/breakpointWidget.js +410 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/breakpointsView.js +1591 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/callStackEditorContribution.js +178 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/media/breakpointWidget.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/debug/browser/media/callStackEditorContribution.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/debug/common/debugModel.js +1485 -0
- package/vscode/src/vs/workbench/contrib/debug/common/debugSource.js +125 -0
- package/vscode/src/vs/workbench/contrib/debug/common/disassemblyViewInput.js +29 -0
- package/vscode/src/vs/workbench/contrib/extensions/common/extensionsInput.js +41 -0
- package/vscode/src/vs/workbench/contrib/extensions/common/extensionsUtils.js +102 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChat.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.js +988 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatLivePreviewWidget.js +431 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSession.js +417 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatStrategies.js +806 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatWidget.js +915 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/utils.js +19 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.js +129 -10
- package/vscode/src/vs/workbench/contrib/markdown/browser/markdownDocumentRenderer.js +205 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorInput.js +150 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorInputModel.js +480 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeMarkers/mergeMarkersController.js +5 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/diffComputer.js +90 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/editing.js +54 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/lineRange.js +108 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/mapping.js +258 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/mergeEditorModel.js +614 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/modifiedBaseRange.js +307 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/rangeUtils.js +44 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/textModelDiffs.js +165 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/telemetry.js +78 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/utils.js +169 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/common/mergeEditor.js +64 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/clipboard/cellOutputClipboard.js +49 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/findFilters.js +70 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/findMatchDecorationModel.js +120 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/findModel.js +416 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindReplaceWidget.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindReplaceWidget.js +663 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/cellOperations.js +593 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/cellOutputActions.js +72 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/coreActions.js +326 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/editActions.js +539 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/foldingController.js +265 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/insertCellActions.js +348 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebook.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookCellChat.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookCellEditorHint.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookCellInsertToolbar.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookCellOutput.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookCellStatusBar.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookCellTitleToolbar.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookDnd.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookEditorStickyScroll.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookFocusIndicator.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookFolding.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookKernelActionViewItem.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookOutline.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookToolbar.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookBrowser.js +95 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookEditor.js +437 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookEditorExtensions.js +29 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookEditorWidget.js +2730 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookIcons.js +139 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookLogger.js +17 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookOptions.js +564 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookViewEvents.js +27 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellPart.js +119 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellActionView.js +27 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellComments.js +135 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellContextKeys.js +178 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellDecorations.js +35 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellDnd.js +377 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellDragRenderer.js +97 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellEditorOptions.js +194 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellExecution.js +71 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellFocus.js +20 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellFocusIndicator.js +85 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellOutput.js +652 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellProgressBar.js +59 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellStatusPart.js +303 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellToolbarStickyScroll.js +24 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellToolbars.js +228 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/chat/cellChatActions.js +302 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/chat/cellChatController.js +438 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/chat/cellChatPart.js +45 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCell.js +435 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCellExecutionIcon.js +95 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCellRunToolbar.js +107 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/collapsedCellInput.js +29 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/collapsedCellOutput.js +59 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/foldedCellHint.js +67 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/markupCell.js +430 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/notebookCellAnchor.js +54 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/notebookCellList.js +1131 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/notebookCellListView.js +21 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/backLayerWebView.js +1591 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/cellRenderer.js +341 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/webviewPreloads.js +2155 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/webviewThemeMapping.js +65 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/OutlineEntry.js +95 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/baseCellViewModel.js +507 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/cellEditorOptions.js +85 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/cellOutputViewModel.js +47 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/cellSelectionCollection.js +40 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/codeCellViewModel.js +435 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/eventDispatcher.js +31 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/foldingModel.js +257 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/markupCellViewModel.js +239 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookOutlineEntryFactory.js +103 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookOutlineProvider.js +211 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookViewModelImpl.js +808 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/viewContext.js +8 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookEditorStickyScroll.js +381 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookEditorToolbar.js +527 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookEditorWidgetContextKeys.js +163 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookKernelQuickPickStrategy.js +651 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookKernelView.js +173 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookOverviewRuler.js +98 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookTopCellToolbar.js +62 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookCellOutputTextModel.js +101 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookCellTextModel.js +346 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookCommon.js +152 -1
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookContextKeys.js +39 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorInput.js +296 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorModel.js +261 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookExecutionService.js +3 -1
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookKernelService.js +2 -1
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookKeymapService.js +3 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookLoggingService.js +3 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookPerformance.js +16 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookRange.js +66 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/services/notebookWorkerService.js +4 -0
- package/vscode/src/vs/workbench/contrib/preferences/common/settingsEditorColorRegistry.js +130 -0
- package/vscode/src/vs/workbench/contrib/remote/browser/media/tunnelView.css.js +4 -0
- package/vscode/src/vs/workbench/contrib/remote/browser/remoteExplorer.js +847 -0
- package/vscode/src/vs/workbench/contrib/remote/browser/remoteIcons.js +89 -0
- package/vscode/src/vs/workbench/contrib/remote/browser/tunnelView.js +1942 -0
- package/vscode/src/vs/workbench/contrib/remote/browser/urlFinder.js +107 -0
- package/vscode/src/vs/workbench/contrib/search/browser/searchActionsBase.js +49 -0
- package/vscode/src/vs/workbench/contrib/search/browser/searchActionsFind.js +387 -0
- package/vscode/src/vs/workbench/contrib/search/browser/searchModel.js +2 -2
- package/vscode/src/vs/workbench/contrib/search/common/constants.js +66 -0
- package/vscode/src/vs/workbench/contrib/searchEditor/browser/constants.js +11 -0
- package/vscode/src/vs/workbench/contrib/snippets/browser/commands/abstractSnippetsActions.js +24 -0
- package/vscode/src/vs/workbench/contrib/snippets/browser/commands/fileTemplateSnippets.js +95 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminal.js +4 -1
- package/vscode/src/vs/workbench/contrib/terminal/common/terminal.js +2 -1
- package/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/featuredExtensionService.js +159 -0
- package/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedExtensionPoint.js +375 -0
- package/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedService.js +563 -0
- package/vscode/src/vs/workbench/contrib/welcomeGettingStarted/common/gettingStartedContent.js +932 -0
- package/vscode/src/vs/workbench/services/layout/browser/layoutService.js +15 -1
- package/vscode/src/vs/workbench/services/remote/common/remoteExplorerService.d.ts +2 -2
- package/vscode/src/vs/workbench/services/remote/common/remoteExplorerService.js +190 -2
- package/vscode/src/vs/workbench/services/workingCopy/common/resourceWorkingCopy.js +77 -0
- package/assets/break.mp3 +0 -0
- package/assets/chatRequestSent.mp3 +0 -0
- package/assets/chatResponsePending.mp3 +0 -0
- package/assets/chatResponseReceived1.mp3 +0 -0
- package/assets/chatResponseReceived2.mp3 +0 -0
- package/assets/chatResponseReceived3.mp3 +0 -0
- package/assets/chatResponseReceived4.mp3 +0 -0
- package/assets/clear.mp3 +0 -0
- package/assets/defaultIcon.png +0 -0
- package/assets/diffLineDeleted.mp3 +0 -0
- package/assets/diffLineInserted.mp3 +0 -0
- package/assets/diffLineModified.mp3 +0 -0
- package/assets/error.mp3 +0 -0
- package/assets/fake.html +0 -10
- package/assets/foldedAreas.mp3 +0 -0
- package/assets/format.mp3 +0 -0
- package/assets/index-no-csp.html +0 -1226
- package/assets/index.html +0 -1227
- package/assets/quickFixes.mp3 +0 -0
- package/assets/save.mp3 +0 -0
- package/assets/service-worker.js +0 -457
- package/assets/taskCompleted.mp3 +0 -0
- package/assets/taskFailed.mp3 +0 -0
- package/assets/terminalBell.mp3 +0 -0
- package/assets/warning.mp3 +0 -0
- package/assets/webWorkerExtensionHostIframe.html +0 -123
- package/override/vs/workbench/contrib/notebook/browser/contrib/find/findMatchDecorationModel.js +0 -2
- package/override/vs/workbench/contrib/notebook/browser/notebookEditorWidget.js +0 -2
- package/override/vs/workbench/contrib/notebook/common/notebookEditorInput.js +0 -5
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import { ActionViewItem } from 'monaco-editor/esm/vs/base/browser/ui/actionbar/actionViewItems.js';
|
|
3
|
+
import { Action } from 'monaco-editor/esm/vs/base/common/actions.js';
|
|
4
|
+
import { localizeWithPath } from 'monaco-editor/esm/vs/nls.js';
|
|
5
|
+
import { registerAction2, Action2, MenuId } from 'monaco-editor/esm/vs/platform/actions/common/actions.js';
|
|
6
|
+
import { ContextKeyExpr } from 'monaco-editor/esm/vs/platform/contextkey/common/contextkey.js';
|
|
7
|
+
import { ExtensionIdentifier } from 'monaco-editor/esm/vs/platform/extensions/common/extensions.js';
|
|
8
|
+
import { IInstantiationService } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
|
|
9
|
+
import { ThemeIcon } from 'monaco-editor/esm/vs/base/common/themables.js';
|
|
10
|
+
import { SELECT_KERNEL_ID, NOTEBOOK_ACTIONS_CATEGORY } from '../controller/coreActions.js';
|
|
11
|
+
import { getNotebookEditorFromEditorPane } from '../notebookBrowser.js';
|
|
12
|
+
import { selectKernelIcon } from '../notebookIcons.js';
|
|
13
|
+
import { KernelPickerMRUStrategy } from './notebookKernelQuickPickStrategy.js';
|
|
14
|
+
import { NOTEBOOK_IS_ACTIVE_EDITOR, NOTEBOOK_KERNEL_COUNT } from '../../common/notebookContextKeys.js';
|
|
15
|
+
import { INotebookKernelService, INotebookKernelHistoryService } from '../../common/notebookKernelService.js';
|
|
16
|
+
import { IEditorService } from '../../../../services/editor/common/editorService.js';
|
|
17
|
+
function getEditorFromContext(editorService, context) {
|
|
18
|
+
let editor;
|
|
19
|
+
if (context !== undefined && 'notebookEditorId' in context) {
|
|
20
|
+
const editorId = context.notebookEditorId;
|
|
21
|
+
const matchingEditor = editorService.visibleEditorPanes.find((editorPane) => {
|
|
22
|
+
const notebookEditor = getNotebookEditorFromEditorPane(editorPane);
|
|
23
|
+
return notebookEditor?.getId() === editorId;
|
|
24
|
+
});
|
|
25
|
+
editor = getNotebookEditorFromEditorPane(matchingEditor);
|
|
26
|
+
}
|
|
27
|
+
else if (context !== undefined && 'notebookEditor' in context) {
|
|
28
|
+
editor = context?.notebookEditor;
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
editor = getNotebookEditorFromEditorPane(editorService.activeEditorPane);
|
|
32
|
+
}
|
|
33
|
+
return editor;
|
|
34
|
+
}
|
|
35
|
+
registerAction2(class extends Action2 {
|
|
36
|
+
constructor() {
|
|
37
|
+
super({
|
|
38
|
+
id: SELECT_KERNEL_ID,
|
|
39
|
+
category: NOTEBOOK_ACTIONS_CATEGORY,
|
|
40
|
+
title: { value: ( localizeWithPath(
|
|
41
|
+
'vs/workbench/contrib/notebook/browser/viewParts/notebookKernelView',
|
|
42
|
+
'notebookActions.selectKernel',
|
|
43
|
+
"Select Notebook Kernel"
|
|
44
|
+
)), original: 'Select Notebook Kernel' },
|
|
45
|
+
icon: selectKernelIcon,
|
|
46
|
+
f1: true,
|
|
47
|
+
precondition: NOTEBOOK_IS_ACTIVE_EDITOR,
|
|
48
|
+
menu: [{
|
|
49
|
+
id: MenuId.EditorTitle,
|
|
50
|
+
when: ( ContextKeyExpr.and(NOTEBOOK_IS_ACTIVE_EDITOR, ( ContextKeyExpr.notEquals('config.notebook.globalToolbar', true)))),
|
|
51
|
+
group: 'navigation',
|
|
52
|
+
order: -10
|
|
53
|
+
}, {
|
|
54
|
+
id: MenuId.NotebookToolbar,
|
|
55
|
+
when: ( ContextKeyExpr.equals('config.notebook.globalToolbar', true)),
|
|
56
|
+
group: 'status',
|
|
57
|
+
order: -10
|
|
58
|
+
}, {
|
|
59
|
+
id: MenuId.InteractiveToolbar,
|
|
60
|
+
when: ( NOTEBOOK_KERNEL_COUNT.notEqualsTo(0)),
|
|
61
|
+
group: 'status',
|
|
62
|
+
order: -10
|
|
63
|
+
}],
|
|
64
|
+
metadata: {
|
|
65
|
+
description: ( localizeWithPath(
|
|
66
|
+
'vs/workbench/contrib/notebook/browser/viewParts/notebookKernelView',
|
|
67
|
+
'notebookActions.selectKernel.args',
|
|
68
|
+
"Notebook Kernel Args"
|
|
69
|
+
)),
|
|
70
|
+
args: [
|
|
71
|
+
{
|
|
72
|
+
name: 'kernelInfo',
|
|
73
|
+
description: 'The kernel info',
|
|
74
|
+
schema: {
|
|
75
|
+
'type': 'object',
|
|
76
|
+
'required': ['id', 'extension'],
|
|
77
|
+
'properties': {
|
|
78
|
+
'id': {
|
|
79
|
+
'type': 'string'
|
|
80
|
+
},
|
|
81
|
+
'extension': {
|
|
82
|
+
'type': 'string'
|
|
83
|
+
},
|
|
84
|
+
'notebookEditorId': {
|
|
85
|
+
'type': 'string'
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
]
|
|
91
|
+
},
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
async run(accessor, context) {
|
|
95
|
+
const instantiationService = accessor.get(IInstantiationService);
|
|
96
|
+
const editorService = accessor.get(IEditorService);
|
|
97
|
+
const editor = getEditorFromContext(editorService, context);
|
|
98
|
+
if (!editor || !editor.hasModel()) {
|
|
99
|
+
return false;
|
|
100
|
+
}
|
|
101
|
+
let controllerId = context && 'id' in context ? context.id : undefined;
|
|
102
|
+
let extensionId = context && 'extension' in context ? context.extension : undefined;
|
|
103
|
+
if (controllerId && (typeof controllerId !== 'string' || typeof extensionId !== 'string')) {
|
|
104
|
+
controllerId = undefined;
|
|
105
|
+
extensionId = undefined;
|
|
106
|
+
}
|
|
107
|
+
const notebook = editor.textModel;
|
|
108
|
+
const notebookKernelService = accessor.get(INotebookKernelService);
|
|
109
|
+
const matchResult = notebookKernelService.getMatchingKernel(notebook);
|
|
110
|
+
const { selected } = matchResult;
|
|
111
|
+
if (selected && controllerId && selected.id === controllerId && ExtensionIdentifier.equals(selected.extension, extensionId)) {
|
|
112
|
+
return true;
|
|
113
|
+
}
|
|
114
|
+
const wantedKernelId = controllerId ? `${extensionId}/${controllerId}` : undefined;
|
|
115
|
+
const strategy = instantiationService.createInstance(KernelPickerMRUStrategy);
|
|
116
|
+
return strategy.showQuickPick(editor, wantedKernelId);
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
let NotebooKernelActionViewItem = class NotebooKernelActionViewItem extends ActionViewItem {
|
|
120
|
+
constructor(actualAction, _editor, _notebookKernelService, _notebookKernelHistoryService) {
|
|
121
|
+
super(undefined, ( new Action(
|
|
122
|
+
'fakeAction',
|
|
123
|
+
undefined,
|
|
124
|
+
ThemeIcon.asClassName(selectKernelIcon),
|
|
125
|
+
true,
|
|
126
|
+
(event) => actualAction.run(event)
|
|
127
|
+
)), { label: false, icon: true });
|
|
128
|
+
this._editor = _editor;
|
|
129
|
+
this._notebookKernelService = _notebookKernelService;
|
|
130
|
+
this._notebookKernelHistoryService = _notebookKernelHistoryService;
|
|
131
|
+
this._register(_editor.onDidChangeModel(this._update, this));
|
|
132
|
+
this._register(_notebookKernelService.onDidAddKernel(this._update, this));
|
|
133
|
+
this._register(_notebookKernelService.onDidRemoveKernel(this._update, this));
|
|
134
|
+
this._register(_notebookKernelService.onDidChangeNotebookAffinity(this._update, this));
|
|
135
|
+
this._register(_notebookKernelService.onDidChangeSelectedNotebooks(this._update, this));
|
|
136
|
+
this._register(_notebookKernelService.onDidChangeSourceActions(this._update, this));
|
|
137
|
+
this._register(_notebookKernelService.onDidChangeKernelDetectionTasks(this._update, this));
|
|
138
|
+
}
|
|
139
|
+
render(container) {
|
|
140
|
+
this._update();
|
|
141
|
+
super.render(container);
|
|
142
|
+
container.classList.add('kernel-action-view-item');
|
|
143
|
+
this._kernelLabel = document.createElement('a');
|
|
144
|
+
container.appendChild(this._kernelLabel);
|
|
145
|
+
this.updateLabel();
|
|
146
|
+
}
|
|
147
|
+
updateLabel() {
|
|
148
|
+
if (this._kernelLabel) {
|
|
149
|
+
this._kernelLabel.classList.add('kernel-label');
|
|
150
|
+
this._kernelLabel.innerText = this._action.label;
|
|
151
|
+
this._kernelLabel.title = this._action.tooltip;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
_update() {
|
|
155
|
+
const notebook = this._editor.textModel;
|
|
156
|
+
if (!notebook) {
|
|
157
|
+
this._resetAction();
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
KernelPickerMRUStrategy.updateKernelStatusAction(notebook, this._action, this._notebookKernelService, this._notebookKernelHistoryService);
|
|
161
|
+
this.updateClass();
|
|
162
|
+
}
|
|
163
|
+
_resetAction() {
|
|
164
|
+
this._action.enabled = false;
|
|
165
|
+
this._action.label = '';
|
|
166
|
+
this._action.class = '';
|
|
167
|
+
}
|
|
168
|
+
};
|
|
169
|
+
NotebooKernelActionViewItem = ( __decorate([
|
|
170
|
+
( __param(2, INotebookKernelService)),
|
|
171
|
+
( __param(3, INotebookKernelHistoryService))
|
|
172
|
+
], NotebooKernelActionViewItem));
|
|
173
|
+
export { NotebooKernelActionViewItem };
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import * as browser from 'monaco-editor/esm/vs/base/browser/browser.js';
|
|
3
|
+
import { createFastDomNode } from 'monaco-editor/esm/vs/base/browser/fastDomNode.js';
|
|
4
|
+
import { Themable, IThemeService } from 'monaco-editor/esm/vs/platform/theme/common/themeService.js';
|
|
5
|
+
import { NotebookOverviewRulerLane } from '../notebookBrowser.js';
|
|
6
|
+
let NotebookOverviewRuler = class NotebookOverviewRuler extends Themable {
|
|
7
|
+
constructor(notebookEditor, container, themeService) {
|
|
8
|
+
super(themeService);
|
|
9
|
+
this.notebookEditor = notebookEditor;
|
|
10
|
+
this._lanes = 3;
|
|
11
|
+
this._domNode = createFastDomNode(document.createElement('canvas'));
|
|
12
|
+
this._domNode.setPosition('relative');
|
|
13
|
+
this._domNode.setLayerHinting(true);
|
|
14
|
+
this._domNode.setContain('strict');
|
|
15
|
+
container.appendChild(this._domNode.domNode);
|
|
16
|
+
this._register(notebookEditor.onDidChangeDecorations(() => {
|
|
17
|
+
this.layout();
|
|
18
|
+
}));
|
|
19
|
+
this._register(browser.PixelRatio.onDidChange(() => {
|
|
20
|
+
this.layout();
|
|
21
|
+
}));
|
|
22
|
+
}
|
|
23
|
+
layout() {
|
|
24
|
+
const width = 10;
|
|
25
|
+
const layoutInfo = this.notebookEditor.getLayoutInfo();
|
|
26
|
+
const scrollHeight = layoutInfo.scrollHeight;
|
|
27
|
+
const height = layoutInfo.height;
|
|
28
|
+
const ratio = browser.PixelRatio.value;
|
|
29
|
+
this._domNode.setWidth(width);
|
|
30
|
+
this._domNode.setHeight(height);
|
|
31
|
+
this._domNode.domNode.width = width * ratio;
|
|
32
|
+
this._domNode.domNode.height = height * ratio;
|
|
33
|
+
const ctx = this._domNode.domNode.getContext('2d');
|
|
34
|
+
ctx.clearRect(0, 0, width * ratio, height * ratio);
|
|
35
|
+
this._render(ctx, width * ratio, height * ratio, scrollHeight * ratio, ratio);
|
|
36
|
+
}
|
|
37
|
+
_render(ctx, width, height, scrollHeight, ratio) {
|
|
38
|
+
const viewModel = this.notebookEditor.getViewModel();
|
|
39
|
+
const fontInfo = this.notebookEditor.getLayoutInfo().fontInfo;
|
|
40
|
+
const laneWidth = width / this._lanes;
|
|
41
|
+
let currentFrom = 0;
|
|
42
|
+
if (viewModel) {
|
|
43
|
+
for (let i = 0; i < viewModel.viewCells.length; i++) {
|
|
44
|
+
const viewCell = viewModel.viewCells[i];
|
|
45
|
+
const textBuffer = viewCell.textBuffer;
|
|
46
|
+
const decorations = viewCell.getCellDecorations();
|
|
47
|
+
const cellHeight = (viewCell.layoutInfo.totalHeight / scrollHeight) * ratio * height;
|
|
48
|
+
decorations.filter(decoration => decoration.overviewRuler).forEach(decoration => {
|
|
49
|
+
const overviewRuler = decoration.overviewRuler;
|
|
50
|
+
const fillStyle = this.getColor(overviewRuler.color) ?? '#000000';
|
|
51
|
+
const lineHeight = Math.min(fontInfo.lineHeight, (viewCell.layoutInfo.editorHeight / scrollHeight / textBuffer.getLineCount()) * ratio * height);
|
|
52
|
+
const lineNumbers = ( overviewRuler.modelRanges.map(range => range.startLineNumber)).reduce((previous, current) => {
|
|
53
|
+
if (previous.length === 0) {
|
|
54
|
+
previous.push(current);
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
const last = previous[previous.length - 1];
|
|
58
|
+
if (last !== current) {
|
|
59
|
+
previous.push(current);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return previous;
|
|
63
|
+
}, []);
|
|
64
|
+
let x = 0;
|
|
65
|
+
switch (overviewRuler.position) {
|
|
66
|
+
case NotebookOverviewRulerLane.Left:
|
|
67
|
+
x = 0;
|
|
68
|
+
break;
|
|
69
|
+
case NotebookOverviewRulerLane.Center:
|
|
70
|
+
x = laneWidth;
|
|
71
|
+
break;
|
|
72
|
+
case NotebookOverviewRulerLane.Right:
|
|
73
|
+
x = laneWidth * 2;
|
|
74
|
+
break;
|
|
75
|
+
}
|
|
76
|
+
const width = overviewRuler.position === NotebookOverviewRulerLane.Full ? laneWidth * 3 : laneWidth;
|
|
77
|
+
for (let i = 0; i < lineNumbers.length; i++) {
|
|
78
|
+
ctx.fillStyle = fillStyle;
|
|
79
|
+
const lineNumber = lineNumbers[i];
|
|
80
|
+
const offset = (lineNumber - 1) * lineHeight;
|
|
81
|
+
ctx.fillRect(x, currentFrom + offset, width, lineHeight);
|
|
82
|
+
}
|
|
83
|
+
if (overviewRuler.includeOutput) {
|
|
84
|
+
ctx.fillStyle = fillStyle;
|
|
85
|
+
const outputOffset = (viewCell.layoutInfo.editorHeight / scrollHeight) * ratio * height;
|
|
86
|
+
const decorationHeight = (fontInfo.lineHeight / scrollHeight) * ratio * height;
|
|
87
|
+
ctx.fillRect(laneWidth, currentFrom + outputOffset, laneWidth, decorationHeight);
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
currentFrom += cellHeight;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
NotebookOverviewRuler = ( __decorate([
|
|
96
|
+
( __param(2, IThemeService))
|
|
97
|
+
], NotebookOverviewRuler));
|
|
98
|
+
export { NotebookOverviewRuler };
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import * as dom from 'monaco-editor/esm/vs/base/browser/dom.js';
|
|
3
|
+
import { Disposable, DisposableStore } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
4
|
+
import { MenuWorkbenchToolBar } from 'monaco-editor/esm/vs/platform/actions/browser/toolbar.js';
|
|
5
|
+
import { MenuItemAction, IMenuService } from 'monaco-editor/esm/vs/platform/actions/common/actions.js';
|
|
6
|
+
import { IContextMenuService } from 'monaco-editor/esm/vs/platform/contextview/browser/contextView.js';
|
|
7
|
+
import { IInstantiationService } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
|
|
8
|
+
import { CodiconActionViewItem } from '../view/cellParts/cellActionView.js';
|
|
9
|
+
let ListTopCellToolbar = class ListTopCellToolbar extends Disposable {
|
|
10
|
+
constructor(notebookEditor, contextKeyService, insertionIndicatorContainer, instantiationService, contextMenuService, menuService) {
|
|
11
|
+
super();
|
|
12
|
+
this.notebookEditor = notebookEditor;
|
|
13
|
+
this.instantiationService = instantiationService;
|
|
14
|
+
this.contextMenuService = contextMenuService;
|
|
15
|
+
this.menuService = menuService;
|
|
16
|
+
this._modelDisposables = this._register(( new DisposableStore()));
|
|
17
|
+
this.topCellToolbar = dom.append(insertionIndicatorContainer, dom.$('.cell-list-top-cell-toolbar-container'));
|
|
18
|
+
this.toolbar = this._register(instantiationService.createInstance(MenuWorkbenchToolBar, this.topCellToolbar, this.notebookEditor.creationOptions.menuIds.cellTopInsertToolbar, {
|
|
19
|
+
actionViewItemProvider: action => {
|
|
20
|
+
if (action instanceof MenuItemAction) {
|
|
21
|
+
const item = this.instantiationService.createInstance(CodiconActionViewItem, action, undefined);
|
|
22
|
+
return item;
|
|
23
|
+
}
|
|
24
|
+
return undefined;
|
|
25
|
+
},
|
|
26
|
+
menuOptions: {
|
|
27
|
+
shouldForwardArgs: true
|
|
28
|
+
},
|
|
29
|
+
toolbarOptions: {
|
|
30
|
+
primaryGroup: (g) => /^inline/.test(g),
|
|
31
|
+
},
|
|
32
|
+
hiddenItemStrategy: 0 ,
|
|
33
|
+
}));
|
|
34
|
+
this.toolbar.context = {
|
|
35
|
+
notebookEditor
|
|
36
|
+
};
|
|
37
|
+
this._register(this.notebookEditor.onDidChangeModel(() => {
|
|
38
|
+
this._modelDisposables.clear();
|
|
39
|
+
if (this.notebookEditor.hasModel()) {
|
|
40
|
+
this._modelDisposables.add(this.notebookEditor.onDidChangeViewCells(() => {
|
|
41
|
+
this.updateClass();
|
|
42
|
+
}));
|
|
43
|
+
this.updateClass();
|
|
44
|
+
}
|
|
45
|
+
}));
|
|
46
|
+
this.updateClass();
|
|
47
|
+
}
|
|
48
|
+
updateClass() {
|
|
49
|
+
if (this.notebookEditor.hasModel() && this.notebookEditor.getLength() === 0) {
|
|
50
|
+
this.topCellToolbar.classList.add('emptyNotebook');
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
this.topCellToolbar.classList.remove('emptyNotebook');
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
ListTopCellToolbar = ( __decorate([
|
|
58
|
+
( __param(3, IInstantiationService)),
|
|
59
|
+
( __param(4, IContextMenuService)),
|
|
60
|
+
( __param(5, IMenuService))
|
|
61
|
+
], ListTopCellToolbar));
|
|
62
|
+
export { ListTopCellToolbar };
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { Emitter } from 'monaco-editor/esm/vs/base/common/event.js';
|
|
2
|
+
import { Disposable } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
3
|
+
import { isTextStreamMime, compressOutputItemStreams } from '../notebookCommon.js';
|
|
4
|
+
class NotebookCellOutputTextModel extends Disposable {
|
|
5
|
+
get outputs() {
|
|
6
|
+
return this._rawOutput.outputs || [];
|
|
7
|
+
}
|
|
8
|
+
get metadata() {
|
|
9
|
+
return this._rawOutput.metadata;
|
|
10
|
+
}
|
|
11
|
+
get outputId() {
|
|
12
|
+
return this._rawOutput.outputId;
|
|
13
|
+
}
|
|
14
|
+
get alternativeOutputId() {
|
|
15
|
+
return this._alternativeOutputId;
|
|
16
|
+
}
|
|
17
|
+
get versionId() {
|
|
18
|
+
return this._versionId;
|
|
19
|
+
}
|
|
20
|
+
constructor(_rawOutput) {
|
|
21
|
+
super();
|
|
22
|
+
this._rawOutput = _rawOutput;
|
|
23
|
+
this._onDidChangeData = this._register(( new Emitter()));
|
|
24
|
+
this.onDidChangeData = this._onDidChangeData.event;
|
|
25
|
+
this._versionId = 0;
|
|
26
|
+
this.versionedBufferLengths = {};
|
|
27
|
+
this._alternativeOutputId = this._rawOutput.outputId;
|
|
28
|
+
}
|
|
29
|
+
replaceData(rawData) {
|
|
30
|
+
this.versionedBufferLengths = {};
|
|
31
|
+
this._rawOutput = rawData;
|
|
32
|
+
this.optimizeOutputItems();
|
|
33
|
+
this._versionId = this._versionId + 1;
|
|
34
|
+
this._onDidChangeData.fire();
|
|
35
|
+
}
|
|
36
|
+
appendData(items) {
|
|
37
|
+
this.trackBufferLengths();
|
|
38
|
+
this._rawOutput.outputs.push(...items);
|
|
39
|
+
this.optimizeOutputItems();
|
|
40
|
+
this._versionId = this._versionId + 1;
|
|
41
|
+
this._onDidChangeData.fire();
|
|
42
|
+
}
|
|
43
|
+
trackBufferLengths() {
|
|
44
|
+
this.outputs.forEach(output => {
|
|
45
|
+
if (isTextStreamMime(output.mime)) {
|
|
46
|
+
if (!this.versionedBufferLengths[output.mime]) {
|
|
47
|
+
this.versionedBufferLengths[output.mime] = {};
|
|
48
|
+
}
|
|
49
|
+
this.versionedBufferLengths[output.mime][this.versionId] = output.data.byteLength;
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
appendedSinceVersion(versionId, mime) {
|
|
54
|
+
const bufferLength = this.versionedBufferLengths[mime]?.[versionId];
|
|
55
|
+
const output = this.outputs.find(output => output.mime === mime);
|
|
56
|
+
if (bufferLength && output) {
|
|
57
|
+
return output.data.slice(bufferLength);
|
|
58
|
+
}
|
|
59
|
+
return undefined;
|
|
60
|
+
}
|
|
61
|
+
optimizeOutputItems() {
|
|
62
|
+
if (this.outputs.length > 1 && this.outputs.every(item => isTextStreamMime(item.mime))) {
|
|
63
|
+
const mimeOutputs = ( new Map());
|
|
64
|
+
const mimeTypes = [];
|
|
65
|
+
this.outputs.forEach(item => {
|
|
66
|
+
let items;
|
|
67
|
+
if (( mimeOutputs.has(item.mime))) {
|
|
68
|
+
items = mimeOutputs.get(item.mime);
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
items = [];
|
|
72
|
+
mimeOutputs.set(item.mime, items);
|
|
73
|
+
mimeTypes.push(item.mime);
|
|
74
|
+
}
|
|
75
|
+
items.push(item.data.buffer);
|
|
76
|
+
});
|
|
77
|
+
this.outputs.length = 0;
|
|
78
|
+
mimeTypes.forEach(mime => {
|
|
79
|
+
const compressionResult = compressOutputItemStreams(mimeOutputs.get(mime));
|
|
80
|
+
this.outputs.push({
|
|
81
|
+
mime,
|
|
82
|
+
data: compressionResult.data
|
|
83
|
+
});
|
|
84
|
+
if (compressionResult.didCompression) {
|
|
85
|
+
this.versionedBufferLengths = {};
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
asDto() {
|
|
91
|
+
return {
|
|
92
|
+
metadata: this._rawOutput.metadata,
|
|
93
|
+
outputs: this._rawOutput.outputs,
|
|
94
|
+
outputId: this._rawOutput.outputId
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
bumpVersion() {
|
|
98
|
+
this._versionId = this._versionId + 1;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
export { NotebookCellOutputTextModel };
|