@codingame/monaco-vscode-api 37.1.0 → 37.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/missing-services.js +6 -26
- package/package.json +8 -8
- package/services.d.ts +1 -1
- package/services.js +3 -3
- package/tools.d.ts +4 -0
- package/tools.js +24 -1
- package/vscode/src/vs/platform/product/common/product.js +1 -1
- package/vscode/src/vs/platform/webWorker/browser/webWorkerServiceImpl.js +2 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadDocuments.d.ts +63 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadDocuments.js +305 -0
- package/vscode/src/vs/workbench/api/common/extHost.protocol.d.ts +2 -2
- package/vscode/src/vs/workbench/api/common/extHostLanguageModelTools.js +1 -2
- package/vscode/src/vs/workbench/api/common/extHostTypeConverters.js +1 -1
- package/vscode/src/vs/workbench/browser/media/code-icon.svg +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatConstants.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatConstants.js +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginActions.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostActiveClientService.service.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsBanner.d.ts +30 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsBanner.js +39 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsService.service.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjectionService.service.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chat.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputNotificationService.service.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/attachments/chatVariableEntries.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/attachments/chatVariables.service.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatDebugService.service.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatImageBuffer.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatImageBuffer.js +29 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatService.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/chat/common/customizationHarnessService.service.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginRepositoryService.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginRepositoryService.service.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginService.service.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginInstallService.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginInstallService.service.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.service.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginSource.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/requestParser/chatParserTypes.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/toolIds.d.ts +3 -0
- package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/toolIds.js +7 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookBrowser.d.ts +3 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookEditorService.service.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookCommon.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorInput.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookExecutionService.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookExecutionService.service.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookExecutionStateService.service.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookService.service.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/search/browser/AISearch/aiSearchModel.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/search/browser/notebookSearch/notebookSearchModel.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/search/browser/notebookSearch/notebookSearchModelBase.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/search/browser/searchTreeModel/folderMatch.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/search/browser/searchTreeModel/searchTreeCommon.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/search/browser/searchView.js +4 -3
- package/vscode/src/vs/workbench/contrib/welcomeAgentSessions/browser/agentSessionsWelcomeInput.d.ts +34 -0
- package/vscode/src/vs/workbench/contrib/welcomeAgentSessions/browser/agentSessionsWelcomeInput.js +72 -0
- package/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedInput.d.ts +44 -0
- package/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedInput.js +96 -0
- package/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/media/gettingStarted.css +1148 -0
- package/vscode/src/vs/workbench/contrib/welcomeOnboarding/common/onboardingTypes.d.ts +81 -0
- package/vscode/src/vs/workbench/contrib/welcomeOnboarding/common/onboardingTypes.js +97 -0
- package/vscode/src/vs/workbench/services/extensions/common/extHostCustomers.d.ts +32 -0
- package/vscode/src/vs/workbench/services/extensions/common/extHostCustomers.js +45 -0
- package/vscode/src/vs/platform/agentHost/common/agentHostEnablementService.d.ts +0 -7
- package/vscode/src/vs/platform/agentHost/common/agentHostEnablementService.js +0 -92
- package/vscode/src/vs/platform/layout/browser/zIndexRegistry.d.ts +0 -12
- package/vscode/src/vs/platform/layout/browser/zIndexRegistry.js +0 -64
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsModel.d.ts +0 -262
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsModel.js +0 -865
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatDynamicVariables.d.ts +0 -57
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatDynamicVariables.js +0 -311
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatVariables.d.ts +0 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatVariables.js +0 -80
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionDescription.d.ts +0 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionDescription.js +0 -57
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessions.contribution.d.ts +0 -231
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessions.contribution.js +0 -1850
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetup.d.ts +0 -109
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetup.js +0 -85
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputNotificationService.d.ts +0 -140
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputNotificationService.js +0 -186
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatDynamicVariablesConstant.d.ts +0 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatDynamicVariablesConstant.js +0 -5
- package/vscode/src/vs/workbench/contrib/chat/common/attachments/chatVariables.d.ts +0 -46
- package/vscode/src/vs/workbench/contrib/chat/common/attachments/chatVariables.js +0 -17
- package/vscode/src/vs/workbench/contrib/chat/common/chatDebugService.d.ts +0 -253
- package/vscode/src/vs/workbench/contrib/chat/common/chatDebugService.js +0 -20
- package/vscode/src/vs/workbench/contrib/chat/common/chatImageExtraction.d.ts +0 -34
- package/vscode/src/vs/workbench/contrib/chat/common/chatImageExtraction.js +0 -194
- package/vscode/src/vs/workbench/contrib/chat/common/chatSelectedModel.d.ts +0 -87
- package/vscode/src/vs/workbench/contrib/chat/common/chatSelectedModel.js +0 -69
- package/vscode/src/vs/workbench/contrib/chat/common/customizationHarnessService.d.ts +0 -300
- package/vscode/src/vs/workbench/contrib/chat/common/customizationHarnessService.js +0 -272
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginEnablement.d.ts +0 -25
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginEnablement.js +0 -178
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginService.d.ts +0 -78
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginService.js +0 -51
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/fileBackedInstalledPluginsStore.d.ts +0 -67
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/fileBackedInstalledPluginsStore.js +0 -195
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/marketplaceReference.d.ts +0 -67
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/marketplaceReference.js +0 -294
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.d.ts +0 -212
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.js +0 -955
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/strictKnownMarketplaces.d.ts +0 -31
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/strictKnownMarketplaces.js +0 -122
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/computeAutomaticInstructions.d.ts +0 -65
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/computeAutomaticInstructions.js +0 -697
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/config/config.d.ts +0 -150
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/config/config.js +0 -142
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookClaudeCompat.d.ts +0 -50
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookClaudeCompat.js +0 -77
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookCompatibility.d.ts +0 -77
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookCompatibility.js +0 -120
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookCopilotCliCompat.d.ts +0 -10
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookCopilotCliCompat.js +0 -23
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/extensionPromptFileService.d.ts +0 -92
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/extensionPromptFileService.js +0 -335
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.d.ts +0 -235
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.js +0 -1673
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.d.ts +0 -202
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.js +0 -872
- package/vscode/src/vs/workbench/contrib/chat/common/requestParser/chatRequestParser.d.ts +0 -35
- package/vscode/src/vs/workbench/contrib/chat/common/requestParser/chatRequestParser.js +0 -289
- package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/askQuestionsTool.d.ts +0 -72
- package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/askQuestionsTool.js +0 -600
- package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/confirmationTool.d.ts +0 -36
- package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/confirmationTool.js +0 -239
- package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/editFileTool.d.ts +0 -22
- package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/editFileTool.js +0 -143
- package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/manageTodoListTool.d.ts +0 -24
- package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/manageTodoListTool.js +0 -298
- package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/reviewPlanTool.d.ts +0 -25
- package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/reviewPlanTool.js +0 -177
- package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/runSubagentTool.d.ts +0 -73
- package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/runSubagentTool.js +0 -577
- package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/setArtifactRulesTool.d.ts +0 -11
- package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/setArtifactRulesTool.js +0 -90
- package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/setArtifactsTool.d.ts +0 -16
- package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/setArtifactsTool.js +0 -130
- package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/taskCompleteTool.d.ts +0 -12
- package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/taskCompleteTool.js +0 -53
- package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/toolHelpers.d.ts +0 -5
- package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/toolHelpers.js +0 -12
- package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/tools.d.ts +0 -10
- package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/tools.js +0 -92
- package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsContribution.d.ts +0 -38
- package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsContribution.js +0 -518
- package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsParametersSchema.d.ts +0 -6
- package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsParametersSchema.js +0 -231
- package/vscode/src/vs/workbench/contrib/chat/common/tools/terminalToolIds.d.ts +0 -20
- package/vscode/src/vs/workbench/contrib/chat/common/tools/terminalToolIds.js +0 -17
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/cellOutputActions.d.ts +0 -6
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/cellOutputActions.js +0 -283
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/coreActions.d.ts +0 -91
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/coreActions.js +0 -340
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/foldingController.d.ts +0 -17
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/foldingController.js +0 -272
- package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebook.css +0 -686
- package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookCellChat.css +0 -348
- package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookCellEditorHint.css +0 -8
- package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookCellInsertToolbar.css +0 -92
- package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookCellOutput.css +0 -119
- package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookCellStatusBar.css +0 -79
- package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookCellTitleToolbar.css +0 -61
- package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookChatEditController.css +0 -55
- package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookChatEditorOverlay.css +0 -63
- package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookDnd.css +0 -79
- package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookEditorStickyScroll.css +0 -63
- package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookFocusIndicator.css +0 -92
- package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookFolding.css +0 -79
- package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookKernelActionViewItem.css +0 -24
- package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookOutline.css +0 -61
- package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookToolbar.css +0 -102
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookAccessibilityProvider.d.ts +0 -27
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookAccessibilityProvider.js +0 -131
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookCellLayoutManager.d.ts +0 -18
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookCellLayoutManager.js +0 -92
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookEditor.d.ts +0 -105
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookEditor.js +0 -673
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookEditorExtensions.d.ts +0 -9
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookEditorExtensions.js +0 -37
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookEditorWidget.d.ts +0 -354
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookEditorWidget.js +0 -2926
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookIcons.d.ts +0 -29
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookIcons.js +0 -36
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookLogger.d.ts +0 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookLogger.js +0 -19
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookOptions.d.ts +0 -200
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookOptions.js +0 -591
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookViewEvents.d.ts +0 -56
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookViewEvents.js +0 -30
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellPart.d.ts +0 -99
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellPart.js +0 -131
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellActionView.d.ts +0 -30
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellActionView.js +0 -115
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellComments.d.ts +0 -28
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellComments.js +0 -158
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellContextKeys.d.ts +0 -40
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellContextKeys.js +0 -183
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellDecorations.d.ts +0 -10
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellDecorations.js +0 -66
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellDnd.d.ts +0 -52
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellDnd.js +0 -429
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellDragRenderer.d.ts +0 -6
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellDragRenderer.js +0 -108
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellEditorOptions.d.ts +0 -36
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellEditorOptions.js +0 -221
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellExecution.d.ts +0 -17
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellExecution.js +0 -142
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellFocus.d.ts +0 -5
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellFocus.js +0 -23
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellFocusIndicator.d.ts +0 -18
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellFocusIndicator.js +0 -104
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellOutput.d.ts +0 -92
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellOutput.js +0 -762
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellProgressBar.d.ts +0 -15
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellProgressBar.js +0 -58
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellStatusPart.d.ts +0 -36
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellStatusPart.js +0 -357
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellToolbarStickyScroll.d.ts +0 -6
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellToolbarStickyScroll.js +0 -32
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellToolbars.d.ts +0 -47
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellToolbars.js +0 -260
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellWidgets.d.ts +0 -9
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellWidgets.js +0 -10
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/chat/cellChatPart.d.ts +0 -10
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/chat/cellChatPart.js +0 -24
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCell.d.ts +0 -182
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCell.js +0 -796
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCellExecutionIcon.d.ts +0 -13
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCellExecutionIcon.js +0 -79
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCellRunToolbar.d.ts +0 -30
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCellRunToolbar.js +0 -126
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/collapsedCellInput.d.ts +0 -6
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/collapsedCellInput.js +0 -32
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/collapsedCellOutput.d.ts +0 -8
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/collapsedCellOutput.js +0 -50
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/foldedCellHint.d.ts +0 -18
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/foldedCellHint.js +0 -119
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/markupCell.d.ts +0 -57
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/markupCell.js +0 -443
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/notebookCellAnchor.d.ts +0 -20
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/notebookCellAnchor.js +0 -56
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/notebookCellEditorPool.d.ts +0 -24
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/notebookCellEditorPool.js +0 -121
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/notebookCellList.d.ts +0 -152
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/notebookCellList.js +0 -1288
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/notebookCellListView.d.ts +0 -59
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/notebookCellListView.js +0 -287
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/notebookRenderingCommon.d.ts +0 -117
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/notebookRenderingCommon.js +0 -6
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/backLayerWebView.d.ts +0 -222
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/backLayerWebView.js +0 -1840
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/cellRenderer.d.ts +0 -63
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/cellRenderer.js +0 -449
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/webviewMessages.d.ts +0 -432
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/webviewPreloads.d.ts +0 -18
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/webviewPreloads.js +0 -2546
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/webviewThemeMapping.d.ts +0 -8
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/webviewThemeMapping.js +0 -105
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/baseCellViewModel.d.ts +0 -137
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/baseCellViewModel.js +0 -646
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/cellEditorOptions.d.ts +0 -21
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/cellEditorOptions.js +0 -101
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/cellOutputTextHelper.d.ts +0 -13
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/cellOutputTextHelper.js +0 -111
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/cellOutputViewModel.d.ts +0 -30
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/cellOutputViewModel.js +0 -65
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/cellSelectionCollection.d.ts +0 -13
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/cellSelectionCollection.js +0 -49
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/codeCellViewModel.d.ts +0 -89
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/codeCellViewModel.js +0 -472
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/eventDispatcher.d.ts +0 -11
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/eventDispatcher.js +0 -34
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/foldingModel.d.ts +0 -33
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/foldingModel.js +0 -275
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/markupCellViewModel.d.ts +0 -69
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/markupCellViewModel.js +0 -269
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookViewModelImpl.d.ts +0 -125
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookViewModelImpl.js +0 -958
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/viewContext.d.ts +0 -9
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/viewContext.js +0 -11
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookCellOverlays.d.ts +0 -20
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookCellOverlays.js +0 -101
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookEditorStickyScroll.d.ts +0 -65
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookEditorStickyScroll.js +0 -458
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookEditorToolbar.d.ts +0 -80
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookEditorToolbar.js +0 -708
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookEditorWidgetContextKeys.d.ts +0 -37
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookEditorWidgetContextKeys.js +0 -193
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookHorizontalTracker.d.ts +0 -7
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookHorizontalTracker.js +0 -62
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookKernelQuickPickStrategy.d.ts +0 -108
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookKernelQuickPickStrategy.js +0 -717
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookKernelView.d.ts +0 -23
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookKernelView.js +0 -183
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookOverviewRuler.d.ts +0 -11
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookOverviewRuler.js +0 -134
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookTopCellToolbar.d.ts +0 -20
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookTopCellToolbar.js +0 -135
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookViewZones.d.ts +0 -27
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookViewZones.js +0 -213
- package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookCellOutputTextModel.d.ts +0 -27
- package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookCellOutputTextModel.js +0 -104
- package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookCellTextModel.d.ts +0 -115
- package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookCellTextModel.js +0 -480
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorModel.d.ts +0 -87
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorModel.js +0 -352
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookExecutionStateService.d.ts +0 -81
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookExecutionStateService.js +0 -9
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookPerformance.d.ts +0 -10
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookPerformance.js +0 -19
|
@@ -1,443 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { __decorate, __param } from '../../../../../../../../../external/tslib/tslib.es6.js';
|
|
3
|
-
import { getActiveElement, getRootContainer, show, hide, append, $, clearNode, reset } from '../../../../../../base/browser/dom.js';
|
|
4
|
-
import { safeSetInnerHtml } from '../../../../../../base/browser/domSanitize.js';
|
|
5
|
-
import { renderIcon } from '../../../../../../base/browser/ui/iconLabel/iconLabels.js';
|
|
6
|
-
import { raceCancellation, disposableTimeout } from '../../../../../../base/common/async.js';
|
|
7
|
-
import { CancellationTokenSource } from '../../../../../../base/common/cancellation.js';
|
|
8
|
-
import { Codicon } from '../../../../../../base/common/codicons.js';
|
|
9
|
-
import { ThemeIcon } from '../../../../../../base/common/themables.js';
|
|
10
|
-
import { Disposable, DisposableStore, MutableDisposable, toDisposable } from '../../../../../../base/common/lifecycle.js';
|
|
11
|
-
import { CodeEditorWidget } from '../../../../../../editor/browser/widget/codeEditor/codeEditorWidget.js';
|
|
12
|
-
import { EditorContextKeys } from '../../../../../../editor/common/editorContextKeys.js';
|
|
13
|
-
import { ILanguageService } from '../../../../../../editor/common/languages/language.service.js';
|
|
14
|
-
import { tokenizeToStringSync } from '../../../../../../editor/common/languages/textToHtmlTokenizer.js';
|
|
15
|
-
import { localize } from '../../../../../../nls.js';
|
|
16
|
-
import { IAccessibilityService } from '../../../../../../platform/accessibility/common/accessibility.service.js';
|
|
17
|
-
import { IConfigurationService } from '../../../../../../platform/configuration/common/configuration.service.js';
|
|
18
|
-
import { IContextKeyService } from '../../../../../../platform/contextkey/common/contextkey.service.js';
|
|
19
|
-
import { IInstantiationService } from '../../../../../../platform/instantiation/common/instantiation.js';
|
|
20
|
-
import { ServiceCollection } from '../../../../../../platform/instantiation/common/serviceCollection.js';
|
|
21
|
-
import { IKeybindingService } from '../../../../../../platform/keybinding/common/keybinding.service.js';
|
|
22
|
-
import { CellEditState, CellFocusMode, EXPAND_CELL_INPUT_COMMAND_ID, CellFoldingState } from '../../notebookBrowser.js';
|
|
23
|
-
import { expandedIcon, collapsedIcon } from '../../notebookIcons.js';
|
|
24
|
-
import { CellEditorOptions } from './cellEditorOptions.js';
|
|
25
|
-
import { collapsedCellTTPolicy } from '../notebookRenderingCommon.js';
|
|
26
|
-
import { WordHighlighterContribution } from '../../../../../../editor/contrib/wordHighlighter/browser/wordHighlighter.js';
|
|
27
|
-
|
|
28
|
-
let MarkupCell = class MarkupCell extends Disposable {
|
|
29
|
-
constructor(
|
|
30
|
-
notebookEditor,
|
|
31
|
-
viewCell,
|
|
32
|
-
templateData,
|
|
33
|
-
renderedEditors,
|
|
34
|
-
accessibilityService,
|
|
35
|
-
contextKeyService,
|
|
36
|
-
instantiationService,
|
|
37
|
-
languageService,
|
|
38
|
-
configurationService,
|
|
39
|
-
keybindingService
|
|
40
|
-
) {
|
|
41
|
-
super();
|
|
42
|
-
this.notebookEditor = notebookEditor;
|
|
43
|
-
this.viewCell = viewCell;
|
|
44
|
-
this.templateData = templateData;
|
|
45
|
-
this.renderedEditors = renderedEditors;
|
|
46
|
-
this.accessibilityService = accessibilityService;
|
|
47
|
-
this.contextKeyService = contextKeyService;
|
|
48
|
-
this.instantiationService = instantiationService;
|
|
49
|
-
this.languageService = languageService;
|
|
50
|
-
this.configurationService = configurationService;
|
|
51
|
-
this.keybindingService = keybindingService;
|
|
52
|
-
this.editor = null;
|
|
53
|
-
this.localDisposables = this._register(( new DisposableStore()));
|
|
54
|
-
this.focusSwitchDisposable = this._register(( new MutableDisposable()));
|
|
55
|
-
this.editorDisposables = this._register(( new DisposableStore()));
|
|
56
|
-
this._isDisposed = false;
|
|
57
|
-
this.constructDOM();
|
|
58
|
-
this.editorPart = templateData.editorPart;
|
|
59
|
-
this.cellEditorOptions = this._register(( new CellEditorOptions(
|
|
60
|
-
this.notebookEditor.getBaseCellEditorOptions(viewCell.language),
|
|
61
|
-
this.notebookEditor.notebookOptions,
|
|
62
|
-
this.configurationService
|
|
63
|
-
)));
|
|
64
|
-
this.cellEditorOptions.setLineNumbers(this.viewCell.lineNumbers);
|
|
65
|
-
this.editorOptions = this.cellEditorOptions.getValue(this.viewCell.internalMetadata, this.viewCell.uri);
|
|
66
|
-
this._register(toDisposable(() => renderedEditors.delete(this.viewCell)));
|
|
67
|
-
this.registerListeners();
|
|
68
|
-
this.templateData.cellParts.scheduleRenderCell(this.viewCell);
|
|
69
|
-
this._register(toDisposable(() => {
|
|
70
|
-
this.templateData.cellParts.unrenderCell(this.viewCell);
|
|
71
|
-
}));
|
|
72
|
-
this._register(this.accessibilityService.onDidChangeScreenReaderOptimized(() => {
|
|
73
|
-
this.viewUpdate();
|
|
74
|
-
}));
|
|
75
|
-
this.updateForHover();
|
|
76
|
-
this.updateForFocusModeChange();
|
|
77
|
-
this.foldingState = viewCell.foldingState;
|
|
78
|
-
this.layoutFoldingIndicator();
|
|
79
|
-
this.updateFoldingIconShowClass();
|
|
80
|
-
if (this.viewCell.layoutInfo.totalHeight > 0) {
|
|
81
|
-
this.relayoutCell();
|
|
82
|
-
}
|
|
83
|
-
this.viewUpdate();
|
|
84
|
-
this.layoutCellParts();
|
|
85
|
-
this._register(this.viewCell.onDidChangeLayout(() => {
|
|
86
|
-
this.layoutCellParts();
|
|
87
|
-
}));
|
|
88
|
-
}
|
|
89
|
-
layoutCellParts() {
|
|
90
|
-
this.templateData.cellParts.updateInternalLayoutNow(this.viewCell);
|
|
91
|
-
}
|
|
92
|
-
constructDOM() {
|
|
93
|
-
const id = `aria-markup-cell-${this.viewCell.id}`;
|
|
94
|
-
this.markdownAccessibilityContainer = this.templateData.cellContainer;
|
|
95
|
-
this.markdownAccessibilityContainer.id = id;
|
|
96
|
-
this.markdownAccessibilityContainer.style.height = "1px";
|
|
97
|
-
this.markdownAccessibilityContainer.style.overflow = "hidden";
|
|
98
|
-
this.markdownAccessibilityContainer.style.position = "absolute";
|
|
99
|
-
this.markdownAccessibilityContainer.style.top = "100000px";
|
|
100
|
-
this.markdownAccessibilityContainer.style.left = "10000px";
|
|
101
|
-
this.markdownAccessibilityContainer.ariaHidden = "false";
|
|
102
|
-
this.templateData.rootContainer.setAttribute("aria-describedby", id);
|
|
103
|
-
this.templateData.container.classList.toggle("webview-backed-markdown-cell", true);
|
|
104
|
-
}
|
|
105
|
-
registerListeners() {
|
|
106
|
-
this._register(this.viewCell.onDidChangeState(e => {
|
|
107
|
-
this.templateData.cellParts.updateState(this.viewCell, e);
|
|
108
|
-
}));
|
|
109
|
-
this._register(this.viewCell.model.onDidChangeMetadata(() => {
|
|
110
|
-
this.viewUpdate();
|
|
111
|
-
}));
|
|
112
|
-
this._register(this.viewCell.onDidChangeState(e => {
|
|
113
|
-
if (e.editStateChanged || e.contentChanged) {
|
|
114
|
-
this.viewUpdate();
|
|
115
|
-
}
|
|
116
|
-
if (e.focusModeChanged) {
|
|
117
|
-
this.updateForFocusModeChange();
|
|
118
|
-
}
|
|
119
|
-
if (e.foldingStateChanged) {
|
|
120
|
-
const foldingState = this.viewCell.foldingState;
|
|
121
|
-
if (foldingState !== this.foldingState) {
|
|
122
|
-
this.foldingState = foldingState;
|
|
123
|
-
this.layoutFoldingIndicator();
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
if (e.cellIsHoveredChanged) {
|
|
127
|
-
this.updateForHover();
|
|
128
|
-
}
|
|
129
|
-
if (e.inputCollapsedChanged) {
|
|
130
|
-
this.updateCollapsedState();
|
|
131
|
-
this.viewUpdate();
|
|
132
|
-
}
|
|
133
|
-
if (e.cellLineNumberChanged) {
|
|
134
|
-
this.cellEditorOptions.setLineNumbers(this.viewCell.lineNumbers);
|
|
135
|
-
}
|
|
136
|
-
}));
|
|
137
|
-
this._register(this.notebookEditor.notebookOptions.onDidChangeOptions(e => {
|
|
138
|
-
if (e.showFoldingControls) {
|
|
139
|
-
this.updateFoldingIconShowClass();
|
|
140
|
-
}
|
|
141
|
-
}));
|
|
142
|
-
this._register(this.viewCell.onDidChangeLayout(e => {
|
|
143
|
-
const layoutInfo = this.editor?.getLayoutInfo();
|
|
144
|
-
if (e.outerWidth && this.viewCell.getEditState() === CellEditState.Editing && layoutInfo && layoutInfo.width !== this.viewCell.layoutInfo.editorWidth) {
|
|
145
|
-
this.onCellEditorWidthChange();
|
|
146
|
-
}
|
|
147
|
-
}));
|
|
148
|
-
this._register(this.cellEditorOptions.onDidChange(() => this.updateMarkupCellOptions()));
|
|
149
|
-
}
|
|
150
|
-
updateMarkupCellOptions() {
|
|
151
|
-
this.updateEditorOptions(
|
|
152
|
-
this.cellEditorOptions.getUpdatedValue(this.viewCell.internalMetadata, this.viewCell.uri)
|
|
153
|
-
);
|
|
154
|
-
if (this.editor) {
|
|
155
|
-
this.editor.updateOptions(
|
|
156
|
-
this.cellEditorOptions.getUpdatedValue(this.viewCell.internalMetadata, this.viewCell.uri)
|
|
157
|
-
);
|
|
158
|
-
const cts = ( new CancellationTokenSource());
|
|
159
|
-
this._register({
|
|
160
|
-
dispose() {
|
|
161
|
-
cts.dispose(true);
|
|
162
|
-
}
|
|
163
|
-
});
|
|
164
|
-
raceCancellation(this.viewCell.resolveTextModel(), cts.token).then(model => {
|
|
165
|
-
if (this._isDisposed) {
|
|
166
|
-
return;
|
|
167
|
-
}
|
|
168
|
-
if (model) {
|
|
169
|
-
model.updateOptions({
|
|
170
|
-
indentSize: this.cellEditorOptions.indentSize,
|
|
171
|
-
tabSize: this.cellEditorOptions.tabSize,
|
|
172
|
-
insertSpaces: this.cellEditorOptions.insertSpaces
|
|
173
|
-
});
|
|
174
|
-
}
|
|
175
|
-
});
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
updateCollapsedState() {
|
|
179
|
-
if (this.viewCell.isInputCollapsed) {
|
|
180
|
-
this.notebookEditor.hideMarkupPreviews([this.viewCell]);
|
|
181
|
-
} else {
|
|
182
|
-
this.notebookEditor.unhideMarkupPreviews([this.viewCell]);
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
updateForHover() {
|
|
186
|
-
this.templateData.container.classList.toggle("markdown-cell-hover", this.viewCell.cellIsHovered);
|
|
187
|
-
}
|
|
188
|
-
updateForFocusModeChange() {
|
|
189
|
-
if (this.viewCell.focusMode === CellFocusMode.Editor) {
|
|
190
|
-
this.focusEditorIfNeeded();
|
|
191
|
-
}
|
|
192
|
-
this.templateData.container.classList.toggle("cell-editor-focus", this.viewCell.focusMode === CellFocusMode.Editor);
|
|
193
|
-
}
|
|
194
|
-
dispose() {
|
|
195
|
-
this._isDisposed = true;
|
|
196
|
-
if (this.notebookEditor.getActiveCell() === this.viewCell && this.viewCell.focusMode === CellFocusMode.Editor && (this.notebookEditor.hasEditorFocus() || getActiveElement(this.notebookEditor.getDomNode().ownerDocument) === getRootContainer(this.notebookEditor.getDomNode()))) {
|
|
197
|
-
this.notebookEditor.focusContainer();
|
|
198
|
-
}
|
|
199
|
-
this.viewCell.detachTextEditor();
|
|
200
|
-
super.dispose();
|
|
201
|
-
}
|
|
202
|
-
updateFoldingIconShowClass() {
|
|
203
|
-
const showFoldingIcon = this.notebookEditor.notebookOptions.getDisplayOptions().showFoldingControls;
|
|
204
|
-
this.templateData.foldingIndicator.classList.remove("mouseover", "always");
|
|
205
|
-
this.templateData.foldingIndicator.classList.add(showFoldingIcon);
|
|
206
|
-
}
|
|
207
|
-
viewUpdate() {
|
|
208
|
-
if (this.viewCell.isInputCollapsed) {
|
|
209
|
-
this.viewUpdateCollapsed();
|
|
210
|
-
} else if (this.viewCell.getEditState() === CellEditState.Editing) {
|
|
211
|
-
this.viewUpdateEditing();
|
|
212
|
-
} else {
|
|
213
|
-
this.viewUpdatePreview();
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
viewUpdateCollapsed() {
|
|
217
|
-
show(this.templateData.cellInputCollapsedContainer);
|
|
218
|
-
hide(this.editorPart);
|
|
219
|
-
this.templateData.cellInputCollapsedContainer.innerText = "";
|
|
220
|
-
const markdownIcon = append(this.templateData.cellInputCollapsedContainer, $("span"));
|
|
221
|
-
markdownIcon.classList.add(...ThemeIcon.asClassNameArray(Codicon.markdown));
|
|
222
|
-
const element = $("div");
|
|
223
|
-
element.classList.add("cell-collapse-preview");
|
|
224
|
-
const richEditorText = this.getRichText(this.viewCell.textBuffer, this.viewCell.language);
|
|
225
|
-
element.innerText = richEditorText;
|
|
226
|
-
element.innerHTML = (collapsedCellTTPolicy?.createHTML(richEditorText) ?? richEditorText);
|
|
227
|
-
this.templateData.cellInputCollapsedContainer.appendChild(element);
|
|
228
|
-
const expandIcon = append(element, $("span.expandInputIcon"));
|
|
229
|
-
expandIcon.classList.add(...ThemeIcon.asClassNameArray(Codicon.more));
|
|
230
|
-
const keybinding = this.keybindingService.lookupKeybinding(EXPAND_CELL_INPUT_COMMAND_ID);
|
|
231
|
-
if (keybinding) {
|
|
232
|
-
element.title = ( localize(14841, "Double-click to expand cell input ({0})", keybinding.getLabel()));
|
|
233
|
-
expandIcon.title = ( localize(14842, "Expand Cell Input ({0})", keybinding.getLabel()));
|
|
234
|
-
}
|
|
235
|
-
this.markdownAccessibilityContainer.ariaHidden = "true";
|
|
236
|
-
this.templateData.container.classList.toggle("input-collapsed", true);
|
|
237
|
-
this.viewCell.renderedMarkdownHeight = 0;
|
|
238
|
-
this.viewCell.layoutChange({});
|
|
239
|
-
}
|
|
240
|
-
getRichText(buffer, language) {
|
|
241
|
-
return tokenizeToStringSync(this.languageService, buffer.getLineContent(1), language);
|
|
242
|
-
}
|
|
243
|
-
viewUpdateEditing() {
|
|
244
|
-
let editorHeight;
|
|
245
|
-
show(this.editorPart);
|
|
246
|
-
this.markdownAccessibilityContainer.ariaHidden = "true";
|
|
247
|
-
hide(this.templateData.cellInputCollapsedContainer);
|
|
248
|
-
this.notebookEditor.hideMarkupPreviews([this.viewCell]);
|
|
249
|
-
this.templateData.container.classList.toggle("input-collapsed", false);
|
|
250
|
-
this.templateData.container.classList.toggle("markdown-cell-edit-mode", true);
|
|
251
|
-
if (this.editor && this.editor.hasModel()) {
|
|
252
|
-
editorHeight = this.editor.getContentHeight();
|
|
253
|
-
this.viewCell.attachTextEditor(this.editor);
|
|
254
|
-
this.focusEditorIfNeeded();
|
|
255
|
-
this.bindEditorListeners(this.editor);
|
|
256
|
-
this.editor.layout({
|
|
257
|
-
width: this.viewCell.layoutInfo.editorWidth,
|
|
258
|
-
height: editorHeight
|
|
259
|
-
});
|
|
260
|
-
} else {
|
|
261
|
-
this.editorDisposables.clear();
|
|
262
|
-
const width = this.notebookEditor.notebookOptions.computeMarkdownCellEditorWidth(this.notebookEditor.getLayoutInfo().width);
|
|
263
|
-
const lineNum = this.viewCell.lineCount;
|
|
264
|
-
const lineHeight = this.viewCell.layoutInfo.fontInfo?.lineHeight || 17;
|
|
265
|
-
const editorPadding = this.notebookEditor.notebookOptions.computeEditorPadding(this.viewCell.internalMetadata, this.viewCell.uri);
|
|
266
|
-
editorHeight = Math.max(lineNum, 1) * lineHeight + editorPadding.top + editorPadding.bottom;
|
|
267
|
-
this.templateData.editorContainer.innerText = "";
|
|
268
|
-
const editorContextKeyService = this.contextKeyService.createScoped(this.templateData.editorPart);
|
|
269
|
-
EditorContextKeys.inCompositeEditor.bindTo(editorContextKeyService).set(true);
|
|
270
|
-
const editorInstaService = this.editorDisposables.add(this.instantiationService.createChild(( new ServiceCollection([IContextKeyService, editorContextKeyService]))));
|
|
271
|
-
this.editorDisposables.add(editorContextKeyService);
|
|
272
|
-
this.editor = this.editorDisposables.add(
|
|
273
|
-
editorInstaService.createInstance(CodeEditorWidget, this.templateData.editorContainer, {
|
|
274
|
-
...this.editorOptions,
|
|
275
|
-
dimension: {
|
|
276
|
-
width: width,
|
|
277
|
-
height: editorHeight
|
|
278
|
-
},
|
|
279
|
-
allowVariableLineHeights: false
|
|
280
|
-
}, {
|
|
281
|
-
contributions: this.notebookEditor.creationOptions.cellEditorContributions
|
|
282
|
-
})
|
|
283
|
-
);
|
|
284
|
-
this.templateData.currentEditor = this.editor;
|
|
285
|
-
this.editorDisposables.add(this.editor.onDidBlurEditorWidget(() => {
|
|
286
|
-
if (this.editor) {
|
|
287
|
-
WordHighlighterContribution.get(this.editor)?.stopHighlighting();
|
|
288
|
-
}
|
|
289
|
-
}));
|
|
290
|
-
this.editorDisposables.add(this.editor.onDidFocusEditorWidget(() => {
|
|
291
|
-
if (this.editor) {
|
|
292
|
-
WordHighlighterContribution.get(this.editor)?.restoreViewState(true);
|
|
293
|
-
}
|
|
294
|
-
}));
|
|
295
|
-
const cts = ( new CancellationTokenSource());
|
|
296
|
-
this.editorDisposables.add({
|
|
297
|
-
dispose() {
|
|
298
|
-
cts.dispose(true);
|
|
299
|
-
}
|
|
300
|
-
});
|
|
301
|
-
raceCancellation(this.viewCell.resolveTextModel(), cts.token).then(model => {
|
|
302
|
-
if (!model) {
|
|
303
|
-
return;
|
|
304
|
-
}
|
|
305
|
-
this.editor.setModel(model);
|
|
306
|
-
model.updateOptions({
|
|
307
|
-
indentSize: this.cellEditorOptions.indentSize,
|
|
308
|
-
tabSize: this.cellEditorOptions.tabSize,
|
|
309
|
-
insertSpaces: this.cellEditorOptions.insertSpaces
|
|
310
|
-
});
|
|
311
|
-
const realContentHeight = this.editor.getContentHeight();
|
|
312
|
-
if (realContentHeight !== editorHeight) {
|
|
313
|
-
this.editor.layout({
|
|
314
|
-
width: width,
|
|
315
|
-
height: realContentHeight
|
|
316
|
-
});
|
|
317
|
-
editorHeight = realContentHeight;
|
|
318
|
-
}
|
|
319
|
-
this.viewCell.attachTextEditor(this.editor);
|
|
320
|
-
if (this.viewCell.getEditState() === CellEditState.Editing) {
|
|
321
|
-
this.focusEditorIfNeeded();
|
|
322
|
-
}
|
|
323
|
-
this.bindEditorListeners(this.editor);
|
|
324
|
-
this.viewCell.editorHeight = editorHeight;
|
|
325
|
-
});
|
|
326
|
-
}
|
|
327
|
-
this.viewCell.editorHeight = editorHeight;
|
|
328
|
-
this.focusEditorIfNeeded();
|
|
329
|
-
this.renderedEditors.set(this.viewCell, this.editor);
|
|
330
|
-
}
|
|
331
|
-
viewUpdatePreview() {
|
|
332
|
-
this.viewCell.detachTextEditor();
|
|
333
|
-
hide(this.editorPart);
|
|
334
|
-
hide(this.templateData.cellInputCollapsedContainer);
|
|
335
|
-
this.markdownAccessibilityContainer.ariaHidden = "false";
|
|
336
|
-
this.templateData.container.classList.toggle("input-collapsed", false);
|
|
337
|
-
this.templateData.container.classList.toggle("markdown-cell-edit-mode", false);
|
|
338
|
-
this.renderedEditors.delete(this.viewCell);
|
|
339
|
-
this.markdownAccessibilityContainer.innerText = "";
|
|
340
|
-
if (this.viewCell.renderedHtml) {
|
|
341
|
-
if (this.accessibilityService.isScreenReaderOptimized()) {
|
|
342
|
-
safeSetInnerHtml(this.markdownAccessibilityContainer, this.viewCell.renderedHtml);
|
|
343
|
-
} else {
|
|
344
|
-
clearNode(this.markdownAccessibilityContainer);
|
|
345
|
-
}
|
|
346
|
-
}
|
|
347
|
-
this.notebookEditor.createMarkupPreview(this.viewCell);
|
|
348
|
-
}
|
|
349
|
-
focusEditorIfNeeded() {
|
|
350
|
-
if (this.viewCell.focusMode === CellFocusMode.Editor && (this.notebookEditor.hasEditorFocus() || getActiveElement(this.notebookEditor.getDomNode().ownerDocument) === getRootContainer(this.notebookEditor.getDomNode()))) {
|
|
351
|
-
if (!this.editor) {
|
|
352
|
-
return;
|
|
353
|
-
}
|
|
354
|
-
this.editor.focus();
|
|
355
|
-
const primarySelection = this.editor.getSelection();
|
|
356
|
-
if (!primarySelection) {
|
|
357
|
-
return;
|
|
358
|
-
}
|
|
359
|
-
this.notebookEditor.revealRangeInViewAsync(this.viewCell, primarySelection);
|
|
360
|
-
}
|
|
361
|
-
}
|
|
362
|
-
layoutEditor(dimension) {
|
|
363
|
-
this.editor?.layout(dimension);
|
|
364
|
-
}
|
|
365
|
-
onCellEditorWidthChange() {
|
|
366
|
-
const realContentHeight = this.editor.getContentHeight();
|
|
367
|
-
this.layoutEditor({
|
|
368
|
-
width: this.viewCell.layoutInfo.editorWidth,
|
|
369
|
-
height: realContentHeight
|
|
370
|
-
});
|
|
371
|
-
}
|
|
372
|
-
relayoutCell() {
|
|
373
|
-
this.notebookEditor.layoutNotebookCell(this.viewCell, this.viewCell.layoutInfo.totalHeight);
|
|
374
|
-
this.layoutFoldingIndicator();
|
|
375
|
-
}
|
|
376
|
-
updateEditorOptions(newValue) {
|
|
377
|
-
this.editorOptions = newValue;
|
|
378
|
-
this.editor?.updateOptions(this.editorOptions);
|
|
379
|
-
}
|
|
380
|
-
layoutFoldingIndicator() {
|
|
381
|
-
switch (this.foldingState) {
|
|
382
|
-
case CellFoldingState.None:
|
|
383
|
-
this.templateData.foldingIndicator.style.display = "none";
|
|
384
|
-
this.templateData.foldingIndicator.innerText = "";
|
|
385
|
-
break;
|
|
386
|
-
case CellFoldingState.Collapsed:
|
|
387
|
-
this.templateData.foldingIndicator.style.display = "";
|
|
388
|
-
reset(this.templateData.foldingIndicator, renderIcon(collapsedIcon));
|
|
389
|
-
break;
|
|
390
|
-
case CellFoldingState.Expanded:
|
|
391
|
-
this.templateData.foldingIndicator.style.display = "";
|
|
392
|
-
reset(this.templateData.foldingIndicator, renderIcon(expandedIcon));
|
|
393
|
-
break;
|
|
394
|
-
}
|
|
395
|
-
}
|
|
396
|
-
bindEditorListeners(editor) {
|
|
397
|
-
this.localDisposables.clear();
|
|
398
|
-
this.focusSwitchDisposable.clear();
|
|
399
|
-
this.localDisposables.add(editor.onDidContentSizeChange(e => {
|
|
400
|
-
if (e.contentHeightChanged) {
|
|
401
|
-
this.onCellEditorHeightChange(editor, e.contentHeight);
|
|
402
|
-
}
|
|
403
|
-
}));
|
|
404
|
-
this.localDisposables.add(editor.onDidChangeCursorSelection(e => {
|
|
405
|
-
if (e.source === "restoreState") {
|
|
406
|
-
return;
|
|
407
|
-
}
|
|
408
|
-
const selections = editor.getSelections();
|
|
409
|
-
if (selections?.length) {
|
|
410
|
-
const contentHeight = editor.getContentHeight();
|
|
411
|
-
const layoutContentHeight = this.viewCell.layoutInfo.editorHeight;
|
|
412
|
-
if (contentHeight !== layoutContentHeight) {
|
|
413
|
-
this.onCellEditorHeightChange(editor, contentHeight);
|
|
414
|
-
}
|
|
415
|
-
const lastSelection = selections[selections.length - 1];
|
|
416
|
-
this.notebookEditor.revealRangeInViewAsync(this.viewCell, lastSelection);
|
|
417
|
-
}
|
|
418
|
-
}));
|
|
419
|
-
const updateFocusMode = () => this.viewCell.focusMode = editor.hasWidgetFocus() ? CellFocusMode.Editor : CellFocusMode.Container;
|
|
420
|
-
this.localDisposables.add(editor.onDidFocusEditorWidget(() => {
|
|
421
|
-
updateFocusMode();
|
|
422
|
-
}));
|
|
423
|
-
this.localDisposables.add(editor.onDidBlurEditorWidget(() => {
|
|
424
|
-
if (getActiveElement(this.templateData.container.ownerDocument)?.contains(this.templateData.container)) {
|
|
425
|
-
this.focusSwitchDisposable.value = disposableTimeout(() => updateFocusMode(), 300);
|
|
426
|
-
} else {
|
|
427
|
-
updateFocusMode();
|
|
428
|
-
}
|
|
429
|
-
}));
|
|
430
|
-
updateFocusMode();
|
|
431
|
-
}
|
|
432
|
-
onCellEditorHeightChange(editor, newHeight) {
|
|
433
|
-
const viewLayout = editor.getLayoutInfo();
|
|
434
|
-
this.viewCell.editorHeight = newHeight;
|
|
435
|
-
editor.layout({
|
|
436
|
-
width: viewLayout.width,
|
|
437
|
-
height: newHeight
|
|
438
|
-
});
|
|
439
|
-
}
|
|
440
|
-
};
|
|
441
|
-
MarkupCell = ( __decorate([( __param(4, IAccessibilityService)), ( __param(5, IContextKeyService)), ( __param(6, IInstantiationService)), ( __param(7, ILanguageService)), ( __param(8, IConfigurationService)), ( __param(9, IKeybindingService))], MarkupCell));
|
|
442
|
-
|
|
443
|
-
export { MarkupCell };
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { IDisposable } from "../../../../../base/common/lifecycle.js";
|
|
2
|
-
import { ICellViewModel } from "../notebookBrowser.js";
|
|
3
|
-
import { INotebookExecutionStateService } from "../../common/notebookExecutionStateService.service.js";
|
|
4
|
-
import { Event } from "../../../../../base/common/event.js";
|
|
5
|
-
import { ScrollEvent } from "../../../../../base/common/scrollable.js";
|
|
6
|
-
import { IConfigurationService } from "../../../../../platform/configuration/common/configuration.service.js";
|
|
7
|
-
import { IListView } from "../../../../../base/browser/ui/list/listView.js";
|
|
8
|
-
import { CellViewModel } from "../viewModel/notebookViewModelImpl.js";
|
|
9
|
-
export declare class NotebookCellAnchor implements IDisposable {
|
|
10
|
-
private readonly notebookExecutionStateService;
|
|
11
|
-
private readonly configurationService;
|
|
12
|
-
private readonly scrollEvent;
|
|
13
|
-
private stopAnchoring;
|
|
14
|
-
private executionWatcher;
|
|
15
|
-
private scrollWatcher;
|
|
16
|
-
constructor(notebookExecutionStateService: INotebookExecutionStateService, configurationService: IConfigurationService, scrollEvent: Event<ScrollEvent>);
|
|
17
|
-
shouldAnchor(cellListView: IListView<CellViewModel>, focusedIndex: number, heightDelta: number, executingCellUri: ICellViewModel): boolean;
|
|
18
|
-
watchAchorDuringExecution(executingCell: ICellViewModel): void;
|
|
19
|
-
dispose(): void;
|
|
20
|
-
}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { CellFocusMode } from '../notebookBrowser.js';
|
|
3
|
-
import { NotebookSetting, CellKind, NotebookCellExecutionState } from '../../common/notebookCommon.js';
|
|
4
|
-
|
|
5
|
-
class NotebookCellAnchor {
|
|
6
|
-
constructor(notebookExecutionStateService, configurationService, scrollEvent) {
|
|
7
|
-
this.notebookExecutionStateService = notebookExecutionStateService;
|
|
8
|
-
this.configurationService = configurationService;
|
|
9
|
-
this.scrollEvent = scrollEvent;
|
|
10
|
-
this.stopAnchoring = false;
|
|
11
|
-
}
|
|
12
|
-
shouldAnchor(cellListView, focusedIndex, heightDelta, executingCellUri) {
|
|
13
|
-
if (cellListView.element(focusedIndex).focusMode === CellFocusMode.Editor) {
|
|
14
|
-
return true;
|
|
15
|
-
}
|
|
16
|
-
if (this.stopAnchoring) {
|
|
17
|
-
return false;
|
|
18
|
-
}
|
|
19
|
-
const newFocusBottom = cellListView.elementTop(focusedIndex) + cellListView.elementHeight(focusedIndex) + heightDelta;
|
|
20
|
-
const viewBottom = cellListView.renderHeight + cellListView.getScrollTop();
|
|
21
|
-
const focusStillVisible = viewBottom > newFocusBottom;
|
|
22
|
-
const allowScrolling = this.configurationService.getValue(NotebookSetting.scrollToRevealCell) !== 'none';
|
|
23
|
-
const growing = heightDelta > 0;
|
|
24
|
-
const autoAnchor = allowScrolling && growing && !focusStillVisible;
|
|
25
|
-
if (autoAnchor) {
|
|
26
|
-
this.watchAchorDuringExecution(executingCellUri);
|
|
27
|
-
return true;
|
|
28
|
-
}
|
|
29
|
-
return false;
|
|
30
|
-
}
|
|
31
|
-
watchAchorDuringExecution(executingCell) {
|
|
32
|
-
if (!this.executionWatcher && executingCell.cellKind === CellKind.Code) {
|
|
33
|
-
const executionState = this.notebookExecutionStateService.getCellExecution(executingCell.uri);
|
|
34
|
-
if (executionState && executionState.state === NotebookCellExecutionState.Executing) {
|
|
35
|
-
this.executionWatcher = executingCell.onDidStopExecution(() => {
|
|
36
|
-
this.executionWatcher?.dispose();
|
|
37
|
-
this.executionWatcher = undefined;
|
|
38
|
-
this.scrollWatcher?.dispose();
|
|
39
|
-
this.stopAnchoring = false;
|
|
40
|
-
});
|
|
41
|
-
this.scrollWatcher = this.scrollEvent((scrollEvent) => {
|
|
42
|
-
if (scrollEvent.scrollTop < scrollEvent.oldScrollTop) {
|
|
43
|
-
this.stopAnchoring = true;
|
|
44
|
-
this.scrollWatcher?.dispose();
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
dispose() {
|
|
51
|
-
this.executionWatcher?.dispose();
|
|
52
|
-
this.scrollWatcher?.dispose();
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
export { NotebookCellAnchor };
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { Disposable } from "../../../../../base/common/lifecycle.js";
|
|
2
|
-
import { ITextModelService } from "../../../../../editor/common/services/resolverService.service.js";
|
|
3
|
-
import { IConfigurationService } from "../../../../../platform/configuration/common/configuration.service.js";
|
|
4
|
-
import { IScopedContextKeyService } from "../../../../../platform/contextkey/common/contextkey.js";
|
|
5
|
-
import { IInstantiationService } from "../../../../../platform/instantiation/common/instantiation.js";
|
|
6
|
-
import { ICellViewModel, INotebookEditorDelegate } from "../notebookBrowser.js";
|
|
7
|
-
export declare class NotebookCellEditorPool extends Disposable {
|
|
8
|
-
readonly notebookEditor: INotebookEditorDelegate;
|
|
9
|
-
private readonly contextKeyServiceProvider;
|
|
10
|
-
private readonly textModelService;
|
|
11
|
-
private readonly _configurationService;
|
|
12
|
-
private readonly _instantiationService;
|
|
13
|
-
private readonly _focusedEditorDOM;
|
|
14
|
-
private readonly _editorDisposable;
|
|
15
|
-
private _editorContextKeyService;
|
|
16
|
-
private _editor;
|
|
17
|
-
private _focusEditorCancellablePromise;
|
|
18
|
-
private _isInitialized;
|
|
19
|
-
private _isDisposed;
|
|
20
|
-
constructor(notebookEditor: INotebookEditorDelegate, contextKeyServiceProvider: (container: HTMLElement) => IScopedContextKeyService, textModelService: ITextModelService, _configurationService: IConfigurationService, _instantiationService: IInstantiationService);
|
|
21
|
-
private _initializeEditor;
|
|
22
|
-
preserveFocusedEditor(cell: ICellViewModel): void;
|
|
23
|
-
dispose(): void;
|
|
24
|
-
}
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { __decorate, __param } from '../../../../../../../../external/tslib/tslib.es6.js';
|
|
3
|
-
import { $, prepend } from '../../../../../base/browser/dom.js';
|
|
4
|
-
import { createCancelablePromise } from '../../../../../base/common/async.js';
|
|
5
|
-
import { Disposable, MutableDisposable, DisposableStore } from '../../../../../base/common/lifecycle.js';
|
|
6
|
-
import { CodeEditorWidget } from '../../../../../editor/browser/widget/codeEditor/codeEditorWidget.js';
|
|
7
|
-
import { EditorContextKeys } from '../../../../../editor/common/editorContextKeys.js';
|
|
8
|
-
import { ITextModelService } from '../../../../../editor/common/services/resolverService.service.js';
|
|
9
|
-
import { IConfigurationService } from '../../../../../platform/configuration/common/configuration.service.js';
|
|
10
|
-
import { IContextKeyService } from '../../../../../platform/contextkey/common/contextkey.service.js';
|
|
11
|
-
import { IInstantiationService } from '../../../../../platform/instantiation/common/instantiation.js';
|
|
12
|
-
import { ServiceCollection } from '../../../../../platform/instantiation/common/serviceCollection.js';
|
|
13
|
-
import { CellFocusMode } from '../notebookBrowser.js';
|
|
14
|
-
import { CellEditorOptions } from './cellParts/cellEditorOptions.js';
|
|
15
|
-
|
|
16
|
-
let NotebookCellEditorPool = class NotebookCellEditorPool extends Disposable {
|
|
17
|
-
constructor(
|
|
18
|
-
notebookEditor,
|
|
19
|
-
contextKeyServiceProvider,
|
|
20
|
-
textModelService,
|
|
21
|
-
_configurationService,
|
|
22
|
-
_instantiationService
|
|
23
|
-
) {
|
|
24
|
-
super();
|
|
25
|
-
this.notebookEditor = notebookEditor;
|
|
26
|
-
this.contextKeyServiceProvider = contextKeyServiceProvider;
|
|
27
|
-
this.textModelService = textModelService;
|
|
28
|
-
this._configurationService = _configurationService;
|
|
29
|
-
this._instantiationService = _instantiationService;
|
|
30
|
-
this._editorDisposable = this._register(( new MutableDisposable()));
|
|
31
|
-
this._isInitialized = false;
|
|
32
|
-
this._isDisposed = false;
|
|
33
|
-
this._focusedEditorDOM = this.notebookEditor.getDomNode().appendChild($(".cell-editor-part-cache"));
|
|
34
|
-
this._focusedEditorDOM.style.position = "absolute";
|
|
35
|
-
this._focusedEditorDOM.style.top = "-50000px";
|
|
36
|
-
this._focusedEditorDOM.style.width = "1px";
|
|
37
|
-
this._focusedEditorDOM.style.height = "1px";
|
|
38
|
-
}
|
|
39
|
-
_initializeEditor(cell) {
|
|
40
|
-
this._editorContextKeyService = this._register(this.contextKeyServiceProvider(this._focusedEditorDOM));
|
|
41
|
-
const editorContainer = prepend(this._focusedEditorDOM, $(".cell-editor-container"));
|
|
42
|
-
const editorInstaService = this._register(this._instantiationService.createChild(( new ServiceCollection([IContextKeyService, this._editorContextKeyService]))));
|
|
43
|
-
EditorContextKeys.inCompositeEditor.bindTo(this._editorContextKeyService).set(true);
|
|
44
|
-
const editorOptions = ( new CellEditorOptions(
|
|
45
|
-
this.notebookEditor.getBaseCellEditorOptions(cell.language),
|
|
46
|
-
this.notebookEditor.notebookOptions,
|
|
47
|
-
this._configurationService
|
|
48
|
-
));
|
|
49
|
-
this._editor = this._register(editorInstaService.createInstance(CodeEditorWidget, editorContainer, {
|
|
50
|
-
...editorOptions.getDefaultValue(),
|
|
51
|
-
dimension: {
|
|
52
|
-
width: 0,
|
|
53
|
-
height: 0
|
|
54
|
-
},
|
|
55
|
-
scrollbar: {
|
|
56
|
-
vertical: "hidden",
|
|
57
|
-
horizontal: "auto",
|
|
58
|
-
handleMouseWheel: false,
|
|
59
|
-
useShadows: false
|
|
60
|
-
},
|
|
61
|
-
allowVariableLineHeights: false
|
|
62
|
-
}, {
|
|
63
|
-
contributions: this.notebookEditor.creationOptions.cellEditorContributions
|
|
64
|
-
}));
|
|
65
|
-
editorOptions.dispose();
|
|
66
|
-
this._isInitialized = true;
|
|
67
|
-
}
|
|
68
|
-
preserveFocusedEditor(cell) {
|
|
69
|
-
if (!this._isInitialized) {
|
|
70
|
-
this._initializeEditor(cell);
|
|
71
|
-
}
|
|
72
|
-
this._editorDisposable.clear();
|
|
73
|
-
this._focusEditorCancellablePromise?.cancel();
|
|
74
|
-
this._focusEditorCancellablePromise = createCancelablePromise(async token => {
|
|
75
|
-
const ref = await this.textModelService.createModelReference(cell.uri);
|
|
76
|
-
if (this._isDisposed || token.isCancellationRequested) {
|
|
77
|
-
ref.dispose();
|
|
78
|
-
return;
|
|
79
|
-
}
|
|
80
|
-
const editorDisposable = ( new DisposableStore());
|
|
81
|
-
editorDisposable.add(ref);
|
|
82
|
-
this._editor.setModel(ref.object.textEditorModel);
|
|
83
|
-
this._editor.setSelections(cell.getSelections());
|
|
84
|
-
this._editor.focus();
|
|
85
|
-
const _update = () => {
|
|
86
|
-
const editorSelections = this._editor.getSelections();
|
|
87
|
-
if (editorSelections) {
|
|
88
|
-
cell.setSelections(editorSelections);
|
|
89
|
-
}
|
|
90
|
-
this.notebookEditor.revealInView(cell);
|
|
91
|
-
this._editor.setModel(null);
|
|
92
|
-
ref.dispose();
|
|
93
|
-
};
|
|
94
|
-
editorDisposable.add(this._editor.onDidChangeModelContent(e => {
|
|
95
|
-
_update();
|
|
96
|
-
}));
|
|
97
|
-
editorDisposable.add(this._editor.onDidChangeCursorSelection(e => {
|
|
98
|
-
if (e.source === "keyboard" || e.source === "mouse") {
|
|
99
|
-
_update();
|
|
100
|
-
}
|
|
101
|
-
}));
|
|
102
|
-
editorDisposable.add(this.notebookEditor.onDidChangeActiveEditor(() => {
|
|
103
|
-
const latestActiveCell = this.notebookEditor.getActiveCell();
|
|
104
|
-
if (latestActiveCell !== cell || latestActiveCell.focusMode !== CellFocusMode.Editor) {
|
|
105
|
-
this._editorDisposable.clear();
|
|
106
|
-
this._editor.setModel(null);
|
|
107
|
-
ref.dispose();
|
|
108
|
-
}
|
|
109
|
-
}));
|
|
110
|
-
this._editorDisposable.value = editorDisposable;
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
|
-
dispose() {
|
|
114
|
-
this._isDisposed = true;
|
|
115
|
-
this._focusEditorCancellablePromise?.cancel();
|
|
116
|
-
super.dispose();
|
|
117
|
-
}
|
|
118
|
-
};
|
|
119
|
-
NotebookCellEditorPool = ( __decorate([( __param(2, ITextModelService)), ( __param(3, IConfigurationService)), ( __param(4, IInstantiationService))], NotebookCellEditorPool));
|
|
120
|
-
|
|
121
|
-
export { NotebookCellEditorPool };
|