@codingame/monaco-vscode-api 1.85.0 → 1.85.2
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 +31 -13
- package/contributions.js +1 -0
- package/missing-services.js +396 -68
- package/monaco-editor-treemending.patch +957 -950
- package/package.json +8 -7
- package/service-override/tools/editor.js +1 -1
- package/services.js +10 -6
- package/vscode/src/vs/base/browser/ui/tree/treeDefaults.js +14 -0
- 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/extensionEnablementService.js +140 -0
- package/vscode/src/vs/platform/extensionManagement/common/extensionManagement.js +2 -1
- package/vscode/src/vs/platform/extensions/common/extensions.d.ts +1062 -93
- package/vscode/src/vs/platform/files/common/inMemoryFilesystemProvider.js +220 -0
- package/vscode/src/vs/platform/layout/browser/zIndexRegistry.js +58 -0
- package/vscode/src/vs/platform/quickinput/browser/quickPickPin.js +102 -0
- package/vscode/src/vs/platform/terminal/common/capabilities/commandDetectionCapability.js +56 -1
- package/vscode/src/vs/platform/userDataSync/common/content.js +9 -0
- package/vscode/src/vs/platform/userDataSync/common/settingsMerge.js +514 -0
- package/vscode/src/vs/platform/userDataSync/common/userDataSync.js +154 -2
- package/vscode/src/vs/platform/userDataSync/common/userDataSyncAccount.js +43 -1
- package/vscode/src/vs/platform/userDataSync/common/userDataSyncMachines.js +177 -0
- package/vscode/src/vs/workbench/api/common/extHostApiCommands.js +1 -1
- package/vscode/src/vs/workbench/api/common/extHostTypeConverters.js +1 -1
- package/vscode/src/vs/workbench/api/common/extHostWebview.js +2 -2
- package/vscode/src/vs/workbench/browser/actions/layoutActions.js +186 -4
- package/vscode/src/vs/workbench/browser/parts/views/checkbox.js +105 -0
- package/vscode/src/vs/workbench/browser/parts/views/media/views.css.js +4 -0
- package/vscode/src/vs/workbench/browser/parts/views/treeView.js +1614 -0
- 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/codeEditor/browser/languageConfigurationExtensionPoint.js +7 -7
- 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/files/browser/explorerViewlet.js +73 -2
- 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/tasks/common/taskDefinitionRegistry.js +6 -6
- package/vscode/src/vs/workbench/contrib/tasks/common/taskService.js +12 -2
- package/vscode/src/vs/workbench/contrib/tasks/common/tasks.js +712 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminal.js +4 -1
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalProcessExtHostProxy.js +130 -0
- 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/authentication/browser/authenticationService.js +20 -1
- package/vscode/src/vs/workbench/services/configurationResolver/common/configurationResolverSchema.js +205 -0
- package/vscode/src/vs/workbench/services/configurationResolver/common/configurationResolverUtils.js +11 -0
- package/vscode/src/vs/workbench/services/configurationResolver/common/variableResolver.js +9 -9
- package/vscode/src/vs/workbench/services/extensionManagement/browser/extensionBisect.js +1 -1
- package/vscode/src/vs/workbench/services/keybinding/common/keybindingEditing.js +2 -2
- package/vscode/src/vs/workbench/services/languageStatus/common/languageStatusService.js +24 -1
- package/vscode/src/vs/workbench/services/layout/browser/layoutService.js +15 -1
- package/vscode/src/vs/workbench/services/preferences/browser/keybindingsEditorInput.js +41 -0
- package/vscode/src/vs/workbench/services/preferences/browser/keybindingsEditorModel.js +588 -0
- package/vscode/src/vs/workbench/services/preferences/common/preferencesEditorInput.js +43 -0
- 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/search/common/search.js +3 -3
- package/vscode/src/vs/workbench/services/terminal/common/embedderTerminalService.js +75 -1
- package/vscode/src/vs/workbench/services/timer/browser/timerService.js +240 -1
- package/vscode/src/vs/workbench/services/userData/browser/userDataInit.js +31 -1
- package/vscode/src/vs/workbench/services/userDataProfile/common/userDataProfile.js +25 -1
- package/vscode/src/vs/workbench/services/userDataProfile/common/userDataProfileIcons.js +75 -1
- package/vscode/src/vs/workbench/services/userDataSync/common/userDataSync.js +74 -4
- 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
- package/vscode/src/vs/base/parts/request/browser/request.js +0 -60
- package/vscode/src/vs/platform/request/browser/requestService.js +0 -28
- package/vscode/src/vs/platform/request/common/requestIpc.js +0 -17
- package/vscode/src/vs/platform/url/common/urlService.js +0 -17
- package/vscode/src/vs/workbench/services/configuration/common/jsonEditingService.js +0 -120
- package/vscode/src/vs/workbench/services/decorations/browser/decorationsService.js +0 -319
- package/vscode/src/vs/workbench/services/files/browser/elevatedFileService.js +0 -9
- package/vscode/src/vs/workbench/services/host/browser/browserHostService.js +0 -408
- package/vscode/src/vs/workbench/services/request/browser/requestService.js +0 -48
- package/vscode/src/vs/workbench/services/textfile/browser/browserTextFileService.js +0 -56
- package/vscode/src/vs/workbench/services/textfile/browser/textFileService.js +0 -639
- package/vscode/src/vs/workbench/services/textfile/common/textFileEditorModelManager.js +0 -402
- package/vscode/src/vs/workbench/services/textfile/common/textFileSaveParticipant.js +0 -62
- package/vscode/src/vs/workbench/services/themes/browser/browserHostColorSchemeService.js +0 -38
- package/vscode/src/vs/workbench/services/themes/common/tokenClassificationExtensionPoint.js +0 -295
- package/vscode/src/vs/workbench/services/url/browser/urlService.js +0 -47
- package/vscode/src/vs/workbench/services/views/common/treeViewsService.js +0 -20
- package/vscode/src/vs/workbench/services/workspaces/common/canonicalUriService.js +0 -19
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
import { renderMarkdownAsPlaintext } from 'monaco-editor/esm/vs/base/browser/markdownRenderer.js';
|
|
2
|
+
import { Emitter } from 'monaco-editor/esm/vs/base/common/event.js';
|
|
3
|
+
import { DisposableStore } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
4
|
+
import { marked } from 'monaco-editor/esm/vs/base/common/marked/marked.js';
|
|
5
|
+
import { FoldingRegions } from 'monaco-editor/esm/vs/editor/contrib/folding/browser/foldingRanges.js';
|
|
6
|
+
import { sanitizeRanges } from 'monaco-editor/esm/vs/editor/contrib/folding/browser/syntaxRangeProvider.js';
|
|
7
|
+
import { CellKind } from '../../common/notebookCommon.js';
|
|
8
|
+
import { cellRangesToIndexes } from '../../common/notebookRange.js';
|
|
9
|
+
const foldingRangeLimit = {
|
|
10
|
+
limit: 5000,
|
|
11
|
+
update: () => { }
|
|
12
|
+
};
|
|
13
|
+
class FoldingModel {
|
|
14
|
+
get regions() {
|
|
15
|
+
return this._regions;
|
|
16
|
+
}
|
|
17
|
+
constructor() {
|
|
18
|
+
this._viewModel = null;
|
|
19
|
+
this._viewModelStore = ( new DisposableStore());
|
|
20
|
+
this._onDidFoldingRegionChanges = ( new Emitter());
|
|
21
|
+
this.onDidFoldingRegionChanged = this._onDidFoldingRegionChanges.event;
|
|
22
|
+
this._foldingRangeDecorationIds = [];
|
|
23
|
+
this._regions = ( new FoldingRegions(( new Uint32Array(0)), ( new Uint32Array(0))));
|
|
24
|
+
}
|
|
25
|
+
dispose() {
|
|
26
|
+
this._onDidFoldingRegionChanges.dispose();
|
|
27
|
+
this._viewModelStore.dispose();
|
|
28
|
+
}
|
|
29
|
+
detachViewModel() {
|
|
30
|
+
this._viewModelStore.clear();
|
|
31
|
+
this._viewModel = null;
|
|
32
|
+
}
|
|
33
|
+
attachViewModel(model) {
|
|
34
|
+
this._viewModel = model;
|
|
35
|
+
this._viewModelStore.add(this._viewModel.onDidChangeViewCells(() => {
|
|
36
|
+
this.recompute();
|
|
37
|
+
}));
|
|
38
|
+
this._viewModelStore.add(this._viewModel.onDidChangeSelection(() => {
|
|
39
|
+
if (!this._viewModel) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
const indexes = cellRangesToIndexes(this._viewModel.getSelections());
|
|
43
|
+
let changed = false;
|
|
44
|
+
indexes.forEach(index => {
|
|
45
|
+
let regionIndex = this.regions.findRange(index + 1);
|
|
46
|
+
while (regionIndex !== -1) {
|
|
47
|
+
if (this._regions.isCollapsed(regionIndex) && index > this._regions.getStartLineNumber(regionIndex) - 1) {
|
|
48
|
+
this._regions.setCollapsed(regionIndex, false);
|
|
49
|
+
changed = true;
|
|
50
|
+
}
|
|
51
|
+
regionIndex = this._regions.getParentIndex(regionIndex);
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
if (changed) {
|
|
55
|
+
this._onDidFoldingRegionChanges.fire();
|
|
56
|
+
}
|
|
57
|
+
}));
|
|
58
|
+
this.recompute();
|
|
59
|
+
}
|
|
60
|
+
getRegionAtLine(lineNumber) {
|
|
61
|
+
if (this._regions) {
|
|
62
|
+
const index = this._regions.findRange(lineNumber);
|
|
63
|
+
if (index >= 0) {
|
|
64
|
+
return this._regions.toRegion(index);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
return null;
|
|
68
|
+
}
|
|
69
|
+
getRegionsInside(region, filter) {
|
|
70
|
+
const result = [];
|
|
71
|
+
const index = region ? region.regionIndex + 1 : 0;
|
|
72
|
+
const endLineNumber = region ? region.endLineNumber : Number.MAX_VALUE;
|
|
73
|
+
if (filter && filter.length === 2) {
|
|
74
|
+
const levelStack = [];
|
|
75
|
+
for (let i = index, len = this._regions.length; i < len; i++) {
|
|
76
|
+
const current = this._regions.toRegion(i);
|
|
77
|
+
if (this._regions.getStartLineNumber(i) < endLineNumber) {
|
|
78
|
+
while (levelStack.length > 0 && !current.containedBy(levelStack[levelStack.length - 1])) {
|
|
79
|
+
levelStack.pop();
|
|
80
|
+
}
|
|
81
|
+
levelStack.push(current);
|
|
82
|
+
if (filter(current, levelStack.length)) {
|
|
83
|
+
result.push(current);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
break;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
for (let i = index, len = this._regions.length; i < len; i++) {
|
|
93
|
+
const current = this._regions.toRegion(i);
|
|
94
|
+
if (this._regions.getStartLineNumber(i) < endLineNumber) {
|
|
95
|
+
if (!filter || filter(current)) {
|
|
96
|
+
result.push(current);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
break;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
return result;
|
|
105
|
+
}
|
|
106
|
+
getAllRegionsAtLine(lineNumber, filter) {
|
|
107
|
+
const result = [];
|
|
108
|
+
if (this._regions) {
|
|
109
|
+
let index = this._regions.findRange(lineNumber);
|
|
110
|
+
let level = 1;
|
|
111
|
+
while (index >= 0) {
|
|
112
|
+
const current = this._regions.toRegion(index);
|
|
113
|
+
if (!filter || filter(current, level)) {
|
|
114
|
+
result.push(current);
|
|
115
|
+
}
|
|
116
|
+
level++;
|
|
117
|
+
index = current.parentIndex;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
return result;
|
|
121
|
+
}
|
|
122
|
+
setCollapsed(index, newState) {
|
|
123
|
+
this._regions.setCollapsed(index, newState);
|
|
124
|
+
}
|
|
125
|
+
recompute() {
|
|
126
|
+
if (!this._viewModel) {
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
const viewModel = this._viewModel;
|
|
130
|
+
const cells = viewModel.viewCells;
|
|
131
|
+
const stack = [];
|
|
132
|
+
for (let i = 0; i < cells.length; i++) {
|
|
133
|
+
const cell = cells[i];
|
|
134
|
+
if (cell.cellKind !== CellKind.Markup || cell.language !== 'markdown') {
|
|
135
|
+
continue;
|
|
136
|
+
}
|
|
137
|
+
const minDepth = Math.min(7, ...Array.from(getMarkdownHeadersInCell(cell.getText()), header => header.depth));
|
|
138
|
+
if (minDepth < 7) {
|
|
139
|
+
stack.push({ index: i, level: minDepth, endIndex: 0 });
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
const rawFoldingRanges = ( stack.map((entry, startIndex) => {
|
|
143
|
+
let end = undefined;
|
|
144
|
+
for (let i = startIndex + 1; i < stack.length; ++i) {
|
|
145
|
+
if (stack[i].level <= entry.level) {
|
|
146
|
+
end = stack[i].index - 1;
|
|
147
|
+
break;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
const endIndex = end !== undefined ? end : cells.length - 1;
|
|
151
|
+
return {
|
|
152
|
+
start: entry.index + 1,
|
|
153
|
+
end: endIndex + 1,
|
|
154
|
+
rank: 1
|
|
155
|
+
};
|
|
156
|
+
})).filter(range => range.start !== range.end);
|
|
157
|
+
const newRegions = sanitizeRanges(rawFoldingRanges, foldingRangeLimit);
|
|
158
|
+
let i = 0;
|
|
159
|
+
const nextCollapsed = () => {
|
|
160
|
+
while (i < this._regions.length) {
|
|
161
|
+
const isCollapsed = this._regions.isCollapsed(i);
|
|
162
|
+
i++;
|
|
163
|
+
if (isCollapsed) {
|
|
164
|
+
return i - 1;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
return -1;
|
|
168
|
+
};
|
|
169
|
+
let k = 0;
|
|
170
|
+
let collapsedIndex = nextCollapsed();
|
|
171
|
+
while (collapsedIndex !== -1 && k < newRegions.length) {
|
|
172
|
+
const decRange = viewModel.getTrackedRange(this._foldingRangeDecorationIds[collapsedIndex]);
|
|
173
|
+
if (decRange) {
|
|
174
|
+
const collasedStartIndex = decRange.start;
|
|
175
|
+
while (k < newRegions.length) {
|
|
176
|
+
const startIndex = newRegions.getStartLineNumber(k) - 1;
|
|
177
|
+
if (collasedStartIndex >= startIndex) {
|
|
178
|
+
newRegions.setCollapsed(k, collasedStartIndex === startIndex);
|
|
179
|
+
k++;
|
|
180
|
+
}
|
|
181
|
+
else {
|
|
182
|
+
break;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
collapsedIndex = nextCollapsed();
|
|
187
|
+
}
|
|
188
|
+
while (k < newRegions.length) {
|
|
189
|
+
newRegions.setCollapsed(k, false);
|
|
190
|
+
k++;
|
|
191
|
+
}
|
|
192
|
+
const cellRanges = [];
|
|
193
|
+
for (let i = 0; i < newRegions.length; i++) {
|
|
194
|
+
const region = newRegions.toRegion(i);
|
|
195
|
+
cellRanges.push({ start: region.startLineNumber - 1, end: region.endLineNumber - 1 });
|
|
196
|
+
}
|
|
197
|
+
this._foldingRangeDecorationIds.forEach(id => viewModel.setTrackedRange(id, null, 3 ));
|
|
198
|
+
this._foldingRangeDecorationIds = ( cellRanges.map(
|
|
199
|
+
region => viewModel.setTrackedRange(null, region, 3 )
|
|
200
|
+
)).filter(str => str !== null);
|
|
201
|
+
this._regions = newRegions;
|
|
202
|
+
this._onDidFoldingRegionChanges.fire();
|
|
203
|
+
}
|
|
204
|
+
getMemento() {
|
|
205
|
+
const collapsedRanges = [];
|
|
206
|
+
let i = 0;
|
|
207
|
+
while (i < this._regions.length) {
|
|
208
|
+
const isCollapsed = this._regions.isCollapsed(i);
|
|
209
|
+
if (isCollapsed) {
|
|
210
|
+
const region = this._regions.toRegion(i);
|
|
211
|
+
collapsedRanges.push({ start: region.startLineNumber - 1, end: region.endLineNumber - 1 });
|
|
212
|
+
}
|
|
213
|
+
i++;
|
|
214
|
+
}
|
|
215
|
+
return collapsedRanges;
|
|
216
|
+
}
|
|
217
|
+
applyMemento(state) {
|
|
218
|
+
if (!this._viewModel) {
|
|
219
|
+
return false;
|
|
220
|
+
}
|
|
221
|
+
let i = 0;
|
|
222
|
+
let k = 0;
|
|
223
|
+
while (k < state.length && i < this._regions.length) {
|
|
224
|
+
const decRange = this._viewModel.getTrackedRange(this._foldingRangeDecorationIds[i]);
|
|
225
|
+
if (decRange) {
|
|
226
|
+
const collasedStartIndex = state[k].start;
|
|
227
|
+
while (i < this._regions.length) {
|
|
228
|
+
const startIndex = this._regions.getStartLineNumber(i) - 1;
|
|
229
|
+
if (collasedStartIndex >= startIndex) {
|
|
230
|
+
this._regions.setCollapsed(i, collasedStartIndex === startIndex);
|
|
231
|
+
i++;
|
|
232
|
+
}
|
|
233
|
+
else {
|
|
234
|
+
break;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
k++;
|
|
239
|
+
}
|
|
240
|
+
while (i < this._regions.length) {
|
|
241
|
+
this._regions.setCollapsed(i, false);
|
|
242
|
+
i++;
|
|
243
|
+
}
|
|
244
|
+
return true;
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
function* getMarkdownHeadersInCell(cellContent) {
|
|
248
|
+
for (const token of marked.lexer(cellContent, { gfm: true })) {
|
|
249
|
+
if (token.type === 'heading') {
|
|
250
|
+
yield {
|
|
251
|
+
depth: token.depth,
|
|
252
|
+
text: renderMarkdownAsPlaintext({ value: token.text }).trim()
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
export { FoldingModel, getMarkdownHeadersInCell };
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import { Emitter } from 'monaco-editor/esm/vs/base/common/event.js';
|
|
3
|
+
import * as UUID from 'monaco-editor/esm/vs/base/common/uuid.js';
|
|
4
|
+
import { IConfigurationService } from 'monaco-editor/esm/vs/platform/configuration/common/configuration.js';
|
|
5
|
+
import { CellLayoutState, CellLayoutContext, CellEditState } from '../notebookBrowser.js';
|
|
6
|
+
import { BaseCellViewModel } from './baseCellViewModel.js';
|
|
7
|
+
import { CellKind } from '../../common/notebookCommon.js';
|
|
8
|
+
import { ITextModelService } from 'monaco-editor/esm/vs/editor/common/services/resolverService.js';
|
|
9
|
+
import { IUndoRedoService } from 'monaco-editor/esm/vs/platform/undoRedo/common/undoRedo.js';
|
|
10
|
+
import { ICodeEditorService } from 'monaco-editor/esm/vs/editor/browser/services/codeEditorService.js';
|
|
11
|
+
import { NotebookCellStateChangedEvent } from '../notebookViewEvents.js';
|
|
12
|
+
let MarkupCellViewModel = class MarkupCellViewModel extends BaseCellViewModel {
|
|
13
|
+
get renderedHtml() { return this._renderedHtml; }
|
|
14
|
+
set renderedHtml(value) {
|
|
15
|
+
if (this._renderedHtml !== value) {
|
|
16
|
+
this._renderedHtml = value;
|
|
17
|
+
this._onDidChangeState.fire({ contentChanged: true });
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
get layoutInfo() {
|
|
21
|
+
return this._layoutInfo;
|
|
22
|
+
}
|
|
23
|
+
set renderedMarkdownHeight(newHeight) {
|
|
24
|
+
this._previewHeight = newHeight;
|
|
25
|
+
this._updateTotalHeight(this._computeTotalHeight());
|
|
26
|
+
}
|
|
27
|
+
set chatHeight(newHeight) {
|
|
28
|
+
this._chatHeight = newHeight;
|
|
29
|
+
this._updateTotalHeight(this._computeTotalHeight());
|
|
30
|
+
}
|
|
31
|
+
get chatHeight() {
|
|
32
|
+
return this._chatHeight;
|
|
33
|
+
}
|
|
34
|
+
set editorHeight(newHeight) {
|
|
35
|
+
this._editorHeight = newHeight;
|
|
36
|
+
this._statusBarHeight = this.viewContext.notebookOptions.computeStatusBarHeight();
|
|
37
|
+
this._updateTotalHeight(this._computeTotalHeight());
|
|
38
|
+
}
|
|
39
|
+
get editorHeight() {
|
|
40
|
+
throw new Error('MarkdownCellViewModel.editorHeight is write only');
|
|
41
|
+
}
|
|
42
|
+
get foldingState() {
|
|
43
|
+
return this.foldingDelegate.getFoldingState(this.foldingDelegate.getCellIndex(this));
|
|
44
|
+
}
|
|
45
|
+
get outputIsHovered() {
|
|
46
|
+
return this._hoveringOutput;
|
|
47
|
+
}
|
|
48
|
+
set outputIsHovered(v) {
|
|
49
|
+
this._hoveringOutput = v;
|
|
50
|
+
}
|
|
51
|
+
get outputIsFocused() {
|
|
52
|
+
return this._focusOnOutput;
|
|
53
|
+
}
|
|
54
|
+
set outputIsFocused(v) {
|
|
55
|
+
this._focusOnOutput = v;
|
|
56
|
+
}
|
|
57
|
+
get cellIsHovered() {
|
|
58
|
+
return this._hoveringCell;
|
|
59
|
+
}
|
|
60
|
+
set cellIsHovered(v) {
|
|
61
|
+
this._hoveringCell = v;
|
|
62
|
+
this._onDidChangeState.fire({ cellIsHoveredChanged: true });
|
|
63
|
+
}
|
|
64
|
+
constructor(viewType, model, initialNotebookLayoutInfo, foldingDelegate, viewContext, configurationService, textModelService, undoRedoService, codeEditorService) {
|
|
65
|
+
super(viewType, model, UUID.generateUuid(), viewContext, configurationService, textModelService, undoRedoService, codeEditorService);
|
|
66
|
+
this.foldingDelegate = foldingDelegate;
|
|
67
|
+
this.viewContext = viewContext;
|
|
68
|
+
this.cellKind = CellKind.Markup;
|
|
69
|
+
this._previewHeight = 0;
|
|
70
|
+
this._chatHeight = 0;
|
|
71
|
+
this._editorHeight = 0;
|
|
72
|
+
this._statusBarHeight = 0;
|
|
73
|
+
this._onDidChangeLayout = this._register(( new Emitter()));
|
|
74
|
+
this.onDidChangeLayout = this._onDidChangeLayout.event;
|
|
75
|
+
this._hoveringOutput = false;
|
|
76
|
+
this._focusOnOutput = false;
|
|
77
|
+
this._hoveringCell = false;
|
|
78
|
+
this.outputsViewModels = [];
|
|
79
|
+
this._hasFindResult = this._register(( new Emitter()));
|
|
80
|
+
this.hasFindResult = this._hasFindResult.event;
|
|
81
|
+
const { bottomToolbarGap } = this.viewContext.notebookOptions.computeBottomToolbarDimensions(this.viewType);
|
|
82
|
+
this._layoutInfo = {
|
|
83
|
+
chatHeight: 0,
|
|
84
|
+
editorHeight: 0,
|
|
85
|
+
previewHeight: 0,
|
|
86
|
+
fontInfo: initialNotebookLayoutInfo?.fontInfo || null,
|
|
87
|
+
editorWidth: initialNotebookLayoutInfo?.width
|
|
88
|
+
? this.viewContext.notebookOptions.computeMarkdownCellEditorWidth(initialNotebookLayoutInfo.width)
|
|
89
|
+
: 0,
|
|
90
|
+
bottomToolbarOffset: bottomToolbarGap,
|
|
91
|
+
totalHeight: 100,
|
|
92
|
+
layoutState: CellLayoutState.Uninitialized,
|
|
93
|
+
foldHintHeight: 0,
|
|
94
|
+
statusBarHeight: 0
|
|
95
|
+
};
|
|
96
|
+
this._register(this.onDidChangeState(e => {
|
|
97
|
+
this.viewContext.eventDispatcher.emit([( new NotebookCellStateChangedEvent(e, this.model))]);
|
|
98
|
+
if (e.foldingStateChanged) {
|
|
99
|
+
this._updateTotalHeight(this._computeTotalHeight(), CellLayoutContext.Fold);
|
|
100
|
+
}
|
|
101
|
+
}));
|
|
102
|
+
}
|
|
103
|
+
_computeTotalHeight() {
|
|
104
|
+
const layoutConfiguration = this.viewContext.notebookOptions.getLayoutConfiguration();
|
|
105
|
+
const { bottomToolbarGap } = this.viewContext.notebookOptions.computeBottomToolbarDimensions(this.viewType);
|
|
106
|
+
const foldHintHeight = this._computeFoldHintHeight();
|
|
107
|
+
if (this.getEditState() === CellEditState.Editing) {
|
|
108
|
+
return this._editorHeight
|
|
109
|
+
+ layoutConfiguration.markdownCellTopMargin
|
|
110
|
+
+ layoutConfiguration.markdownCellBottomMargin
|
|
111
|
+
+ bottomToolbarGap
|
|
112
|
+
+ this._statusBarHeight;
|
|
113
|
+
}
|
|
114
|
+
else {
|
|
115
|
+
return Math.max(1, this._previewHeight + bottomToolbarGap + foldHintHeight);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
_computeFoldHintHeight() {
|
|
119
|
+
return ((this.getEditState() === CellEditState.Editing || this.foldingState !== 2) ) ?
|
|
120
|
+
0 : this.viewContext.notebookOptions.getLayoutConfiguration().markdownFoldHintHeight;
|
|
121
|
+
}
|
|
122
|
+
updateOptions(e) {
|
|
123
|
+
if (e.cellStatusBarVisibility || e.insertToolbarPosition || e.cellToolbarLocation) {
|
|
124
|
+
this._updateTotalHeight(this._computeTotalHeight());
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
getOutputOffset(index) {
|
|
128
|
+
return -1;
|
|
129
|
+
}
|
|
130
|
+
updateOutputHeight(index, height) {
|
|
131
|
+
}
|
|
132
|
+
triggerFoldingStateChange() {
|
|
133
|
+
this._onDidChangeState.fire({ foldingStateChanged: true });
|
|
134
|
+
}
|
|
135
|
+
_updateTotalHeight(newHeight, context) {
|
|
136
|
+
if (newHeight !== this.layoutInfo.totalHeight) {
|
|
137
|
+
this.layoutChange({ totalHeight: newHeight, context });
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
layoutChange(state) {
|
|
141
|
+
const foldHintHeight = this._computeFoldHintHeight();
|
|
142
|
+
if (!this.isInputCollapsed) {
|
|
143
|
+
const editorWidth = state.outerWidth !== undefined
|
|
144
|
+
? this.viewContext.notebookOptions.computeMarkdownCellEditorWidth(state.outerWidth)
|
|
145
|
+
: this._layoutInfo.editorWidth;
|
|
146
|
+
const totalHeight = state.totalHeight === undefined
|
|
147
|
+
? (this._layoutInfo.layoutState === CellLayoutState.Uninitialized ? 100 : this._layoutInfo.totalHeight)
|
|
148
|
+
: state.totalHeight;
|
|
149
|
+
const previewHeight = this._previewHeight;
|
|
150
|
+
this._layoutInfo = {
|
|
151
|
+
fontInfo: state.font || this._layoutInfo.fontInfo,
|
|
152
|
+
editorWidth,
|
|
153
|
+
previewHeight,
|
|
154
|
+
chatHeight: this._chatHeight,
|
|
155
|
+
editorHeight: this._editorHeight,
|
|
156
|
+
statusBarHeight: this._statusBarHeight,
|
|
157
|
+
bottomToolbarOffset: this.viewContext.notebookOptions.computeBottomToolbarOffset(totalHeight, this.viewType),
|
|
158
|
+
totalHeight,
|
|
159
|
+
layoutState: CellLayoutState.Measured,
|
|
160
|
+
foldHintHeight
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
else {
|
|
164
|
+
const editorWidth = state.outerWidth !== undefined
|
|
165
|
+
? this.viewContext.notebookOptions.computeMarkdownCellEditorWidth(state.outerWidth)
|
|
166
|
+
: this._layoutInfo.editorWidth;
|
|
167
|
+
const totalHeight = this.viewContext.notebookOptions.computeCollapsedMarkdownCellHeight(this.viewType);
|
|
168
|
+
state.totalHeight = totalHeight;
|
|
169
|
+
this._layoutInfo = {
|
|
170
|
+
fontInfo: state.font || this._layoutInfo.fontInfo,
|
|
171
|
+
editorWidth,
|
|
172
|
+
chatHeight: this._chatHeight,
|
|
173
|
+
editorHeight: this._editorHeight,
|
|
174
|
+
statusBarHeight: this._statusBarHeight,
|
|
175
|
+
previewHeight: this._previewHeight,
|
|
176
|
+
bottomToolbarOffset: this.viewContext.notebookOptions.computeBottomToolbarOffset(totalHeight, this.viewType),
|
|
177
|
+
totalHeight,
|
|
178
|
+
layoutState: CellLayoutState.Measured,
|
|
179
|
+
foldHintHeight: 0
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
this._onDidChangeLayout.fire(state);
|
|
183
|
+
}
|
|
184
|
+
restoreEditorViewState(editorViewStates, totalHeight) {
|
|
185
|
+
super.restoreEditorViewState(editorViewStates);
|
|
186
|
+
if (totalHeight !== undefined && this.layoutInfo.layoutState === CellLayoutState.Uninitialized) {
|
|
187
|
+
this._layoutInfo = {
|
|
188
|
+
fontInfo: this._layoutInfo.fontInfo,
|
|
189
|
+
editorWidth: this._layoutInfo.editorWidth,
|
|
190
|
+
previewHeight: this._layoutInfo.previewHeight,
|
|
191
|
+
bottomToolbarOffset: this._layoutInfo.bottomToolbarOffset,
|
|
192
|
+
totalHeight: totalHeight,
|
|
193
|
+
chatHeight: this._chatHeight,
|
|
194
|
+
editorHeight: this._editorHeight,
|
|
195
|
+
statusBarHeight: this._statusBarHeight,
|
|
196
|
+
layoutState: CellLayoutState.FromCache,
|
|
197
|
+
foldHintHeight: this._layoutInfo.foldHintHeight
|
|
198
|
+
};
|
|
199
|
+
this.layoutChange({});
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
getDynamicHeight() {
|
|
203
|
+
return null;
|
|
204
|
+
}
|
|
205
|
+
getHeight(lineHeight) {
|
|
206
|
+
if (this._layoutInfo.layoutState === CellLayoutState.Uninitialized) {
|
|
207
|
+
return 100;
|
|
208
|
+
}
|
|
209
|
+
else {
|
|
210
|
+
return this._layoutInfo.totalHeight;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
onDidChangeTextModelContent() {
|
|
214
|
+
this._onDidChangeState.fire({ contentChanged: true });
|
|
215
|
+
}
|
|
216
|
+
onDeselect() {
|
|
217
|
+
}
|
|
218
|
+
startFind(value, options) {
|
|
219
|
+
const matches = super.cellStartFind(value, options);
|
|
220
|
+
if (matches === null) {
|
|
221
|
+
return null;
|
|
222
|
+
}
|
|
223
|
+
return {
|
|
224
|
+
cell: this,
|
|
225
|
+
contentMatches: matches
|
|
226
|
+
};
|
|
227
|
+
}
|
|
228
|
+
dispose() {
|
|
229
|
+
super.dispose();
|
|
230
|
+
this.foldingDelegate = null;
|
|
231
|
+
}
|
|
232
|
+
};
|
|
233
|
+
MarkupCellViewModel = ( __decorate([
|
|
234
|
+
( __param(5, IConfigurationService)),
|
|
235
|
+
( __param(6, ITextModelService)),
|
|
236
|
+
( __param(7, IUndoRedoService)),
|
|
237
|
+
( __param(8, ICodeEditorService))
|
|
238
|
+
], MarkupCellViewModel));
|
|
239
|
+
export { MarkupCellViewModel };
|
package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookOutlineEntryFactory.js
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { renderMarkdownAsPlaintext } from 'monaco-editor/esm/vs/base/browser/markdownRenderer.js';
|
|
2
|
+
import { localizeWithPath } from 'monaco-editor/esm/vs/nls.js';
|
|
3
|
+
import { getMarkdownHeadersInCell } from './foldingModel.js';
|
|
4
|
+
import { OutlineEntry } from './OutlineEntry.js';
|
|
5
|
+
import { CellKind } from '../../common/notebookCommon.js';
|
|
6
|
+
class NotebookOutlineEntryFactory {
|
|
7
|
+
constructor(executionStateService) {
|
|
8
|
+
this.executionStateService = executionStateService;
|
|
9
|
+
this.cellOutlineEntryCache = {};
|
|
10
|
+
}
|
|
11
|
+
getOutlineEntries(cell, index) {
|
|
12
|
+
const entries = [];
|
|
13
|
+
const isMarkdown = cell.cellKind === CellKind.Markup;
|
|
14
|
+
let content = getCellFirstNonEmptyLine(cell);
|
|
15
|
+
let hasHeader = false;
|
|
16
|
+
if (isMarkdown) {
|
|
17
|
+
const fullContent = cell.getText().substring(0, 10000);
|
|
18
|
+
for (const { depth, text } of getMarkdownHeadersInCell(fullContent)) {
|
|
19
|
+
hasHeader = true;
|
|
20
|
+
entries.push(( new OutlineEntry(index++, depth, cell, text, false, false)));
|
|
21
|
+
}
|
|
22
|
+
if (!hasHeader) {
|
|
23
|
+
const match = fullContent.match(/<h([1-6]).*>(.*)<\/h\1>/i);
|
|
24
|
+
if (match) {
|
|
25
|
+
hasHeader = true;
|
|
26
|
+
const level = parseInt(match[1]);
|
|
27
|
+
const text = match[2].trim();
|
|
28
|
+
entries.push(( new OutlineEntry(index++, level, cell, text, false, false)));
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
if (!hasHeader) {
|
|
32
|
+
content = renderMarkdownAsPlaintext({ value: content });
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
if (!hasHeader) {
|
|
36
|
+
if (!isMarkdown && cell.model.textModel) {
|
|
37
|
+
const cachedEntries = this.cellOutlineEntryCache[cell.model.textModel.id];
|
|
38
|
+
if (cachedEntries) {
|
|
39
|
+
cachedEntries.forEach((cached) => {
|
|
40
|
+
entries.push(( new OutlineEntry(
|
|
41
|
+
index++,
|
|
42
|
+
cached.level,
|
|
43
|
+
cell,
|
|
44
|
+
cached.name,
|
|
45
|
+
false,
|
|
46
|
+
false,
|
|
47
|
+
cached.range,
|
|
48
|
+
cached.kind
|
|
49
|
+
)));
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
const exeState = !isMarkdown && this.executionStateService.getCellExecution(cell.uri);
|
|
54
|
+
if (entries.length === 0) {
|
|
55
|
+
let preview = content.trim();
|
|
56
|
+
if (preview.length === 0) {
|
|
57
|
+
preview = ( localizeWithPath(
|
|
58
|
+
'vs/workbench/contrib/notebook/browser/viewModel/notebookOutlineEntryFactory',
|
|
59
|
+
'empty',
|
|
60
|
+
"empty cell"
|
|
61
|
+
));
|
|
62
|
+
}
|
|
63
|
+
entries.push(( new OutlineEntry(
|
|
64
|
+
index++,
|
|
65
|
+
7,
|
|
66
|
+
cell,
|
|
67
|
+
preview,
|
|
68
|
+
!!exeState,
|
|
69
|
+
exeState ? exeState.isPaused : false
|
|
70
|
+
)));
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return entries;
|
|
74
|
+
}
|
|
75
|
+
async cacheSymbols(cell, outlineModelService, cancelToken) {
|
|
76
|
+
const textModel = await cell.resolveTextModel();
|
|
77
|
+
const outlineModel = await outlineModelService.getOrCreate(textModel, cancelToken);
|
|
78
|
+
const entries = createOutlineEntries(outlineModel.getTopLevelSymbols(), 7);
|
|
79
|
+
this.cellOutlineEntryCache[textModel.id] = entries;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
function createOutlineEntries(symbols, level) {
|
|
83
|
+
const entries = [];
|
|
84
|
+
symbols.forEach(symbol => {
|
|
85
|
+
entries.push({ name: symbol.name, range: symbol.range, level, kind: symbol.kind });
|
|
86
|
+
if (symbol.children) {
|
|
87
|
+
entries.push(...createOutlineEntries(symbol.children, level + 1));
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
return entries;
|
|
91
|
+
}
|
|
92
|
+
function getCellFirstNonEmptyLine(cell) {
|
|
93
|
+
const textBuffer = cell.textBuffer;
|
|
94
|
+
for (let i = 0; i < textBuffer.getLineCount(); i++) {
|
|
95
|
+
const firstNonWhitespace = textBuffer.getLineFirstNonWhitespaceColumn(i + 1);
|
|
96
|
+
const lineLength = textBuffer.getLineLength(i + 1);
|
|
97
|
+
if (firstNonWhitespace < lineLength) {
|
|
98
|
+
return textBuffer.getLineContent(i + 1);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
return cell.getText().substring(0, 100);
|
|
102
|
+
}
|
|
103
|
+
export { NotebookOutlineEntryFactory };
|