@codingame/monaco-vscode-api 1.85.0-next.2 → 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 +2540 -2533
- 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,85 @@
|
|
|
1
|
+
import { Emitter } from 'monaco-editor/esm/vs/base/common/event.js';
|
|
2
|
+
import { Disposable, DisposableStore } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
3
|
+
import { deepClone } from 'monaco-editor/esm/vs/base/common/objects.js';
|
|
4
|
+
class BaseCellEditorOptions extends Disposable {
|
|
5
|
+
static { this.fixedEditorOptions = {
|
|
6
|
+
scrollBeyondLastLine: false,
|
|
7
|
+
scrollbar: {
|
|
8
|
+
verticalScrollbarSize: 14,
|
|
9
|
+
horizontal: 'auto',
|
|
10
|
+
useShadows: true,
|
|
11
|
+
verticalHasArrows: false,
|
|
12
|
+
horizontalHasArrows: false,
|
|
13
|
+
alwaysConsumeMouseWheel: false
|
|
14
|
+
},
|
|
15
|
+
renderLineHighlightOnlyWhenFocus: true,
|
|
16
|
+
overviewRulerLanes: 0,
|
|
17
|
+
lineDecorationsWidth: 0,
|
|
18
|
+
folding: true,
|
|
19
|
+
fixedOverflowWidgets: true,
|
|
20
|
+
minimap: { enabled: false },
|
|
21
|
+
renderValidationDecorations: 'on',
|
|
22
|
+
lineNumbersMinChars: 3
|
|
23
|
+
}; }
|
|
24
|
+
get value() {
|
|
25
|
+
return this._value;
|
|
26
|
+
}
|
|
27
|
+
constructor(notebookEditor, notebookOptions, configurationService, language) {
|
|
28
|
+
super();
|
|
29
|
+
this.notebookEditor = notebookEditor;
|
|
30
|
+
this.notebookOptions = notebookOptions;
|
|
31
|
+
this.configurationService = configurationService;
|
|
32
|
+
this.language = language;
|
|
33
|
+
this._localDisposableStore = this._register(( new DisposableStore()));
|
|
34
|
+
this._onDidChange = this._register(( new Emitter()));
|
|
35
|
+
this.onDidChange = this._onDidChange.event;
|
|
36
|
+
this._register(configurationService.onDidChangeConfiguration(e => {
|
|
37
|
+
if (e.affectsConfiguration('editor') || e.affectsConfiguration('notebook')) {
|
|
38
|
+
this._recomputeOptions();
|
|
39
|
+
}
|
|
40
|
+
}));
|
|
41
|
+
this._register(notebookOptions.onDidChangeOptions(e => {
|
|
42
|
+
if (e.cellStatusBarVisibility || e.editorTopPadding || e.editorOptionsCustomizations) {
|
|
43
|
+
this._recomputeOptions();
|
|
44
|
+
}
|
|
45
|
+
}));
|
|
46
|
+
this._register(this.notebookEditor.onDidChangeModel(() => {
|
|
47
|
+
this._localDisposableStore.clear();
|
|
48
|
+
if (this.notebookEditor.hasModel()) {
|
|
49
|
+
this._localDisposableStore.add(this.notebookEditor.onDidChangeOptions(() => {
|
|
50
|
+
this._recomputeOptions();
|
|
51
|
+
}));
|
|
52
|
+
this._recomputeOptions();
|
|
53
|
+
}
|
|
54
|
+
}));
|
|
55
|
+
if (this.notebookEditor.hasModel()) {
|
|
56
|
+
this._localDisposableStore.add(this.notebookEditor.onDidChangeOptions(() => {
|
|
57
|
+
this._recomputeOptions();
|
|
58
|
+
}));
|
|
59
|
+
}
|
|
60
|
+
this._value = this._computeEditorOptions();
|
|
61
|
+
}
|
|
62
|
+
_recomputeOptions() {
|
|
63
|
+
this._value = this._computeEditorOptions();
|
|
64
|
+
this._onDidChange.fire();
|
|
65
|
+
}
|
|
66
|
+
_computeEditorOptions() {
|
|
67
|
+
const editorOptions = deepClone(this.configurationService.getValue('editor', { overrideIdentifier: this.language }));
|
|
68
|
+
const editorOptionsOverrideRaw = this.notebookOptions.getDisplayOptions().editorOptionsCustomizations ?? {};
|
|
69
|
+
const editorOptionsOverride = {};
|
|
70
|
+
for (const key in editorOptionsOverrideRaw) {
|
|
71
|
+
if (key.indexOf('editor.') === 0) {
|
|
72
|
+
editorOptionsOverride[key.substring(7)] = editorOptionsOverrideRaw[key];
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
const computed = ( Object.freeze({
|
|
76
|
+
...editorOptions,
|
|
77
|
+
...BaseCellEditorOptions.fixedEditorOptions,
|
|
78
|
+
...editorOptionsOverride,
|
|
79
|
+
...{ padding: { top: 12, bottom: 12 } },
|
|
80
|
+
readOnly: this.notebookEditor.isReadOnly
|
|
81
|
+
}));
|
|
82
|
+
return computed;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
export { BaseCellEditorOptions };
|
|
@@ -0,0 +1,47 @@
|
|
|
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 { RENDERER_NOT_AVAILABLE } from '../../common/notebookCommon.js';
|
|
4
|
+
let handle = 0;
|
|
5
|
+
class CellOutputViewModel extends Disposable {
|
|
6
|
+
get model() {
|
|
7
|
+
return this._outputRawData;
|
|
8
|
+
}
|
|
9
|
+
get pickedMimeType() {
|
|
10
|
+
return this._pickedMimeType;
|
|
11
|
+
}
|
|
12
|
+
set pickedMimeType(value) {
|
|
13
|
+
this._pickedMimeType = value;
|
|
14
|
+
}
|
|
15
|
+
constructor(cellViewModel, _outputRawData, _notebookService) {
|
|
16
|
+
super();
|
|
17
|
+
this.cellViewModel = cellViewModel;
|
|
18
|
+
this._outputRawData = _outputRawData;
|
|
19
|
+
this._notebookService = _notebookService;
|
|
20
|
+
this._onDidResetRendererEmitter = this._register(( new Emitter()));
|
|
21
|
+
this.onDidResetRenderer = this._onDidResetRendererEmitter.event;
|
|
22
|
+
this.outputHandle = handle++;
|
|
23
|
+
}
|
|
24
|
+
hasMultiMimeType() {
|
|
25
|
+
if (this._outputRawData.outputs.length < 2) {
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
const firstMimeType = this._outputRawData.outputs[0].mime;
|
|
29
|
+
return ( this._outputRawData.outputs.some(output => output.mime !== firstMimeType));
|
|
30
|
+
}
|
|
31
|
+
resolveMimeTypes(textModel, kernelProvides) {
|
|
32
|
+
const mimeTypes = this._notebookService.getOutputMimeTypeInfo(textModel, kernelProvides, this.model);
|
|
33
|
+
const index = mimeTypes.findIndex(mimeType => mimeType.rendererId !== RENDERER_NOT_AVAILABLE && mimeType.isTrusted);
|
|
34
|
+
return [mimeTypes, Math.max(index, 0)];
|
|
35
|
+
}
|
|
36
|
+
resetRenderer() {
|
|
37
|
+
this._pickedMimeType = undefined;
|
|
38
|
+
this.model.bumpVersion();
|
|
39
|
+
this._onDidResetRendererEmitter.fire();
|
|
40
|
+
}
|
|
41
|
+
toRawJSON() {
|
|
42
|
+
return {
|
|
43
|
+
outputs: this._outputRawData.outputs,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
export { CellOutputViewModel };
|
|
@@ -0,0 +1,40 @@
|
|
|
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
|
+
function rangesEqual(a, b) {
|
|
4
|
+
if (a.length !== b.length) {
|
|
5
|
+
return false;
|
|
6
|
+
}
|
|
7
|
+
for (let i = 0; i < a.length; i++) {
|
|
8
|
+
if (a[i].start !== b[i].start || a[i].end !== b[i].end) {
|
|
9
|
+
return false;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
return true;
|
|
13
|
+
}
|
|
14
|
+
class NotebookCellSelectionCollection extends Disposable {
|
|
15
|
+
constructor() {
|
|
16
|
+
super(...arguments);
|
|
17
|
+
this._onDidChangeSelection = this._register(( new Emitter()));
|
|
18
|
+
this._primary = null;
|
|
19
|
+
this._selections = [];
|
|
20
|
+
}
|
|
21
|
+
get onDidChangeSelection() { return this._onDidChangeSelection.event; }
|
|
22
|
+
get selections() {
|
|
23
|
+
return this._selections;
|
|
24
|
+
}
|
|
25
|
+
get focus() {
|
|
26
|
+
return this._primary ?? { start: 0, end: 0 };
|
|
27
|
+
}
|
|
28
|
+
setState(primary, selections, forceEventEmit, source) {
|
|
29
|
+
const changed = primary !== this._primary || !rangesEqual(this._selections, selections);
|
|
30
|
+
this._primary = primary;
|
|
31
|
+
this._selections = selections;
|
|
32
|
+
if (changed || forceEventEmit) {
|
|
33
|
+
this._onDidChangeSelection.fire(source);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
setSelections(selections, forceEventEmit, source) {
|
|
37
|
+
this.setState(this._primary, selections, forceEventEmit, source);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
export { NotebookCellSelectionCollection };
|
|
@@ -0,0 +1,435 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import { Emitter, PauseableEmitter } from 'monaco-editor/esm/vs/base/common/event.js';
|
|
3
|
+
import { dispose } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
4
|
+
import * as UUID from 'monaco-editor/esm/vs/base/common/uuid.js';
|
|
5
|
+
import { ICodeEditorService } from 'monaco-editor/esm/vs/editor/browser/services/codeEditorService.js';
|
|
6
|
+
import { ITextModelService } from 'monaco-editor/esm/vs/editor/common/services/resolverService.js';
|
|
7
|
+
import { PrefixSumComputer } from 'monaco-editor/esm/vs/editor/common/model/prefixSumComputer.js';
|
|
8
|
+
import { IConfigurationService } from 'monaco-editor/esm/vs/platform/configuration/common/configuration.js';
|
|
9
|
+
import { IUndoRedoService } from 'monaco-editor/esm/vs/platform/undoRedo/common/undoRedo.js';
|
|
10
|
+
import { CellLayoutState, CellEditState } from '../notebookBrowser.js';
|
|
11
|
+
import { CellOutputViewModel } from './cellOutputViewModel.js';
|
|
12
|
+
import { CellKind } from '../../common/notebookCommon.js';
|
|
13
|
+
import { INotebookService } from '../../common/notebookService.js';
|
|
14
|
+
import { BaseCellViewModel } from './baseCellViewModel.js';
|
|
15
|
+
const outputDisplayLimit = 500;
|
|
16
|
+
let CodeCellViewModel = class CodeCellViewModel extends BaseCellViewModel {
|
|
17
|
+
set editorHeight(height) {
|
|
18
|
+
if (this._editorHeight === height) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
this._editorHeight = height;
|
|
22
|
+
this.layoutChange({ editorHeight: true }, 'CodeCellViewModel#editorHeight');
|
|
23
|
+
}
|
|
24
|
+
get editorHeight() {
|
|
25
|
+
throw new Error('editorHeight is write-only');
|
|
26
|
+
}
|
|
27
|
+
set chatHeight(height) {
|
|
28
|
+
if (this._chatHeight === height) {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
this._chatHeight = height;
|
|
32
|
+
this.layoutChange({ chatHeight: true }, 'CodeCellViewModel#chatHeight');
|
|
33
|
+
}
|
|
34
|
+
get chatHeight() {
|
|
35
|
+
return this._chatHeight;
|
|
36
|
+
}
|
|
37
|
+
set commentHeight(height) {
|
|
38
|
+
if (this._commentHeight === height) {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
this._commentHeight = height;
|
|
42
|
+
this.layoutChange({ commentHeight: true }, 'CodeCellViewModel#commentHeight');
|
|
43
|
+
}
|
|
44
|
+
get outputIsHovered() {
|
|
45
|
+
return this._hoveringOutput;
|
|
46
|
+
}
|
|
47
|
+
set outputIsHovered(v) {
|
|
48
|
+
this._hoveringOutput = v;
|
|
49
|
+
this._onDidChangeState.fire({ outputIsHoveredChanged: true });
|
|
50
|
+
}
|
|
51
|
+
get outputIsFocused() {
|
|
52
|
+
return this._focusOnOutput;
|
|
53
|
+
}
|
|
54
|
+
set outputIsFocused(v) {
|
|
55
|
+
this._focusOnOutput = v;
|
|
56
|
+
this._onDidChangeState.fire({ outputIsFocusedChanged: true });
|
|
57
|
+
}
|
|
58
|
+
get outputMinHeight() {
|
|
59
|
+
return this._outputMinHeight;
|
|
60
|
+
}
|
|
61
|
+
set outputMinHeight(newMin) {
|
|
62
|
+
this._outputMinHeight = newMin;
|
|
63
|
+
}
|
|
64
|
+
get layoutInfo() {
|
|
65
|
+
return this._layoutInfo;
|
|
66
|
+
}
|
|
67
|
+
get outputsViewModels() {
|
|
68
|
+
return this._outputViewModels;
|
|
69
|
+
}
|
|
70
|
+
constructor(viewType, model, initialNotebookLayoutInfo, viewContext, configurationService, _notebookService, modelService, undoRedoService, codeEditorService) {
|
|
71
|
+
super(viewType, model, UUID.generateUuid(), viewContext, configurationService, modelService, undoRedoService, codeEditorService);
|
|
72
|
+
this.viewContext = viewContext;
|
|
73
|
+
this._notebookService = _notebookService;
|
|
74
|
+
this.cellKind = CellKind.Code;
|
|
75
|
+
this._onLayoutInfoRead = this._register(( new Emitter()));
|
|
76
|
+
this.onLayoutInfoRead = this._onLayoutInfoRead.event;
|
|
77
|
+
this._onDidStartExecution = this._register(( new Emitter()));
|
|
78
|
+
this.onDidStartExecution = this._onDidStartExecution.event;
|
|
79
|
+
this._onDidStopExecution = this._register(( new Emitter()));
|
|
80
|
+
this.onDidStopExecution = this._onDidStopExecution.event;
|
|
81
|
+
this._onDidChangeOutputs = this._register(( new Emitter()));
|
|
82
|
+
this.onDidChangeOutputs = this._onDidChangeOutputs.event;
|
|
83
|
+
this._onDidRemoveOutputs = this._register(( new Emitter()));
|
|
84
|
+
this.onDidRemoveOutputs = this._onDidRemoveOutputs.event;
|
|
85
|
+
this._outputCollection = [];
|
|
86
|
+
this._outputsTop = null;
|
|
87
|
+
this._pauseableEmitter = this._register(( new PauseableEmitter()));
|
|
88
|
+
this.onDidChangeLayout = this._pauseableEmitter.event;
|
|
89
|
+
this._editorHeight = 0;
|
|
90
|
+
this._chatHeight = 0;
|
|
91
|
+
this._commentHeight = 0;
|
|
92
|
+
this._hoveringOutput = false;
|
|
93
|
+
this._focusOnOutput = false;
|
|
94
|
+
this._outputMinHeight = 0;
|
|
95
|
+
this._hasFindResult = this._register(( new Emitter()));
|
|
96
|
+
this.hasFindResult = this._hasFindResult.event;
|
|
97
|
+
this._outputViewModels = ( this.model.outputs.map(output => ( new CellOutputViewModel(this, output, this._notebookService))));
|
|
98
|
+
this._register(this.model.onDidChangeOutputs((splice) => {
|
|
99
|
+
const removedOutputs = [];
|
|
100
|
+
let outputLayoutChange = false;
|
|
101
|
+
for (let i = splice.start; i < splice.start + splice.deleteCount; i++) {
|
|
102
|
+
if (this._outputCollection[i] !== undefined && this._outputCollection[i] !== 0) {
|
|
103
|
+
outputLayoutChange = true;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
this._outputCollection.splice(splice.start, splice.deleteCount, ...( splice.newOutputs.map(() => 0)));
|
|
107
|
+
removedOutputs.push(...this._outputViewModels.splice(splice.start, splice.deleteCount, ...( splice.newOutputs.map(output => ( new CellOutputViewModel(this, output, this._notebookService))))));
|
|
108
|
+
this._outputsTop = null;
|
|
109
|
+
this._onDidChangeOutputs.fire(splice);
|
|
110
|
+
this._onDidRemoveOutputs.fire(removedOutputs);
|
|
111
|
+
if (outputLayoutChange) {
|
|
112
|
+
this.layoutChange({ outputHeight: true }, 'CodeCellViewModel#model.onDidChangeOutputs');
|
|
113
|
+
}
|
|
114
|
+
dispose(removedOutputs);
|
|
115
|
+
}));
|
|
116
|
+
this._outputCollection = ( new Array(this.model.outputs.length));
|
|
117
|
+
this._layoutInfo = {
|
|
118
|
+
fontInfo: initialNotebookLayoutInfo?.fontInfo || null,
|
|
119
|
+
editorHeight: 0,
|
|
120
|
+
editorWidth: initialNotebookLayoutInfo
|
|
121
|
+
? this.viewContext.notebookOptions.computeCodeCellEditorWidth(initialNotebookLayoutInfo.width)
|
|
122
|
+
: 0,
|
|
123
|
+
chatHeight: 0,
|
|
124
|
+
statusBarHeight: 0,
|
|
125
|
+
commentHeight: 0,
|
|
126
|
+
outputContainerOffset: 0,
|
|
127
|
+
outputTotalHeight: 0,
|
|
128
|
+
outputShowMoreContainerHeight: 0,
|
|
129
|
+
outputShowMoreContainerOffset: 0,
|
|
130
|
+
totalHeight: this.computeTotalHeight(17, 0, 0, 0),
|
|
131
|
+
codeIndicatorHeight: 0,
|
|
132
|
+
outputIndicatorHeight: 0,
|
|
133
|
+
bottomToolbarOffset: 0,
|
|
134
|
+
layoutState: CellLayoutState.Uninitialized,
|
|
135
|
+
estimatedHasHorizontalScrolling: false
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
updateExecutionState(e) {
|
|
139
|
+
if (e.changed) {
|
|
140
|
+
this._onDidStartExecution.fire(e);
|
|
141
|
+
}
|
|
142
|
+
else {
|
|
143
|
+
this._onDidStopExecution.fire(e);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
updateOptions(e) {
|
|
147
|
+
if (e.cellStatusBarVisibility || e.insertToolbarPosition || e.cellToolbarLocation) {
|
|
148
|
+
this.layoutChange({});
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
pauseLayout() {
|
|
152
|
+
this._pauseableEmitter.pause();
|
|
153
|
+
}
|
|
154
|
+
resumeLayout() {
|
|
155
|
+
this._pauseableEmitter.resume();
|
|
156
|
+
}
|
|
157
|
+
layoutChange(state, source) {
|
|
158
|
+
this._ensureOutputsTop();
|
|
159
|
+
const notebookLayoutConfiguration = this.viewContext.notebookOptions.getLayoutConfiguration();
|
|
160
|
+
const bottomToolbarDimensions = this.viewContext.notebookOptions.computeBottomToolbarDimensions(this.viewType);
|
|
161
|
+
const outputShowMoreContainerHeight = state.outputShowMoreContainerHeight ? state.outputShowMoreContainerHeight : this._layoutInfo.outputShowMoreContainerHeight;
|
|
162
|
+
const outputTotalHeight = Math.max(this._outputMinHeight, this.isOutputCollapsed ? notebookLayoutConfiguration.collapsedIndicatorHeight : this._outputsTop.getTotalSum());
|
|
163
|
+
const commentHeight = state.commentHeight ? this._commentHeight : this._layoutInfo.commentHeight;
|
|
164
|
+
const originalLayout = this.layoutInfo;
|
|
165
|
+
if (!this.isInputCollapsed) {
|
|
166
|
+
let newState;
|
|
167
|
+
let editorHeight;
|
|
168
|
+
let totalHeight;
|
|
169
|
+
let hasHorizontalScrolling = false;
|
|
170
|
+
const chatHeight = state.chatHeight ? this._chatHeight : this._layoutInfo.chatHeight;
|
|
171
|
+
if (!state.editorHeight && this._layoutInfo.layoutState === CellLayoutState.FromCache && !state.outputHeight) {
|
|
172
|
+
const estimate = this.estimateEditorHeight(state.font?.lineHeight ?? this._layoutInfo.fontInfo?.lineHeight);
|
|
173
|
+
editorHeight = estimate.editorHeight;
|
|
174
|
+
hasHorizontalScrolling = estimate.hasHorizontalScrolling;
|
|
175
|
+
totalHeight = this._layoutInfo.totalHeight;
|
|
176
|
+
newState = CellLayoutState.FromCache;
|
|
177
|
+
}
|
|
178
|
+
else if (state.editorHeight || this._layoutInfo.layoutState === CellLayoutState.Measured) {
|
|
179
|
+
editorHeight = this._editorHeight;
|
|
180
|
+
totalHeight = this.computeTotalHeight(this._editorHeight, outputTotalHeight, outputShowMoreContainerHeight, chatHeight);
|
|
181
|
+
newState = CellLayoutState.Measured;
|
|
182
|
+
hasHorizontalScrolling = this._layoutInfo.estimatedHasHorizontalScrolling;
|
|
183
|
+
}
|
|
184
|
+
else {
|
|
185
|
+
const estimate = this.estimateEditorHeight(state.font?.lineHeight ?? this._layoutInfo.fontInfo?.lineHeight);
|
|
186
|
+
editorHeight = estimate.editorHeight;
|
|
187
|
+
hasHorizontalScrolling = estimate.hasHorizontalScrolling;
|
|
188
|
+
totalHeight = this.computeTotalHeight(editorHeight, outputTotalHeight, outputShowMoreContainerHeight, chatHeight);
|
|
189
|
+
newState = CellLayoutState.Estimated;
|
|
190
|
+
}
|
|
191
|
+
const statusBarHeight = this.viewContext.notebookOptions.computeEditorStatusbarHeight(this.internalMetadata, this.uri);
|
|
192
|
+
const codeIndicatorHeight = editorHeight + statusBarHeight;
|
|
193
|
+
const outputIndicatorHeight = outputTotalHeight + outputShowMoreContainerHeight;
|
|
194
|
+
const outputContainerOffset = notebookLayoutConfiguration.editorToolbarHeight
|
|
195
|
+
+ notebookLayoutConfiguration.cellTopMargin
|
|
196
|
+
+ chatHeight
|
|
197
|
+
+ editorHeight
|
|
198
|
+
+ statusBarHeight;
|
|
199
|
+
const outputShowMoreContainerOffset = totalHeight
|
|
200
|
+
- bottomToolbarDimensions.bottomToolbarGap
|
|
201
|
+
- bottomToolbarDimensions.bottomToolbarHeight / 2
|
|
202
|
+
- outputShowMoreContainerHeight;
|
|
203
|
+
const bottomToolbarOffset = this.viewContext.notebookOptions.computeBottomToolbarOffset(totalHeight, this.viewType);
|
|
204
|
+
const editorWidth = state.outerWidth !== undefined
|
|
205
|
+
? this.viewContext.notebookOptions.computeCodeCellEditorWidth(state.outerWidth)
|
|
206
|
+
: this._layoutInfo?.editorWidth;
|
|
207
|
+
this._layoutInfo = {
|
|
208
|
+
fontInfo: state.font ?? this._layoutInfo.fontInfo ?? null,
|
|
209
|
+
chatHeight,
|
|
210
|
+
editorHeight,
|
|
211
|
+
editorWidth,
|
|
212
|
+
statusBarHeight,
|
|
213
|
+
commentHeight,
|
|
214
|
+
outputContainerOffset,
|
|
215
|
+
outputTotalHeight,
|
|
216
|
+
outputShowMoreContainerHeight,
|
|
217
|
+
outputShowMoreContainerOffset,
|
|
218
|
+
totalHeight,
|
|
219
|
+
codeIndicatorHeight,
|
|
220
|
+
outputIndicatorHeight,
|
|
221
|
+
bottomToolbarOffset,
|
|
222
|
+
layoutState: newState,
|
|
223
|
+
estimatedHasHorizontalScrolling: hasHorizontalScrolling
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
else {
|
|
227
|
+
const codeIndicatorHeight = notebookLayoutConfiguration.collapsedIndicatorHeight;
|
|
228
|
+
const outputIndicatorHeight = outputTotalHeight + outputShowMoreContainerHeight;
|
|
229
|
+
const chatHeight = state.chatHeight ? this._chatHeight : this._layoutInfo.chatHeight;
|
|
230
|
+
const outputContainerOffset = notebookLayoutConfiguration.cellTopMargin + notebookLayoutConfiguration.collapsedIndicatorHeight;
|
|
231
|
+
const totalHeight = notebookLayoutConfiguration.cellTopMargin
|
|
232
|
+
+ notebookLayoutConfiguration.collapsedIndicatorHeight
|
|
233
|
+
+ notebookLayoutConfiguration.cellBottomMargin
|
|
234
|
+
+ bottomToolbarDimensions.bottomToolbarGap
|
|
235
|
+
+ chatHeight
|
|
236
|
+
+ commentHeight
|
|
237
|
+
+ outputTotalHeight + outputShowMoreContainerHeight;
|
|
238
|
+
const outputShowMoreContainerOffset = totalHeight
|
|
239
|
+
- bottomToolbarDimensions.bottomToolbarGap
|
|
240
|
+
- bottomToolbarDimensions.bottomToolbarHeight / 2
|
|
241
|
+
- outputShowMoreContainerHeight;
|
|
242
|
+
const bottomToolbarOffset = this.viewContext.notebookOptions.computeBottomToolbarOffset(totalHeight, this.viewType);
|
|
243
|
+
const editorWidth = state.outerWidth !== undefined
|
|
244
|
+
? this.viewContext.notebookOptions.computeCodeCellEditorWidth(state.outerWidth)
|
|
245
|
+
: this._layoutInfo?.editorWidth;
|
|
246
|
+
this._layoutInfo = {
|
|
247
|
+
fontInfo: state.font ?? this._layoutInfo.fontInfo ?? null,
|
|
248
|
+
editorHeight: this._layoutInfo.editorHeight,
|
|
249
|
+
editorWidth,
|
|
250
|
+
chatHeight: chatHeight,
|
|
251
|
+
statusBarHeight: 0,
|
|
252
|
+
commentHeight,
|
|
253
|
+
outputContainerOffset,
|
|
254
|
+
outputTotalHeight,
|
|
255
|
+
outputShowMoreContainerHeight,
|
|
256
|
+
outputShowMoreContainerOffset,
|
|
257
|
+
totalHeight,
|
|
258
|
+
codeIndicatorHeight,
|
|
259
|
+
outputIndicatorHeight,
|
|
260
|
+
bottomToolbarOffset,
|
|
261
|
+
layoutState: this._layoutInfo.layoutState,
|
|
262
|
+
estimatedHasHorizontalScrolling: false
|
|
263
|
+
};
|
|
264
|
+
}
|
|
265
|
+
this._fireOnDidChangeLayout({
|
|
266
|
+
...state,
|
|
267
|
+
totalHeight: this.layoutInfo.totalHeight !== originalLayout.totalHeight,
|
|
268
|
+
source,
|
|
269
|
+
});
|
|
270
|
+
}
|
|
271
|
+
_fireOnDidChangeLayout(state) {
|
|
272
|
+
this._pauseableEmitter.fire(state);
|
|
273
|
+
}
|
|
274
|
+
restoreEditorViewState(editorViewStates, totalHeight) {
|
|
275
|
+
super.restoreEditorViewState(editorViewStates);
|
|
276
|
+
if (totalHeight !== undefined && this._layoutInfo.layoutState !== CellLayoutState.Measured) {
|
|
277
|
+
this._layoutInfo = {
|
|
278
|
+
fontInfo: this._layoutInfo.fontInfo,
|
|
279
|
+
chatHeight: this._layoutInfo.chatHeight,
|
|
280
|
+
editorHeight: this._layoutInfo.editorHeight,
|
|
281
|
+
editorWidth: this._layoutInfo.editorWidth,
|
|
282
|
+
statusBarHeight: this.layoutInfo.statusBarHeight,
|
|
283
|
+
commentHeight: this.layoutInfo.commentHeight,
|
|
284
|
+
outputContainerOffset: this._layoutInfo.outputContainerOffset,
|
|
285
|
+
outputTotalHeight: this._layoutInfo.outputTotalHeight,
|
|
286
|
+
outputShowMoreContainerHeight: this._layoutInfo.outputShowMoreContainerHeight,
|
|
287
|
+
outputShowMoreContainerOffset: this._layoutInfo.outputShowMoreContainerOffset,
|
|
288
|
+
totalHeight: totalHeight,
|
|
289
|
+
codeIndicatorHeight: this._layoutInfo.codeIndicatorHeight,
|
|
290
|
+
outputIndicatorHeight: this._layoutInfo.outputIndicatorHeight,
|
|
291
|
+
bottomToolbarOffset: this._layoutInfo.bottomToolbarOffset,
|
|
292
|
+
layoutState: CellLayoutState.FromCache,
|
|
293
|
+
estimatedHasHorizontalScrolling: this._layoutInfo.estimatedHasHorizontalScrolling
|
|
294
|
+
};
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
getDynamicHeight() {
|
|
298
|
+
this._onLayoutInfoRead.fire();
|
|
299
|
+
return this._layoutInfo.totalHeight;
|
|
300
|
+
}
|
|
301
|
+
getHeight(lineHeight) {
|
|
302
|
+
if (this._layoutInfo.layoutState === CellLayoutState.Uninitialized) {
|
|
303
|
+
const estimate = this.estimateEditorHeight(lineHeight);
|
|
304
|
+
return this.computeTotalHeight(estimate.editorHeight, 0, 0, 0);
|
|
305
|
+
}
|
|
306
|
+
else {
|
|
307
|
+
return this._layoutInfo.totalHeight;
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
estimateEditorHeight(lineHeight = 20) {
|
|
311
|
+
let hasHorizontalScrolling = false;
|
|
312
|
+
const cellEditorOptions = this.viewContext.getBaseCellEditorOptions(this.language);
|
|
313
|
+
if (this.layoutInfo.fontInfo && cellEditorOptions.value.wordWrap === 'off') {
|
|
314
|
+
for (let i = 0; i < this.lineCount; i++) {
|
|
315
|
+
const max = this.textBuffer.getLineLastNonWhitespaceColumn(i + 1);
|
|
316
|
+
const estimatedWidth = max * (this.layoutInfo.fontInfo.typicalHalfwidthCharacterWidth + this.layoutInfo.fontInfo.letterSpacing);
|
|
317
|
+
if (estimatedWidth > this.layoutInfo.editorWidth) {
|
|
318
|
+
hasHorizontalScrolling = true;
|
|
319
|
+
break;
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
const verticalScrollbarHeight = hasHorizontalScrolling ? 12 : 0;
|
|
324
|
+
const editorPadding = this.viewContext.notebookOptions.computeEditorPadding(this.internalMetadata, this.uri);
|
|
325
|
+
const editorHeight = this.lineCount * lineHeight
|
|
326
|
+
+ editorPadding.top
|
|
327
|
+
+ editorPadding.bottom
|
|
328
|
+
+ verticalScrollbarHeight;
|
|
329
|
+
return {
|
|
330
|
+
editorHeight,
|
|
331
|
+
hasHorizontalScrolling
|
|
332
|
+
};
|
|
333
|
+
}
|
|
334
|
+
computeTotalHeight(editorHeight, outputsTotalHeight, outputShowMoreContainerHeight, chatHeight) {
|
|
335
|
+
const layoutConfiguration = this.viewContext.notebookOptions.getLayoutConfiguration();
|
|
336
|
+
const { bottomToolbarGap } = this.viewContext.notebookOptions.computeBottomToolbarDimensions(this.viewType);
|
|
337
|
+
return layoutConfiguration.editorToolbarHeight
|
|
338
|
+
+ layoutConfiguration.cellTopMargin
|
|
339
|
+
+ chatHeight
|
|
340
|
+
+ editorHeight
|
|
341
|
+
+ this.viewContext.notebookOptions.computeEditorStatusbarHeight(this.internalMetadata, this.uri)
|
|
342
|
+
+ this._commentHeight
|
|
343
|
+
+ outputsTotalHeight
|
|
344
|
+
+ outputShowMoreContainerHeight
|
|
345
|
+
+ bottomToolbarGap
|
|
346
|
+
+ layoutConfiguration.cellBottomMargin;
|
|
347
|
+
}
|
|
348
|
+
onDidChangeTextModelContent() {
|
|
349
|
+
if (this.getEditState() !== CellEditState.Editing) {
|
|
350
|
+
this.updateEditState(CellEditState.Editing, 'onDidChangeTextModelContent');
|
|
351
|
+
this._onDidChangeState.fire({ contentChanged: true });
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
onDeselect() {
|
|
355
|
+
this.updateEditState(CellEditState.Preview, 'onDeselect');
|
|
356
|
+
}
|
|
357
|
+
updateOutputShowMoreContainerHeight(height) {
|
|
358
|
+
this.layoutChange({ outputShowMoreContainerHeight: height }, 'CodeCellViewModel#updateOutputShowMoreContainerHeight');
|
|
359
|
+
}
|
|
360
|
+
updateOutputMinHeight(height) {
|
|
361
|
+
this.outputMinHeight = height;
|
|
362
|
+
}
|
|
363
|
+
unlockOutputHeight() {
|
|
364
|
+
this.outputMinHeight = 0;
|
|
365
|
+
this.layoutChange({ outputHeight: true });
|
|
366
|
+
}
|
|
367
|
+
updateOutputHeight(index, height, source) {
|
|
368
|
+
if (index >= this._outputCollection.length) {
|
|
369
|
+
throw new Error('Output index out of range!');
|
|
370
|
+
}
|
|
371
|
+
this._ensureOutputsTop();
|
|
372
|
+
if (height < 28 && this._outputViewModels[index].hasMultiMimeType()) {
|
|
373
|
+
height = 28;
|
|
374
|
+
}
|
|
375
|
+
this._outputCollection[index] = height;
|
|
376
|
+
if (this._outputsTop.setValue(index, height)) {
|
|
377
|
+
this.layoutChange({ outputHeight: true }, source);
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
getOutputOffsetInContainer(index) {
|
|
381
|
+
this._ensureOutputsTop();
|
|
382
|
+
if (index >= this._outputCollection.length) {
|
|
383
|
+
throw new Error('Output index out of range!');
|
|
384
|
+
}
|
|
385
|
+
return this._outputsTop.getPrefixSum(index - 1);
|
|
386
|
+
}
|
|
387
|
+
getOutputOffset(index) {
|
|
388
|
+
return this.layoutInfo.outputContainerOffset + this.getOutputOffsetInContainer(index);
|
|
389
|
+
}
|
|
390
|
+
spliceOutputHeights(start, deleteCnt, heights) {
|
|
391
|
+
this._ensureOutputsTop();
|
|
392
|
+
this._outputsTop.removeValues(start, deleteCnt);
|
|
393
|
+
if (heights.length) {
|
|
394
|
+
const values = ( new Uint32Array(heights.length));
|
|
395
|
+
for (let i = 0; i < heights.length; i++) {
|
|
396
|
+
values[i] = heights[i];
|
|
397
|
+
}
|
|
398
|
+
this._outputsTop.insertValues(start, values);
|
|
399
|
+
}
|
|
400
|
+
this.layoutChange({ outputHeight: true }, 'CodeCellViewModel#spliceOutputs');
|
|
401
|
+
}
|
|
402
|
+
_ensureOutputsTop() {
|
|
403
|
+
if (!this._outputsTop) {
|
|
404
|
+
const values = ( new Uint32Array(this._outputCollection.length));
|
|
405
|
+
for (let i = 0; i < this._outputCollection.length; i++) {
|
|
406
|
+
values[i] = this._outputCollection[i];
|
|
407
|
+
}
|
|
408
|
+
this._outputsTop = ( new PrefixSumComputer(values));
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
startFind(value, options) {
|
|
412
|
+
const matches = super.cellStartFind(value, options);
|
|
413
|
+
if (matches === null) {
|
|
414
|
+
return null;
|
|
415
|
+
}
|
|
416
|
+
return {
|
|
417
|
+
cell: this,
|
|
418
|
+
contentMatches: matches
|
|
419
|
+
};
|
|
420
|
+
}
|
|
421
|
+
dispose() {
|
|
422
|
+
super.dispose();
|
|
423
|
+
this._outputCollection = [];
|
|
424
|
+
this._outputsTop = null;
|
|
425
|
+
dispose(this._outputViewModels);
|
|
426
|
+
}
|
|
427
|
+
};
|
|
428
|
+
CodeCellViewModel = ( __decorate([
|
|
429
|
+
( __param(4, IConfigurationService)),
|
|
430
|
+
( __param(5, INotebookService)),
|
|
431
|
+
( __param(6, ITextModelService)),
|
|
432
|
+
( __param(7, IUndoRedoService)),
|
|
433
|
+
( __param(8, ICodeEditorService))
|
|
434
|
+
], CodeCellViewModel));
|
|
435
|
+
export { CodeCellViewModel, outputDisplayLimit };
|
|
@@ -0,0 +1,31 @@
|
|
|
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 { NotebookViewEventType } from '../notebookViewEvents.js';
|
|
4
|
+
class NotebookEventDispatcher extends Disposable {
|
|
5
|
+
constructor() {
|
|
6
|
+
super(...arguments);
|
|
7
|
+
this._onDidChangeLayout = this._register(( new Emitter()));
|
|
8
|
+
this.onDidChangeLayout = this._onDidChangeLayout.event;
|
|
9
|
+
this._onDidChangeMetadata = this._register(( new Emitter()));
|
|
10
|
+
this.onDidChangeMetadata = this._onDidChangeMetadata.event;
|
|
11
|
+
this._onDidChangeCellState = this._register(( new Emitter()));
|
|
12
|
+
this.onDidChangeCellState = this._onDidChangeCellState.event;
|
|
13
|
+
}
|
|
14
|
+
emit(events) {
|
|
15
|
+
for (let i = 0, len = events.length; i < len; i++) {
|
|
16
|
+
const e = events[i];
|
|
17
|
+
switch (e.type) {
|
|
18
|
+
case NotebookViewEventType.LayoutChanged:
|
|
19
|
+
this._onDidChangeLayout.fire(e);
|
|
20
|
+
break;
|
|
21
|
+
case NotebookViewEventType.MetadataChanged:
|
|
22
|
+
this._onDidChangeMetadata.fire(e);
|
|
23
|
+
break;
|
|
24
|
+
case NotebookViewEventType.CellStateChanged:
|
|
25
|
+
this._onDidChangeCellState.fire(e);
|
|
26
|
+
break;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
export { NotebookEventDispatcher };
|