@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,480 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { Emitter } from '../../../../../base/common/event.js';
|
|
3
|
-
import { StringSHA1, hash } from '../../../../../base/common/hash.js';
|
|
4
|
-
import { Disposable, DisposableStore, dispose } from '../../../../../base/common/lifecycle.js';
|
|
5
|
-
import { generateUuid } from '../../../../../base/common/uuid.js';
|
|
6
|
-
import { Range } from '../../../../../editor/common/core/range.js';
|
|
7
|
-
import { EndOfLinePreference } from '../../../../../editor/common/model.js';
|
|
8
|
-
import { PieceTreeTextBuffer } from '../../../../../editor/common/model/pieceTreeTextBuffer/pieceTreeTextBuffer.js';
|
|
9
|
-
import { createTextBuffer } from '../../../../../editor/common/model/textModel.js';
|
|
10
|
-
import { PLAINTEXT_LANGUAGE_ID } from '../../../../../editor/common/languages/modesRegistry.js';
|
|
11
|
-
import { NotebookCellOutputTextModel } from './notebookCellOutputTextModel.js';
|
|
12
|
-
import { CellKind } from '../notebookCommon.js';
|
|
13
|
-
import { ThrottledDelayer } from '../../../../../base/common/async.js';
|
|
14
|
-
import { toFormattedString } from '../../../../../base/common/jsonFormatter.js';
|
|
15
|
-
import { splitLines } from '../../../../../base/common/strings.js';
|
|
16
|
-
|
|
17
|
-
class NotebookCellTextModel extends Disposable {
|
|
18
|
-
get outputs() {
|
|
19
|
-
return this._outputs;
|
|
20
|
-
}
|
|
21
|
-
get metadata() {
|
|
22
|
-
return this._metadata;
|
|
23
|
-
}
|
|
24
|
-
set metadata(newMetadata) {
|
|
25
|
-
this._metadata = newMetadata;
|
|
26
|
-
this._hash = null;
|
|
27
|
-
this._onDidChangeMetadata.fire();
|
|
28
|
-
}
|
|
29
|
-
get internalMetadata() {
|
|
30
|
-
return this._internalMetadata;
|
|
31
|
-
}
|
|
32
|
-
set internalMetadata(newInternalMetadata) {
|
|
33
|
-
const lastRunSuccessChanged = this._internalMetadata.lastRunSuccess !== newInternalMetadata.lastRunSuccess;
|
|
34
|
-
newInternalMetadata = {
|
|
35
|
-
...newInternalMetadata,
|
|
36
|
-
...{
|
|
37
|
-
runStartTimeAdjustment: computeRunStartTimeAdjustment(this._internalMetadata, newInternalMetadata)
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
this._internalMetadata = newInternalMetadata;
|
|
41
|
-
this._hash = null;
|
|
42
|
-
this._onDidChangeInternalMetadata.fire({
|
|
43
|
-
lastRunSuccessChanged
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
get language() {
|
|
47
|
-
return this._language;
|
|
48
|
-
}
|
|
49
|
-
set language(newLanguage) {
|
|
50
|
-
if (
|
|
51
|
-
this._textModel && this._textModel.getLanguageId() === this._languageService.getLanguageIdByLanguageName(newLanguage) && this._textModel.getLanguageId() === this._languageService.getLanguageIdByLanguageName(this.language)) {
|
|
52
|
-
return;
|
|
53
|
-
}
|
|
54
|
-
this._hasLanguageSetExplicitly = true;
|
|
55
|
-
this._setLanguageInternal(newLanguage);
|
|
56
|
-
}
|
|
57
|
-
get mime() {
|
|
58
|
-
return this._mime;
|
|
59
|
-
}
|
|
60
|
-
set mime(newMime) {
|
|
61
|
-
if (this._mime === newMime) {
|
|
62
|
-
return;
|
|
63
|
-
}
|
|
64
|
-
this._mime = newMime;
|
|
65
|
-
this._hash = null;
|
|
66
|
-
this._onDidChangeContent.fire("mime");
|
|
67
|
-
}
|
|
68
|
-
get textBuffer() {
|
|
69
|
-
if (this._textBuffer) {
|
|
70
|
-
return this._textBuffer;
|
|
71
|
-
}
|
|
72
|
-
this._textBuffer = this._register(createTextBuffer(this._source, this._defaultEOL).textBuffer);
|
|
73
|
-
this._register(this._textBuffer.onDidChangeContent(() => {
|
|
74
|
-
this._hash = null;
|
|
75
|
-
if (!this._textModel) {
|
|
76
|
-
this._onDidChangeContent.fire("content");
|
|
77
|
-
}
|
|
78
|
-
this.autoDetectLanguage();
|
|
79
|
-
}));
|
|
80
|
-
return this._textBuffer;
|
|
81
|
-
}
|
|
82
|
-
get alternativeId() {
|
|
83
|
-
return this._alternativeId;
|
|
84
|
-
}
|
|
85
|
-
get textModel() {
|
|
86
|
-
return this._textModel;
|
|
87
|
-
}
|
|
88
|
-
set textModel(m) {
|
|
89
|
-
if (this._textModel === m) {
|
|
90
|
-
return;
|
|
91
|
-
}
|
|
92
|
-
this._textModelDisposables.clear();
|
|
93
|
-
this._textModel = m;
|
|
94
|
-
if (this._textModel) {
|
|
95
|
-
this.setRegisteredLanguage(this._languageService, this._textModel.getLanguageId(), this.language);
|
|
96
|
-
this._textModelDisposables.add(this._textModel.onDidChangeLanguage(
|
|
97
|
-
e => this.setRegisteredLanguage(this._languageService, e.newLanguage, this.language)
|
|
98
|
-
));
|
|
99
|
-
this._textModelDisposables.add(this._textModel.onWillDispose(() => this.textModel = undefined));
|
|
100
|
-
this._textModelDisposables.add(this._textModel.onDidChangeContent(e => {
|
|
101
|
-
if (this._textModel) {
|
|
102
|
-
this._versionId = this._textModel.getVersionId();
|
|
103
|
-
this._alternativeId = this._textModel.getAlternativeVersionId();
|
|
104
|
-
}
|
|
105
|
-
this._textBufferHash = null;
|
|
106
|
-
this._onDidChangeContent.fire("content");
|
|
107
|
-
this._onDidChangeContent.fire({
|
|
108
|
-
type: "model",
|
|
109
|
-
event: e
|
|
110
|
-
});
|
|
111
|
-
}));
|
|
112
|
-
this._textModel._overwriteVersionId(this._versionId);
|
|
113
|
-
this._textModel._overwriteAlternativeVersionId(this._versionId);
|
|
114
|
-
this._onDidChangeTextModel.fire();
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
setRegisteredLanguage(languageService, newLanguage, currentLanguage) {
|
|
118
|
-
const isFallBackLanguage = (newLanguage === PLAINTEXT_LANGUAGE_ID || newLanguage === "jupyter");
|
|
119
|
-
if (!languageService.isRegisteredLanguageId(currentLanguage) && isFallBackLanguage) {
|
|
120
|
-
this._onDidChangeLanguage.fire(currentLanguage);
|
|
121
|
-
} else {
|
|
122
|
-
this.language = newLanguage;
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
static {
|
|
126
|
-
this.AUTO_DETECT_LANGUAGE_THROTTLE_DELAY = 600;
|
|
127
|
-
}
|
|
128
|
-
get hasLanguageSetExplicitly() {
|
|
129
|
-
return this._hasLanguageSetExplicitly;
|
|
130
|
-
}
|
|
131
|
-
constructor(
|
|
132
|
-
uri,
|
|
133
|
-
handle,
|
|
134
|
-
cell,
|
|
135
|
-
transientOptions,
|
|
136
|
-
_languageService,
|
|
137
|
-
_defaultEOL,
|
|
138
|
-
defaultCollapseConfig,
|
|
139
|
-
_languageDetectionService = undefined,
|
|
140
|
-
_notebookLoggingService
|
|
141
|
-
) {
|
|
142
|
-
super();
|
|
143
|
-
this.uri = uri;
|
|
144
|
-
this.handle = handle;
|
|
145
|
-
this.transientOptions = transientOptions;
|
|
146
|
-
this._languageService = _languageService;
|
|
147
|
-
this._defaultEOL = _defaultEOL;
|
|
148
|
-
this._languageDetectionService = _languageDetectionService;
|
|
149
|
-
this._notebookLoggingService = _notebookLoggingService;
|
|
150
|
-
this._onDidChangeTextModel = this._register(( new Emitter()));
|
|
151
|
-
this.onDidChangeTextModel = this._onDidChangeTextModel.event;
|
|
152
|
-
this._onDidChangeOutputs = this._register(( new Emitter()));
|
|
153
|
-
this.onDidChangeOutputs = this._onDidChangeOutputs.event;
|
|
154
|
-
this._onDidChangeOutputItems = this._register(( new Emitter()));
|
|
155
|
-
this.onDidChangeOutputItems = this._onDidChangeOutputItems.event;
|
|
156
|
-
this._onDidChangeContent = this._register(( new Emitter()));
|
|
157
|
-
this.onDidChangeContent = this._onDidChangeContent.event;
|
|
158
|
-
this._onDidChangeMetadata = this._register(( new Emitter()));
|
|
159
|
-
this.onDidChangeMetadata = this._onDidChangeMetadata.event;
|
|
160
|
-
this._onDidChangeInternalMetadata = this._register(( new Emitter()));
|
|
161
|
-
this.onDidChangeInternalMetadata = this._onDidChangeInternalMetadata.event;
|
|
162
|
-
this._onDidChangeLanguage = this._register(( new Emitter()));
|
|
163
|
-
this.onDidChangeLanguage = this._onDidChangeLanguage.event;
|
|
164
|
-
this._textBufferHash = null;
|
|
165
|
-
this._hash = null;
|
|
166
|
-
this._versionId = 1;
|
|
167
|
-
this._alternativeId = 1;
|
|
168
|
-
this._textModelDisposables = this._register(( new DisposableStore()));
|
|
169
|
-
this._textModel = undefined;
|
|
170
|
-
this.autoDetectLanguageThrottler = this._register(( new ThrottledDelayer(NotebookCellTextModel.AUTO_DETECT_LANGUAGE_THROTTLE_DELAY)));
|
|
171
|
-
this._autoLanguageDetectionEnabled = false;
|
|
172
|
-
this._hasLanguageSetExplicitly = false;
|
|
173
|
-
this._source = cell.source;
|
|
174
|
-
this._language = cell.language;
|
|
175
|
-
this._mime = cell.mime;
|
|
176
|
-
this.cellKind = cell.cellKind;
|
|
177
|
-
const defaultConfig = cell.cellKind === CellKind.Code ? defaultCollapseConfig?.codeCell : defaultCollapseConfig?.markupCell;
|
|
178
|
-
this.collapseState = cell.collapseState ?? (defaultConfig ?? undefined);
|
|
179
|
-
this._outputs = ( cell.outputs.map(op => ( new NotebookCellOutputTextModel(op))));
|
|
180
|
-
this._metadata = cell.metadata ?? {};
|
|
181
|
-
this._internalMetadata = cell.internalMetadata ?? {};
|
|
182
|
-
}
|
|
183
|
-
enableAutoLanguageDetection() {
|
|
184
|
-
this._autoLanguageDetectionEnabled = true;
|
|
185
|
-
this.autoDetectLanguage();
|
|
186
|
-
}
|
|
187
|
-
async autoDetectLanguage() {
|
|
188
|
-
if (this._autoLanguageDetectionEnabled) {
|
|
189
|
-
this.autoDetectLanguageThrottler.trigger(() => this._doAutoDetectLanguage());
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
async _doAutoDetectLanguage() {
|
|
193
|
-
if (this.hasLanguageSetExplicitly) {
|
|
194
|
-
return;
|
|
195
|
-
}
|
|
196
|
-
const newLanguage = await this._languageDetectionService?.detectLanguage(this.uri);
|
|
197
|
-
if (!newLanguage) {
|
|
198
|
-
return;
|
|
199
|
-
}
|
|
200
|
-
if (this._textModel && this._textModel.getLanguageId() === this._languageService.getLanguageIdByLanguageName(newLanguage) && this._textModel.getLanguageId() === this._languageService.getLanguageIdByLanguageName(this.language)) {
|
|
201
|
-
return;
|
|
202
|
-
}
|
|
203
|
-
this._setLanguageInternal(newLanguage);
|
|
204
|
-
}
|
|
205
|
-
_setLanguageInternal(newLanguage) {
|
|
206
|
-
const newLanguageId = this._languageService.getLanguageIdByLanguageName(newLanguage);
|
|
207
|
-
if (newLanguageId === null) {
|
|
208
|
-
return;
|
|
209
|
-
}
|
|
210
|
-
if (this._textModel) {
|
|
211
|
-
const languageId = this._languageService.createById(newLanguageId);
|
|
212
|
-
this._textModel.setLanguage(languageId.languageId);
|
|
213
|
-
}
|
|
214
|
-
if (this._language === newLanguage) {
|
|
215
|
-
return;
|
|
216
|
-
}
|
|
217
|
-
this._language = newLanguage;
|
|
218
|
-
this._hash = null;
|
|
219
|
-
this._onDidChangeLanguage.fire(newLanguage);
|
|
220
|
-
this._onDidChangeContent.fire("language");
|
|
221
|
-
}
|
|
222
|
-
resetTextBuffer(textBuffer) {
|
|
223
|
-
this._textBuffer = textBuffer;
|
|
224
|
-
}
|
|
225
|
-
getValue() {
|
|
226
|
-
const fullRange = this.getFullModelRange();
|
|
227
|
-
const eol = this.textBuffer.getEOL();
|
|
228
|
-
if (eol === "\n") {
|
|
229
|
-
return this.textBuffer.getValueInRange(fullRange, EndOfLinePreference.LF);
|
|
230
|
-
} else {
|
|
231
|
-
return this.textBuffer.getValueInRange(fullRange, EndOfLinePreference.CRLF);
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
getTextBufferHash() {
|
|
235
|
-
if (this._textBufferHash !== null) {
|
|
236
|
-
return this._textBufferHash;
|
|
237
|
-
}
|
|
238
|
-
const shaComputer = ( new StringSHA1());
|
|
239
|
-
const snapshot = this.textBuffer.createSnapshot(false);
|
|
240
|
-
let text;
|
|
241
|
-
while ((text = snapshot.read())) {
|
|
242
|
-
shaComputer.update(text);
|
|
243
|
-
}
|
|
244
|
-
this._textBufferHash = shaComputer.digest();
|
|
245
|
-
return this._textBufferHash;
|
|
246
|
-
}
|
|
247
|
-
getHashValue() {
|
|
248
|
-
if (this._hash !== null) {
|
|
249
|
-
return this._hash;
|
|
250
|
-
}
|
|
251
|
-
this._hash = hash([
|
|
252
|
-
hash(this.language),
|
|
253
|
-
this.getTextBufferHash(),
|
|
254
|
-
this._getPersisentMetadata(),
|
|
255
|
-
this.transientOptions.transientOutputs ? [] : ( this._outputs.map(op => ({
|
|
256
|
-
outputs: ( op.outputs.map(output => ({
|
|
257
|
-
mime: output.mime,
|
|
258
|
-
data: Array.from(output.data.buffer)
|
|
259
|
-
}))),
|
|
260
|
-
metadata: op.metadata
|
|
261
|
-
})))
|
|
262
|
-
]);
|
|
263
|
-
return this._hash;
|
|
264
|
-
}
|
|
265
|
-
_getPersisentMetadata() {
|
|
266
|
-
return getFormattedMetadataJSON(this.transientOptions.transientCellMetadata, this.metadata, this.language);
|
|
267
|
-
}
|
|
268
|
-
getTextLength() {
|
|
269
|
-
return this.textBuffer.getLength();
|
|
270
|
-
}
|
|
271
|
-
getFullModelRange() {
|
|
272
|
-
const lineCount = this.textBuffer.getLineCount();
|
|
273
|
-
return ( new Range(1, 1, lineCount, this.textBuffer.getLineLength(lineCount) + 1));
|
|
274
|
-
}
|
|
275
|
-
spliceNotebookCellOutputs(splice) {
|
|
276
|
-
this._notebookLoggingService.trace(
|
|
277
|
-
"textModelEdits",
|
|
278
|
-
`splicing outputs at ${splice.start} length: ${splice.deleteCount} with ${splice.newOutputs.length} new outputs`
|
|
279
|
-
);
|
|
280
|
-
if (splice.deleteCount > 0 && splice.newOutputs.length > 0) {
|
|
281
|
-
const commonLen = Math.min(splice.deleteCount, splice.newOutputs.length);
|
|
282
|
-
for (let i = 0; i < commonLen; i++) {
|
|
283
|
-
const currentOutput = this.outputs[splice.start + i];
|
|
284
|
-
const newOutput = splice.newOutputs[i];
|
|
285
|
-
this.replaceOutput(currentOutput.outputId, newOutput);
|
|
286
|
-
}
|
|
287
|
-
const removed = this.outputs.splice(
|
|
288
|
-
splice.start + commonLen,
|
|
289
|
-
splice.deleteCount - commonLen,
|
|
290
|
-
...splice.newOutputs.slice(commonLen)
|
|
291
|
-
);
|
|
292
|
-
removed.forEach(output => output.dispose());
|
|
293
|
-
this._onDidChangeOutputs.fire({
|
|
294
|
-
start: splice.start + commonLen,
|
|
295
|
-
deleteCount: splice.deleteCount - commonLen,
|
|
296
|
-
newOutputs: splice.newOutputs.slice(commonLen)
|
|
297
|
-
});
|
|
298
|
-
} else {
|
|
299
|
-
const removed = this.outputs.splice(splice.start, splice.deleteCount, ...splice.newOutputs);
|
|
300
|
-
removed.forEach(output => output.dispose());
|
|
301
|
-
this._onDidChangeOutputs.fire(splice);
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
replaceOutput(outputId, newOutputItem) {
|
|
305
|
-
const outputIndex = this.outputs.findIndex(output => output.outputId === outputId);
|
|
306
|
-
if (outputIndex < 0) {
|
|
307
|
-
return false;
|
|
308
|
-
}
|
|
309
|
-
this._notebookLoggingService.trace("textModelEdits", `replacing an output item at index ${outputIndex}`);
|
|
310
|
-
const output = this.outputs[outputIndex];
|
|
311
|
-
output.replaceData({
|
|
312
|
-
outputs: newOutputItem.outputs,
|
|
313
|
-
outputId: newOutputItem.outputId,
|
|
314
|
-
metadata: newOutputItem.metadata
|
|
315
|
-
});
|
|
316
|
-
newOutputItem.dispose();
|
|
317
|
-
this._onDidChangeOutputItems.fire();
|
|
318
|
-
return true;
|
|
319
|
-
}
|
|
320
|
-
changeOutputItems(outputId, append, items) {
|
|
321
|
-
const outputIndex = this.outputs.findIndex(output => output.outputId === outputId);
|
|
322
|
-
if (outputIndex < 0) {
|
|
323
|
-
return false;
|
|
324
|
-
}
|
|
325
|
-
const output = this.outputs[outputIndex];
|
|
326
|
-
this._notebookLoggingService.trace(
|
|
327
|
-
"textModelEdits",
|
|
328
|
-
`${append ? "appending" : "replacing"} ${items.length} output items to for output index ${outputIndex}`
|
|
329
|
-
);
|
|
330
|
-
if (append) {
|
|
331
|
-
output.appendData(items);
|
|
332
|
-
} else {
|
|
333
|
-
output.replaceData({
|
|
334
|
-
outputId: outputId,
|
|
335
|
-
outputs: items,
|
|
336
|
-
metadata: output.metadata
|
|
337
|
-
});
|
|
338
|
-
}
|
|
339
|
-
this._onDidChangeOutputItems.fire();
|
|
340
|
-
return true;
|
|
341
|
-
}
|
|
342
|
-
_outputNotEqualFastCheck(left, right) {
|
|
343
|
-
if (left.length !== right.length) {
|
|
344
|
-
return false;
|
|
345
|
-
}
|
|
346
|
-
for (let i = 0; i < this.outputs.length; i++) {
|
|
347
|
-
const l = left[i];
|
|
348
|
-
const r = right[i];
|
|
349
|
-
if (l.outputs.length !== r.outputs.length) {
|
|
350
|
-
return false;
|
|
351
|
-
}
|
|
352
|
-
for (let k = 0; k < l.outputs.length; k++) {
|
|
353
|
-
if (l.outputs[k].mime !== r.outputs[k].mime) {
|
|
354
|
-
return false;
|
|
355
|
-
}
|
|
356
|
-
if (l.outputs[k].data.byteLength !== r.outputs[k].data.byteLength) {
|
|
357
|
-
return false;
|
|
358
|
-
}
|
|
359
|
-
}
|
|
360
|
-
}
|
|
361
|
-
return true;
|
|
362
|
-
}
|
|
363
|
-
equal(b) {
|
|
364
|
-
if (this.language !== b.language) {
|
|
365
|
-
return false;
|
|
366
|
-
}
|
|
367
|
-
if (this.outputs.length !== b.outputs.length) {
|
|
368
|
-
return false;
|
|
369
|
-
}
|
|
370
|
-
if (this.getTextLength() !== b.getTextLength()) {
|
|
371
|
-
return false;
|
|
372
|
-
}
|
|
373
|
-
if (!this.transientOptions.transientOutputs) {
|
|
374
|
-
if (!this._outputNotEqualFastCheck(this.outputs, b.outputs)) {
|
|
375
|
-
return false;
|
|
376
|
-
}
|
|
377
|
-
}
|
|
378
|
-
return this.getHashValue() === b.getHashValue();
|
|
379
|
-
}
|
|
380
|
-
fastEqual(b, ignoreMetadata) {
|
|
381
|
-
if (this.language !== b.language) {
|
|
382
|
-
return false;
|
|
383
|
-
}
|
|
384
|
-
if (this.mime !== b.mime) {
|
|
385
|
-
return false;
|
|
386
|
-
}
|
|
387
|
-
if (this.cellKind !== b.cellKind) {
|
|
388
|
-
return false;
|
|
389
|
-
}
|
|
390
|
-
if (!ignoreMetadata) {
|
|
391
|
-
if (this.internalMetadata?.executionOrder !== b.internalMetadata?.executionOrder || this.internalMetadata?.lastRunSuccess !== b.internalMetadata?.lastRunSuccess || this.internalMetadata?.runStartTime !== b.internalMetadata?.runStartTime || this.internalMetadata?.runStartTimeAdjustment !== b.internalMetadata?.runStartTimeAdjustment || this.internalMetadata?.runEndTime !== b.internalMetadata?.runEndTime) {
|
|
392
|
-
return false;
|
|
393
|
-
}
|
|
394
|
-
}
|
|
395
|
-
if (this._textBuffer) {
|
|
396
|
-
if (!NotebookCellTextModel.linesAreEqual(this.textBuffer.getLinesContent(), b.source)) {
|
|
397
|
-
return false;
|
|
398
|
-
}
|
|
399
|
-
} else if (this._source !== b.source) {
|
|
400
|
-
return false;
|
|
401
|
-
}
|
|
402
|
-
return true;
|
|
403
|
-
}
|
|
404
|
-
static linesAreEqual(aLines, b) {
|
|
405
|
-
const bLines = splitLines(b);
|
|
406
|
-
if (aLines.length !== bLines.length) {
|
|
407
|
-
return false;
|
|
408
|
-
}
|
|
409
|
-
for (let i = 0; i < aLines.length; i++) {
|
|
410
|
-
if (aLines[i] !== bLines[i]) {
|
|
411
|
-
return false;
|
|
412
|
-
}
|
|
413
|
-
}
|
|
414
|
-
return true;
|
|
415
|
-
}
|
|
416
|
-
dispose() {
|
|
417
|
-
dispose(this._outputs);
|
|
418
|
-
const emptyDisposedTextBuffer = ( new PieceTreeTextBuffer([], "", "\n", false, false, true, true));
|
|
419
|
-
emptyDisposedTextBuffer.dispose();
|
|
420
|
-
this._textBuffer = emptyDisposedTextBuffer;
|
|
421
|
-
super.dispose();
|
|
422
|
-
}
|
|
423
|
-
}
|
|
424
|
-
function cloneNotebookCellTextModel(cell) {
|
|
425
|
-
return {
|
|
426
|
-
source: cell.getValue(),
|
|
427
|
-
language: cell.language,
|
|
428
|
-
mime: cell.mime,
|
|
429
|
-
cellKind: cell.cellKind,
|
|
430
|
-
outputs: ( cell.outputs.map(output => ({
|
|
431
|
-
outputs: output.outputs,
|
|
432
|
-
outputId: generateUuid()
|
|
433
|
-
}))),
|
|
434
|
-
metadata: {}
|
|
435
|
-
};
|
|
436
|
-
}
|
|
437
|
-
function computeRunStartTimeAdjustment(oldMetadata, newMetadata) {
|
|
438
|
-
if (oldMetadata.runStartTime !== newMetadata.runStartTime && typeof newMetadata.runStartTime === "number") {
|
|
439
|
-
const offset = Date.now() - newMetadata.runStartTime;
|
|
440
|
-
return offset < 0 ? Math.abs(offset) : 0;
|
|
441
|
-
} else {
|
|
442
|
-
return newMetadata.runStartTimeAdjustment;
|
|
443
|
-
}
|
|
444
|
-
}
|
|
445
|
-
function getFormattedMetadataJSON(transientCellMetadata, metadata, language, sortKeys) {
|
|
446
|
-
let filteredMetadata = {};
|
|
447
|
-
if (transientCellMetadata) {
|
|
448
|
-
const keys = ( new Set([...( Object.keys(metadata))]));
|
|
449
|
-
for (const key of keys) {
|
|
450
|
-
if (!(transientCellMetadata[key])) {
|
|
451
|
-
filteredMetadata[key] = metadata[key];
|
|
452
|
-
}
|
|
453
|
-
}
|
|
454
|
-
} else {
|
|
455
|
-
filteredMetadata = metadata;
|
|
456
|
-
}
|
|
457
|
-
const obj = {
|
|
458
|
-
language,
|
|
459
|
-
...filteredMetadata
|
|
460
|
-
};
|
|
461
|
-
if (language) {
|
|
462
|
-
obj.language = language;
|
|
463
|
-
}
|
|
464
|
-
const metadataSource = toFormattedString(sortKeys ? sortObjectPropertiesRecursively(obj) : obj, {});
|
|
465
|
-
return metadataSource;
|
|
466
|
-
}
|
|
467
|
-
function sortObjectPropertiesRecursively(obj) {
|
|
468
|
-
if (Array.isArray(obj)) {
|
|
469
|
-
return ( obj.map(sortObjectPropertiesRecursively));
|
|
470
|
-
}
|
|
471
|
-
if (obj !== undefined && obj !== null && typeof obj === "object" && ( Object.keys(obj)).length > 0) {
|
|
472
|
-
return (( Object.keys(obj)).sort().reduce((sortedObj, prop) => {
|
|
473
|
-
sortedObj[prop] = sortObjectPropertiesRecursively(obj[prop]);
|
|
474
|
-
return sortedObj;
|
|
475
|
-
}, {}));
|
|
476
|
-
}
|
|
477
|
-
return obj;
|
|
478
|
-
}
|
|
479
|
-
|
|
480
|
-
export { NotebookCellTextModel, cloneNotebookCellTextModel, getFormattedMetadataJSON, sortObjectPropertiesRecursively };
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import { VSBufferReadableStream } from "../../../../base/common/buffer.js";
|
|
2
|
-
import { CancellationToken } from "../../../../base/common/cancellation.js";
|
|
3
|
-
import { Event } from "../../../../base/common/event.js";
|
|
4
|
-
import { IMarkdownString } from "../../../../base/common/htmlContent.js";
|
|
5
|
-
import { Disposable } from "../../../../base/common/lifecycle.js";
|
|
6
|
-
import { URI } from "../../../../base/common/uri.js";
|
|
7
|
-
import { IConfigurationService } from "../../../../platform/configuration/common/configuration.service.js";
|
|
8
|
-
import { IWriteFileOptions, IFileStatWithMetadata } from "../../../../platform/files/common/files.js";
|
|
9
|
-
import { ITelemetryService } from "../../../../platform/telemetry/common/telemetry.service.js";
|
|
10
|
-
import { IRevertOptions, ISaveOptions, IUntypedEditorInput } from "../../../common/editor.js";
|
|
11
|
-
import { EditorModel } from "../../../common/editor/editorModel.js";
|
|
12
|
-
import { NotebookTextModel } from "@codingame/monaco-vscode-notebook-service-override/vscode/vs/workbench/contrib/notebook/common/model/notebookTextModel";
|
|
13
|
-
import { INotebookEditorModel, INotebookLoadOptions, IResolvedNotebookEditorModel } from "./notebookCommon.js";
|
|
14
|
-
import { INotebookLoggingService } from "./notebookLoggingService.service.js";
|
|
15
|
-
import { INotebookSerializer } from "./notebookService.js";
|
|
16
|
-
import { INotebookService } from "./notebookService.service.js";
|
|
17
|
-
import { IFilesConfigurationService } from "../../../services/filesConfiguration/common/filesConfigurationService.service.js";
|
|
18
|
-
import { IFileWorkingCopyModelConfiguration, SnapshotContext } from "../../../services/workingCopy/common/fileWorkingCopy.js";
|
|
19
|
-
import { IFileWorkingCopyManager } from "@codingame/monaco-vscode-notebook-service-override/vscode/vs/workbench/services/workingCopy/common/fileWorkingCopyManager";
|
|
20
|
-
import { IStoredFileWorkingCopyModel, IStoredFileWorkingCopyModelContentChangedEvent, IStoredFileWorkingCopyModelFactory, IStoredFileWorkingCopySaveEvent } from "../../../services/workingCopy/common/storedFileWorkingCopy.js";
|
|
21
|
-
import { IUntitledFileWorkingCopyModel, IUntitledFileWorkingCopyModelContentChangedEvent, IUntitledFileWorkingCopyModelFactory } from "@codingame/monaco-vscode-notebook-service-override/vscode/vs/workbench/services/workingCopy/common/untitledFileWorkingCopy";
|
|
22
|
-
export declare class SimpleNotebookEditorModel extends EditorModel implements INotebookEditorModel {
|
|
23
|
-
readonly resource: URI;
|
|
24
|
-
private readonly _hasAssociatedFilePath;
|
|
25
|
-
readonly viewType: string;
|
|
26
|
-
private readonly _workingCopyManager;
|
|
27
|
-
private readonly _filesConfigurationService;
|
|
28
|
-
private readonly _onDidChangeDirty;
|
|
29
|
-
private readonly _onDidSave;
|
|
30
|
-
private readonly _onDidChangeOrphaned;
|
|
31
|
-
private readonly _onDidChangeReadonly;
|
|
32
|
-
private readonly _onDidRevertUntitled;
|
|
33
|
-
readonly onDidChangeDirty: Event<void>;
|
|
34
|
-
readonly onDidSave: Event<IStoredFileWorkingCopySaveEvent>;
|
|
35
|
-
readonly onDidChangeOrphaned: Event<void>;
|
|
36
|
-
readonly onDidChangeReadonly: Event<void>;
|
|
37
|
-
readonly onDidRevertUntitled: Event<void>;
|
|
38
|
-
private _workingCopy?;
|
|
39
|
-
private readonly _workingCopyListeners;
|
|
40
|
-
private readonly scratchPad;
|
|
41
|
-
constructor(resource: URI, _hasAssociatedFilePath: boolean, viewType: string, _workingCopyManager: IFileWorkingCopyManager<NotebookFileWorkingCopyModel, NotebookFileWorkingCopyModel>, scratchpad: boolean, _filesConfigurationService: IFilesConfigurationService);
|
|
42
|
-
dispose(): void;
|
|
43
|
-
get notebook(): NotebookTextModel | undefined;
|
|
44
|
-
isResolved(): this is IResolvedNotebookEditorModel;
|
|
45
|
-
canDispose(): Promise<boolean>;
|
|
46
|
-
isDirty(): boolean;
|
|
47
|
-
isModified(): boolean;
|
|
48
|
-
isOrphaned(): boolean;
|
|
49
|
-
hasAssociatedFilePath(): boolean;
|
|
50
|
-
isReadonly(): boolean | IMarkdownString;
|
|
51
|
-
get hasErrorState(): boolean;
|
|
52
|
-
revert(options?: IRevertOptions): Promise<void>;
|
|
53
|
-
save(options?: ISaveOptions): Promise<boolean>;
|
|
54
|
-
load(options?: INotebookLoadOptions): Promise<IResolvedNotebookEditorModel>;
|
|
55
|
-
saveAs(target: URI): Promise<IUntypedEditorInput | undefined>;
|
|
56
|
-
private static _isStoredFileWorkingCopy;
|
|
57
|
-
}
|
|
58
|
-
export declare class NotebookFileWorkingCopyModel extends Disposable implements IStoredFileWorkingCopyModel, IUntitledFileWorkingCopyModel {
|
|
59
|
-
private readonly _notebookModel;
|
|
60
|
-
private readonly _notebookService;
|
|
61
|
-
private readonly _configurationService;
|
|
62
|
-
private readonly _telemetryService;
|
|
63
|
-
private readonly _notebookLogService;
|
|
64
|
-
private readonly _onDidChangeContent;
|
|
65
|
-
readonly onDidChangeContent: Event<IStoredFileWorkingCopyModelContentChangedEvent & IUntitledFileWorkingCopyModelContentChangedEvent>;
|
|
66
|
-
readonly onWillDispose: Event<void>;
|
|
67
|
-
readonly configuration: IFileWorkingCopyModelConfiguration | undefined;
|
|
68
|
-
save: ((options: IWriteFileOptions, token: CancellationToken) => Promise<IFileStatWithMetadata>) | undefined;
|
|
69
|
-
constructor(_notebookModel: NotebookTextModel, _notebookService: INotebookService, _configurationService: IConfigurationService, _telemetryService: ITelemetryService, _notebookLogService: INotebookLoggingService);
|
|
70
|
-
private setSaveDelegate;
|
|
71
|
-
dispose(): void;
|
|
72
|
-
get notebookModel(): NotebookTextModel;
|
|
73
|
-
snapshot(context: SnapshotContext, token: CancellationToken): Promise<VSBufferReadableStream>;
|
|
74
|
-
update(stream: VSBufferReadableStream, token: CancellationToken): Promise<void>;
|
|
75
|
-
getNotebookSerializer(): Promise<INotebookSerializer>;
|
|
76
|
-
get versionId(): string;
|
|
77
|
-
pushStackElement(): void;
|
|
78
|
-
}
|
|
79
|
-
export declare class NotebookFileWorkingCopyModelFactory implements IStoredFileWorkingCopyModelFactory<NotebookFileWorkingCopyModel>, IUntitledFileWorkingCopyModelFactory<NotebookFileWorkingCopyModel> {
|
|
80
|
-
private readonly _viewType;
|
|
81
|
-
private readonly _notebookService;
|
|
82
|
-
private readonly _configurationService;
|
|
83
|
-
private readonly _telemetryService;
|
|
84
|
-
private readonly _notebookLogService;
|
|
85
|
-
constructor(_viewType: string, _notebookService: INotebookService, _configurationService: IConfigurationService, _telemetryService: ITelemetryService, _notebookLogService: INotebookLoggingService);
|
|
86
|
-
createModel(resource: URI, stream: VSBufferReadableStream, token: CancellationToken): Promise<NotebookFileWorkingCopyModel>;
|
|
87
|
-
}
|