@codingame/monaco-vscode-api 29.1.0 → 30.0.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 +39 -16
- package/package.json +8 -8
- package/services.js +3 -3
- package/vscode/src/vs/base/browser/ui/codicons/codicon/codicon.ttf +0 -0
- package/vscode/src/vs/base/browser/ui/contextview/contextview.js +5 -5
- package/vscode/src/vs/base/browser/ui/dialog/dialog.js +6 -2
- package/vscode/src/vs/base/browser/ui/toolbar/toolbar.d.ts +19 -7
- package/vscode/src/vs/base/browser/ui/toolbar/toolbar.js +81 -15
- package/vscode/src/vs/base/common/codicons.d.ts +4 -0
- package/vscode/src/vs/base/common/codicons.js +3 -1
- package/vscode/src/vs/base/common/glob.js +5 -1
- package/vscode/src/vs/base/common/performance.d.ts +4 -0
- package/vscode/src/vs/base/common/performance.js +40 -17
- package/vscode/src/vs/editor/contrib/dropOrPasteInto/browser/copyPasteController.js +1 -1
- package/vscode/src/vs/editor/contrib/quickAccess/browser/gotoSymbolQuickAccess.d.ts +2 -1
- package/vscode/src/vs/editor/contrib/quickAccess/browser/gotoSymbolQuickAccess.js +4 -0
- package/vscode/src/vs/platform/actionWidget/browser/actionList.d.ts +13 -0
- package/vscode/src/vs/platform/actionWidget/browser/actionList.js +106 -74
- package/vscode/src/vs/platform/actionWidget/browser/actionWidget.css +14 -11
- package/vscode/src/vs/platform/actions/common/actions.d.ts +3 -0
- package/vscode/src/vs/platform/actions/common/actions.js +9 -0
- package/vscode/src/vs/platform/browserView/common/browserView.d.ts +34 -7
- package/vscode/src/vs/platform/editor/common/editor.d.ts +29 -4
- package/vscode/src/vs/platform/environment/common/argv.d.ts +1 -0
- package/vscode/src/vs/platform/environment/common/environmentService.d.ts +1 -0
- package/vscode/src/vs/platform/extensions/common/extensions.d.ts +1 -0
- package/vscode/src/vs/platform/extensions/common/extensionsApiProposals.d.ts +3 -0
- package/vscode/src/vs/platform/extensions/common/extensionsApiProposals.js +3 -0
- package/vscode/src/vs/platform/keyboardLayout/common/keyboardLayout.js +2 -2
- package/vscode/src/vs/platform/label/common/label.d.ts +6 -0
- package/vscode/src/vs/platform/product/common/product.js +3 -3
- package/vscode/src/vs/platform/quickinput/browser/pickerQuickAccess.d.ts +11 -2
- package/vscode/src/vs/platform/quickinput/browser/pickerQuickAccess.js +6 -0
- package/vscode/src/vs/platform/quickinput/browser/quickInputActions.js +14 -1
- package/vscode/src/vs/platform/quickinput/browser/quickInputController.js +6 -2
- package/vscode/src/vs/platform/quickinput/common/quickInput.d.ts +5 -3
- package/vscode/src/vs/platform/quickinput/common/quickInput.js +6 -2
- package/vscode/src/vs/platform/sandbox/common/sandboxHelperService.d.ts +4 -0
- package/vscode/src/vs/platform/sandbox/common/sandboxHelperService.service.d.ts +6 -0
- package/vscode/src/vs/platform/sandbox/common/sandboxHelperService.service.js +6 -0
- package/vscode/src/vs/platform/terminal/common/terminal.d.ts +3 -1
- package/vscode/src/vs/platform/terminal/common/terminal.js +5 -2
- package/vscode/src/vs/platform/theme/common/colorUtils.d.ts +4 -0
- package/vscode/src/vs/platform/theme/common/colorUtils.js +9 -0
- package/vscode/src/vs/workbench/api/common/extHost.api.impl.js +6 -1
- package/vscode/src/vs/workbench/api/common/extHost.protocol.d.ts +21 -1
- package/vscode/src/vs/workbench/api/common/extHostApiCommands.js +3 -2
- package/vscode/src/vs/workbench/api/common/extHostChatAgents2.d.ts +5 -1
- package/vscode/src/vs/workbench/api/common/extHostChatAgents2.js +57 -4
- package/vscode/src/vs/workbench/api/common/extHostChatSessions.js +5 -3
- package/vscode/src/vs/workbench/api/common/extHostFileSystemEventService.js +34 -14
- package/vscode/src/vs/workbench/api/common/extHostLanguageModelTools.js +2 -1
- package/vscode/src/vs/workbench/api/common/extHostTypeConverters.d.ts +5 -1
- package/vscode/src/vs/workbench/api/common/extHostTypeConverters.js +32 -2
- package/vscode/src/vs/workbench/api/common/extHostTypes.d.ts +11 -1
- package/vscode/src/vs/workbench/api/common/extHostTypes.js +24 -2
- package/vscode/src/vs/workbench/browser/parts/editor/media/modalEditorPart.css +35 -5
- package/vscode/src/vs/workbench/browser/parts/editor/modalEditorPart.d.ts +1 -0
- package/vscode/src/vs/workbench/browser/parts/editor/modalEditorPart.js +70 -4
- package/vscode/src/vs/workbench/browser/parts/editor/multiEditorTabsControl.js +8 -1
- package/vscode/src/vs/workbench/browser/workbench.contribution.js +156 -167
- package/vscode/src/vs/workbench/common/configuration.js +9 -9
- package/vscode/src/vs/workbench/common/contextkeys.js +77 -77
- package/vscode/src/vs/workbench/common/editor/diffEditorInput.js +1 -1
- package/vscode/src/vs/workbench/common/editor/sideBySideEditorInput.js +1 -1
- package/vscode/src/vs/workbench/common/editor/textEditorModel.js +1 -1
- package/vscode/src/vs/workbench/common/editor.js +4 -4
- package/vscode/src/vs/workbench/common/theme.js +161 -161
- package/vscode/src/vs/workbench/common/views.d.ts +0 -6
- package/vscode/src/vs/workbench/common/views.js +4 -4
- package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibilityConfiguration.js +154 -154
- package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibleViewActions.js +12 -12
- package/vscode/src/vs/workbench/contrib/browserView/common/browserView.d.ts +11 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatActions.js +65 -64
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessions.d.ts +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessions.js +26 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsModel.d.ts +21 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsModel.js +21 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagement.d.ts +11 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagement.js +8 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatScreenshotContext.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chat.d.ts +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/chat.service.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorContextKeys.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionDescription.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionDescription.js +51 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessions.contribution.d.ts +165 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessions.contribution.js +1409 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/editor/chatEditorInput.js +9 -9
- package/vscode/src/vs/workbench/contrib/chat/common/actions/chatContextKeys.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/chat/common/actions/chatContextKeys.js +87 -83
- package/vscode/src/vs/workbench/contrib/chat/common/aiCustomizationWorkspaceService.service.d.ts +8 -0
- package/vscode/src/vs/workbench/contrib/chat/common/attachments/chatVariableEntries.d.ts +12 -2
- package/vscode/src/vs/workbench/contrib/chat/common/attachments/chatVariableEntries.js +5 -3
- package/vscode/src/vs/workbench/contrib/chat/common/chatModes.d.ts +4 -4
- package/vscode/src/vs/workbench/contrib/chat/common/chatModes.js +13 -12
- package/vscode/src/vs/workbench/contrib/chat/common/chatPerf.d.ts +75 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatPerf.js +30 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatService.d.ts +9 -12
- package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatService.js +1 -13
- package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatService.service.d.ts +1 -6
- package/vscode/src/vs/workbench/contrib/chat/common/chatSessionsService.d.ts +45 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatSessionsService.service.d.ts +17 -4
- package/vscode/src/vs/workbench/contrib/chat/common/constants.d.ts +6 -1
- package/vscode/src/vs/workbench/contrib/chat/common/constants.js +5 -0
- package/vscode/src/vs/workbench/contrib/chat/common/customizationHarnessService.d.ts +48 -5
- package/vscode/src/vs/workbench/contrib/chat/common/customizationHarnessService.js +46 -18
- package/vscode/src/vs/workbench/contrib/chat/common/customizationHarnessService.service.d.ts +10 -3
- package/vscode/src/vs/workbench/contrib/chat/common/editing/chatEditingService.d.ts +6 -2
- package/vscode/src/vs/workbench/contrib/chat/common/editing/chatEditingService.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/common/editing/chatEditingService.service.d.ts +9 -1
- package/vscode/src/vs/workbench/contrib/chat/common/languageModelStats.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/common/languageModels.js +23 -23
- package/vscode/src/vs/workbench/contrib/chat/common/model/chatModel.d.ts +11 -8
- package/vscode/src/vs/workbench/contrib/chat/common/model/chatModel.js +54 -20
- package/vscode/src/vs/workbench/contrib/chat/common/model/chatProgressTypes/chatToolInvocation.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/model/chatViewModel.d.ts +3 -5
- package/vscode/src/vs/workbench/contrib/chat/common/model/chatViewModel.js +3 -7
- package/vscode/src/vs/workbench/contrib/chat/common/participants/chatAgents.js +5 -1
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginRepositoryService.service.d.ts +6 -0
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginInstallService.d.ts +18 -0
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginInstallService.service.d.ts +10 -6
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.service.d.ts +0 -1
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/computeAutomaticInstructions.d.ts +4 -1
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/computeAutomaticInstructions.js +36 -6
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/config/config.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/config/promptFileLocations.d.ts +3 -29
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/config/promptFileLocations.js +2 -18
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookSchema.js +18 -18
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookTypes.js +20 -20
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptFileAttributes.js +78 -88
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/promptFileParser.d.ts +0 -1
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/promptFileParser.js +1 -2
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/promptTypes.d.ts +17 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/promptTypes.js +16 -1
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsService.d.ts +28 -23
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsService.js +1 -7
- package/vscode/src/vs/workbench/contrib/chat/common/requestParser/chatRequestParser.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/common/requestParser/chatRequestParser.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/askQuestionsTool.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/manageTodoListTool.js +10 -10
- package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/runSubagentTool.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/setArtifactsTool.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/tools.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/common/tools/chatArtifactsService.service.d.ts +2 -8
- package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsContribution.js +22 -22
- package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsService.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/common/widget/input/modelPickerWidget.js +1 -1
- package/vscode/src/vs/workbench/contrib/codeActions/browser/codeActionsContribution.js +11 -11
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/dictation/editorDictation.js +4 -4
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/diffEditorAccessibilityHelp.js +5 -5
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/diffEditorHelper.js +3 -3
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/find/simpleFindWidget.js +10 -10
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/inspectEditorTokens/inspectEditorTokens.js +2 -2
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/largeFileOptimizations.js +3 -3
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/quickaccess/gotoSymbolQuickAccess.d.ts +8 -1
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/quickaccess/gotoSymbolQuickAccess.js +41 -8
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/saveParticipants.js +4 -4
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/toggleMinimap.js +2 -2
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/toggleMultiCursorModifier.js +3 -3
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/toggleRenderControlCharacter.js +2 -2
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/toggleRenderWhitespace.js +2 -2
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/toggleWordWrap.js +5 -5
- package/vscode/src/vs/workbench/contrib/codeEditor/common/languageConfigurationExtensionPoint.js +65 -65
- package/vscode/src/vs/workbench/contrib/comments/browser/commentColors.js +7 -7
- package/vscode/src/vs/workbench/contrib/comments/browser/commentGlyphWidget.js +7 -7
- package/vscode/src/vs/workbench/contrib/comments/browser/commentNode.js +2 -2
- package/vscode/src/vs/workbench/contrib/comments/browser/commentReply.js +3 -3
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadBody.js +3 -3
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadHeader.js +3 -3
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadWidget.js +3 -3
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadZoneWidget.js +3 -3
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsAccessibility.js +12 -12
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsController.js +7 -7
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsModel.js +1 -1
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsTreeViewer.js +9 -9
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsView.js +14 -14
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsViewActions.js +16 -16
- package/vscode/src/vs/workbench/contrib/comments/browser/reactionsAction.js +7 -7
- package/vscode/src/vs/workbench/contrib/comments/common/commentContextKeys.js +12 -12
- package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditorInput.js +3 -3
- package/vscode/src/vs/workbench/contrib/debug/browser/baseDebugView.js +1 -1
- package/vscode/src/vs/workbench/contrib/debug/browser/breakpointEditorContribution.js +29 -29
- package/vscode/src/vs/workbench/contrib/debug/browser/breakpointWidget.js +14 -14
- package/vscode/src/vs/workbench/contrib/debug/browser/breakpointsView.js +75 -75
- package/vscode/src/vs/workbench/contrib/debug/browser/callStackEditorContribution.js +2 -2
- package/vscode/src/vs/workbench/contrib/debug/browser/debugActionViewItems.js +6 -6
- package/vscode/src/vs/workbench/contrib/debug/browser/debugColors.js +12 -12
- package/vscode/src/vs/workbench/contrib/debug/browser/debugCommands.js +38 -38
- package/vscode/src/vs/workbench/contrib/debug/browser/debugEditorContribution.js +2 -2
- package/vscode/src/vs/workbench/contrib/debug/browser/debugHover.js +3 -3
- package/vscode/src/vs/workbench/contrib/debug/browser/debugIcons.js +57 -57
- package/vscode/src/vs/workbench/contrib/debug/browser/debugSessionPicker.js +3 -3
- package/vscode/src/vs/workbench/contrib/debug/browser/exceptionWidget.js +4 -4
- package/vscode/src/vs/workbench/contrib/debug/browser/linkDetector.js +2 -2
- package/vscode/src/vs/workbench/contrib/debug/browser/repl.js +18 -18
- package/vscode/src/vs/workbench/contrib/debug/browser/replViewer.js +5 -5
- package/vscode/src/vs/workbench/contrib/debug/browser/variablesView.js +9 -9
- package/vscode/src/vs/workbench/contrib/debug/common/abstractDebugAdapter.js +1 -1
- package/vscode/src/vs/workbench/contrib/debug/common/debug.js +65 -65
- package/vscode/src/vs/workbench/contrib/debug/common/debugModel.js +6 -6
- package/vscode/src/vs/workbench/contrib/debug/common/debugSource.js +1 -1
- package/vscode/src/vs/workbench/contrib/debug/common/disassemblyViewInput.js +2 -2
- package/vscode/src/vs/workbench/contrib/debug/common/loadedScriptsPicker.js +1 -1
- package/vscode/src/vs/workbench/contrib/debug/common/replModel.js +1 -1
- package/vscode/src/vs/workbench/contrib/dropOrPasteInto/browser/commands.js +2 -2
- package/vscode/src/vs/workbench/contrib/dropOrPasteInto/browser/configurationSchema.js +4 -4
- package/vscode/src/vs/workbench/contrib/extensions/browser/abstractRuntimeExtensionsEditor.js +18 -18
- package/vscode/src/vs/workbench/contrib/extensions/browser/configBasedRecommendations.js +1 -1
- package/vscode/src/vs/workbench/contrib/extensions/browser/exeBasedRecommendations.js +1 -1
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionEditor.js +41 -41
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionEnablementWorkspaceTrustTransitionParticipant.js +1 -1
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionFeaturesTab.js +15 -15
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionRecommendationNotificationService.js +14 -14
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensions.contribution.js +148 -148
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsActions.js +170 -170
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsActivationProgress.js +1 -1
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsCompletionItemsProvider.js +1 -1
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsDependencyChecker.js +5 -5
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsIcons.js +25 -25
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsQuickAccess.js +4 -4
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsViewer.js +7 -7
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsViewlet.js +47 -47
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsViews.js +5 -5
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsWidgets.js +30 -30
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsWorkbenchService.js +76 -76
- package/vscode/src/vs/workbench/contrib/extensions/browser/fileBasedRecommendations.js +2 -2
- package/vscode/src/vs/workbench/contrib/extensions/browser/webRecommendations.js +1 -1
- package/vscode/src/vs/workbench/contrib/extensions/browser/workspaceRecommendations.js +2 -2
- package/vscode/src/vs/workbench/contrib/extensions/common/extensions.js +1 -1
- package/vscode/src/vs/workbench/contrib/extensions/common/extensionsFileTemplate.js +5 -5
- package/vscode/src/vs/workbench/contrib/extensions/common/extensionsInput.js +2 -2
- package/vscode/src/vs/workbench/contrib/extensions/common/extensionsUtils.js +3 -3
- package/vscode/src/vs/workbench/contrib/extensions/common/runtimeExtensionsInput.js +2 -2
- package/vscode/src/vs/workbench/contrib/extensions/common/searchExtensionsTool.js +3 -3
- package/vscode/src/vs/workbench/contrib/externalUriOpener/common/configuration.js +4 -4
- package/vscode/src/vs/workbench/contrib/externalUriOpener/common/externalUriOpenerService.js +3 -3
- package/vscode/src/vs/workbench/contrib/files/browser/editors/binaryFileEditor.js +1 -1
- package/vscode/src/vs/workbench/contrib/files/browser/editors/textFileEditor.js +8 -8
- package/vscode/src/vs/workbench/contrib/files/browser/editors/textFileSaveErrorHandler.js +18 -18
- package/vscode/src/vs/workbench/contrib/files/browser/explorerViewlet.js +14 -14
- package/vscode/src/vs/workbench/contrib/files/browser/fileActions.contribution.js +39 -39
- package/vscode/src/vs/workbench/contrib/files/browser/fileActions.js +84 -84
- package/vscode/src/vs/workbench/contrib/files/browser/fileCommands._save.js +4 -4
- package/vscode/src/vs/workbench/contrib/files/browser/fileCommands.js +2 -2
- package/vscode/src/vs/workbench/contrib/files/browser/fileConstants.js +6 -6
- package/vscode/src/vs/workbench/contrib/files/browser/fileImportExport.js +27 -27
- package/vscode/src/vs/workbench/contrib/files/browser/files.contribution._configuration.js +50 -50
- package/vscode/src/vs/workbench/contrib/files/browser/files.contribution._editorPane.js +2 -2
- package/vscode/src/vs/workbench/contrib/files/browser/views/emptyView.js +1 -1
- package/vscode/src/vs/workbench/contrib/files/browser/views/explorerDecorationsProvider.js +4 -4
- package/vscode/src/vs/workbench/contrib/files/browser/views/explorerView.js +7 -7
- package/vscode/src/vs/workbench/contrib/files/browser/views/explorerViewer.js +17 -17
- package/vscode/src/vs/workbench/contrib/files/browser/views/openEditorsView.js +7 -7
- package/vscode/src/vs/workbench/contrib/files/browser/workspaceWatcher.js +4 -4
- package/vscode/src/vs/workbench/contrib/files/common/dirtyFilesIndicator.js +1 -1
- package/vscode/src/vs/workbench/contrib/files/common/files.js +16 -16
- package/vscode/src/vs/workbench/contrib/folding/browser/folding.contribution.js +3 -3
- package/vscode/src/vs/workbench/contrib/format/browser/formatActionsMultiple.js +20 -20
- package/vscode/src/vs/workbench/contrib/format/browser/formatActionsNone.js +4 -4
- package/vscode/src/vs/workbench/contrib/format/browser/formatModified.js +1 -1
- package/vscode/src/vs/workbench/contrib/inlayHints/browser/inlayHintsAccessibilty.js +4 -4
- package/vscode/src/vs/workbench/contrib/list/browser/listResizeColumnAction.js +2 -2
- package/vscode/src/vs/workbench/contrib/list/browser/tableColumnResizeQuickPick.js +5 -5
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpCommandsAddConfiguration.js +66 -66
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerActions.js +40 -40
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerEditor.js +34 -34
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerEditorInput.js +2 -2
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerIcons.js +5 -5
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpServerWidgets.js +5 -5
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpConfiguration.js +40 -40
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpServer.js +16 -16
- package/vscode/src/vs/workbench/contrib/mcp/common/mcpTypes.js +4 -4
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorInput.js +4 -4
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorInputModel.js +23 -23
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/mergeEditorModel.js +2 -2
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/textModelDiffs.js +20 -9
- package/vscode/src/vs/workbench/contrib/mergeEditor/common/mergeEditor.js +8 -8
- package/vscode/src/vs/workbench/contrib/meteredConnection/browser/meteredConnection.contribution.js +8 -8
- package/vscode/src/vs/workbench/contrib/meteredConnection/browser/meteredConnectionStatus.js +4 -4
- package/vscode/src/vs/workbench/contrib/multiDiffEditor/browser/icons.contribution.js +1 -1
- package/vscode/src/vs/workbench/contrib/multiDiffEditor/browser/multiDiffEditorInput.js +3 -3
- package/vscode/src/vs/workbench/contrib/multiDiffEditor/browser/scmMultiDiffSourceResolver.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindReplaceWidget.js +17 -17
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/cellOutputActions.js +6 -6
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/coreActions.js +4 -4
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/foldingController.js +3 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookAccessibilityProvider.js +3 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookEditor.js +7 -7
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookEditorWidget.js +27 -27
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookIcons.js +29 -29
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellEditorOptions.js +5 -5
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellOutput.js +7 -7
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCell.js +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCellExecutionIcon.js +4 -4
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCellRunToolbar.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/collapsedCellOutput.js +3 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/foldedCellHint.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/markupCell.js +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/backLayerWebView.js +4 -4
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/cellRenderer.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookViewModelImpl.js +1 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookKernelQuickPickStrategy.js +14 -14
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookKernelView.js +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookViewZones.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorInput.js +2 -2
- package/vscode/src/vs/workbench/contrib/preferences/browser/keybindingWidgets.js +3 -3
- package/vscode/src/vs/workbench/contrib/preferences/browser/preferencesIcons.js +13 -13
- package/vscode/src/vs/workbench/contrib/preferences/browser/preferencesWidgets.js +10 -10
- package/vscode/src/vs/workbench/contrib/preferences/browser/settingsLayout.js +60 -60
- package/vscode/src/vs/workbench/contrib/preferences/common/preferences.js +3 -3
- package/vscode/src/vs/workbench/contrib/preferences/common/settingsEditorColorRegistry.js +21 -21
- package/vscode/src/vs/workbench/contrib/remote/browser/remoteExplorer.js +15 -15
- package/vscode/src/vs/workbench/contrib/remote/browser/remoteIcons.js +17 -17
- package/vscode/src/vs/workbench/contrib/remote/browser/tunnelView.js +59 -59
- package/vscode/src/vs/workbench/contrib/scm/browser/scmHistory.js +11 -11
- package/vscode/src/vs/workbench/contrib/scm/browser/scmHistoryChatContext.js +6 -6
- package/vscode/src/vs/workbench/contrib/scm/common/quickDiff.js +14 -14
- package/vscode/src/vs/workbench/contrib/search/browser/anythingQuickAccess.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/search/browser/anythingQuickAccess.js +30 -13
- package/vscode/src/vs/workbench/contrib/search/browser/patternInputWidget.js +3 -3
- package/vscode/src/vs/workbench/contrib/search/browser/searchActionsBase.js +1 -1
- package/vscode/src/vs/workbench/contrib/search/browser/searchActionsFind.js +12 -12
- package/vscode/src/vs/workbench/contrib/search/browser/searchActionsTopBar.js +9 -9
- package/vscode/src/vs/workbench/contrib/search/browser/searchChatContext.js +5 -5
- package/vscode/src/vs/workbench/contrib/search/browser/searchFindInput.js +1 -1
- package/vscode/src/vs/workbench/contrib/search/browser/searchIcons.js +20 -20
- package/vscode/src/vs/workbench/contrib/search/browser/searchMessage.js +2 -2
- package/vscode/src/vs/workbench/contrib/search/browser/searchResultsView.js +14 -14
- package/vscode/src/vs/workbench/contrib/search/browser/searchView.js +55 -55
- package/vscode/src/vs/workbench/contrib/search/browser/searchWidget.js +11 -11
- package/vscode/src/vs/workbench/contrib/search/browser/symbolsQuickAccess.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/search/browser/symbolsQuickAccess.js +32 -5
- package/vscode/src/vs/workbench/contrib/searchEditor/browser/searchEditorInput.js +4 -4
- package/vscode/src/vs/workbench/contrib/searchEditor/browser/searchEditorSerialization.js +5 -5
- package/vscode/src/vs/workbench/contrib/snippets/browser/snippetCompletionProvider.js +3 -3
- package/vscode/src/vs/workbench/contrib/snippets/browser/snippetsFile.js +3 -3
- package/vscode/src/vs/workbench/contrib/snippets/browser/snippetsService.js +9 -9
- package/vscode/src/vs/workbench/contrib/speech/common/speechService.js +29 -29
- package/vscode/src/vs/workbench/contrib/tasks/common/constants.js +1 -1
- package/vscode/src/vs/workbench/contrib/tasks/common/taskDefinitionRegistry.js +5 -5
- package/vscode/src/vs/workbench/contrib/tasks/common/taskService.js +6 -6
- package/vscode/src/vs/workbench/contrib/tasks/common/tasks.js +4 -4
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminal.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalEditorInput.js +3 -3
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalIcons.js +13 -13
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalMenus.d.ts +1 -2
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalMenus.js +43 -45
- package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/decorationStyles.js +15 -15
- package/vscode/src/vs/workbench/contrib/terminal/common/terminal.js +13 -10
- package/vscode/src/vs/workbench/contrib/terminal/common/terminalColorRegistry.js +23 -23
- package/vscode/src/vs/workbench/contrib/terminal/common/terminalContextKey.js +17 -17
- package/vscode/src/vs/workbench/contrib/terminal/common/terminalStrings.js +26 -26
- package/vscode/src/vs/workbench/contrib/terminal/terminalContribExports.d.ts +10 -3
- package/vscode/src/vs/workbench/contrib/terminal/terminalContribExports.js +10 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/accessibility/common/terminalAccessibilityConfiguration.js +2 -2
- package/vscode/src/vs/workbench/contrib/terminalContrib/autoReplies/common/terminalAutoRepliesConfiguration.js +2 -2
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalChatAgentToolsConfiguration.d.ts +10 -6
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalChatAgentToolsConfiguration.js +134 -91
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.service.d.ts +6 -2
- package/vscode/src/vs/workbench/contrib/terminalContrib/commandGuide/common/terminalCommandGuideConfiguration.js +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/history/common/terminal.history.js +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/inlineHint/common/terminalInitialHintConfiguration.js +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/notification/common/terminalNotificationConfiguration.js +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/stickyScroll/common/terminalStickyScrollConfiguration.js +3 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/suggest/common/terminalSuggestConfiguration.js +30 -30
- package/vscode/src/vs/workbench/contrib/terminalContrib/typeAhead/common/terminalTypeAheadConfiguration.js +5 -5
- package/vscode/src/vs/workbench/contrib/terminalContrib/zoom/common/terminal.zoom.js +2 -2
- package/vscode/src/vs/workbench/contrib/testing/common/constants.js +11 -11
- package/vscode/src/vs/workbench/contrib/testing/common/testResult.js +2 -2
- package/vscode/src/vs/workbench/contrib/testing/common/testTypes.js +3 -3
- package/vscode/src/vs/workbench/contrib/url/browser/trustedDomains.js +6 -6
- package/vscode/src/vs/workbench/contrib/webview/browser/webview.contribution.js +3 -3
- package/vscode/src/vs/workbench/contrib/webview/browser/webviewFindAccessibilityHelp.js +30 -30
- package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewEditor.js +1 -1
- package/vscode/src/vs/workbench/contrib/workspace/common/workspace.js +2 -2
- package/vscode/src/vs/workbench/services/accounts/browser/defaultAccount.js +1 -1
- package/vscode/src/vs/workbench/services/authentication/browser/authenticationService.js +11 -11
- package/vscode/src/vs/workbench/services/auxiliaryWindow/browser/auxiliaryWindowService.js +5 -5
- package/vscode/src/vs/workbench/services/chat/common/chatEntitlementService.d.ts +4 -0
- package/vscode/src/vs/workbench/services/chat/common/chatEntitlementService.js +27 -16
- package/vscode/src/vs/workbench/services/configurationResolver/common/configurationResolver.d.ts +1 -0
- package/vscode/src/vs/workbench/services/configurationResolver/common/configurationResolver.js +1 -0
- package/vscode/src/vs/workbench/services/configurationResolver/common/configurationResolverSchema.js +16 -16
- package/vscode/src/vs/workbench/services/configurationResolver/common/configurationResolverUtils.js +1 -1
- package/vscode/src/vs/workbench/services/configurationResolver/common/variableResolver.js +16 -16
- package/vscode/src/vs/workbench/services/editor/common/editorResolverService.js +1 -1
- package/vscode/src/vs/workbench/services/environment/browser/environmentService.d.ts +1 -0
- package/vscode/src/vs/workbench/services/environment/browser/environmentService.js +9 -0
- package/vscode/src/vs/workbench/services/environment/common/environmentService.service.d.ts +1 -0
- package/vscode/src/vs/workbench/services/extensionManagement/common/extensionsIcons.js +3 -3
- package/vscode/src/vs/workbench/services/extensionRecommendations/common/workspaceExtensionsConfig.js +6 -6
- package/vscode/src/vs/workbench/services/extensions/browser/extensionUrlHandler.js +10 -10
- package/vscode/src/vs/workbench/services/extensions/common/extensionsRegistry.js +88 -88
- package/vscode/src/vs/workbench/services/filesConfiguration/common/filesConfigurationService.js +5 -5
- package/vscode/src/vs/workbench/services/language/common/languageService.js +24 -24
- package/vscode/src/vs/workbench/services/log/common/logConstants.js +1 -1
- package/vscode/src/vs/workbench/services/preferences/browser/keybindingsEditorInput.js +2 -2
- package/vscode/src/vs/workbench/services/preferences/browser/keybindingsEditorModel.js +7 -7
- package/vscode/src/vs/workbench/services/preferences/common/preferencesEditorInput.js +4 -4
- package/vscode/src/vs/workbench/services/preferences/common/preferencesModels.js +2 -2
- package/vscode/src/vs/workbench/services/preferences/common/preferencesValidation.js +30 -30
- package/vscode/src/vs/workbench/services/remote/common/remoteExplorerService.js +8 -8
- package/vscode/src/vs/workbench/services/remote/common/tunnelModel.js +6 -6
- package/vscode/src/vs/workbench/services/search/common/queryBuilder.js +1 -1
- package/vscode/src/vs/workbench/services/textMate/common/TMGrammars.js +9 -9
- package/vscode/src/vs/workbench/services/textfile/common/textFileEditorModel.js +3 -3
- package/vscode/src/vs/workbench/services/themes/common/colorExtensionPoint.js +18 -18
- package/vscode/src/vs/workbench/services/themes/common/colorThemeData.js +8 -8
- package/vscode/src/vs/workbench/services/themes/common/iconExtensionPoint.js +13 -13
- package/vscode/src/vs/workbench/services/themes/common/tokenClassificationExtensionPoint.js +24 -24
- package/vscode/src/vs/workbench/services/themes/common/workbenchThemeService.d.ts +2 -2
- package/vscode/src/vs/workbench/services/themes/common/workbenchThemeService.js +8 -4
- package/vscode/src/vs/workbench/services/userDataProfile/common/userDataProfile.js +3 -3
- package/vscode/src/vs/workbench/services/userDataProfile/common/userDataProfileIcons.js +1 -1
- package/vscode/src/vs/workbench/services/userDataSync/common/userDataSync.js +13 -13
- package/vscode/src/vs/workbench/services/workingCopy/common/storedFileWorkingCopy.js +16 -16
- package/vscode-dts/vscode.proposed.chatParticipantAdditions.d.ts +0 -4
- package/vscode-dts/vscode.proposed.chatParticipantPrivate.d.ts +19 -1
- package/vscode-dts/vscode.proposed.chatSessionCustomizationProvider.d.ts +168 -0
- package/vscode-dts/vscode.proposed.d.ts +1 -0
- package/vscode-dts/vscode.proposed.terminalShellEnv.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/cellOperations.d.ts +0 -26
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/cellOperations.js +0 -746
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/insertCellActions.d.ts +0 -13
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/insertCellActions.js +0 -300
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffCellEditorOptions.d.ts +0 -8
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffCellEditorOptions.js +0 -55
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffComponents.d.ts +0 -273
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffComponents.js +0 -1963
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementOutputs.d.ts +0 -50
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementOutputs.js +0 -314
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementViewModel.d.ts +0 -258
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffElementViewModel.js +0 -886
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffNestedCellViewModel.d.ts +0 -41
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/diffNestedCellViewModel.js +0 -118
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/editorHeightCalculator.d.ts +0 -17
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/editorHeightCalculator.js +0 -71
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/eventDispatcher.d.ts +0 -27
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/eventDispatcher.js +0 -40
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookCellDiffDecorator.d.ts +0 -23
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookCellDiffDecorator.js +0 -313
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookDeletedCellDecorator.d.ts +0 -51
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookDeletedCellDecorator.js +0 -265
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInlineDiff.d.ts +0 -24
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInlineDiff.js +0 -185
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInlineDiffWidget.d.ts +0 -28
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInlineDiffWidget.js +0 -104
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInsertedCellDecorator.d.ts +0 -10
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookInsertedCellDecorator.js +0 -43
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookOriginalCellModelFactory.d.ts +0 -21
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookOriginalCellModelFactory.js +0 -41
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookOriginalModelRefFactory.d.ts +0 -25
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookOriginalModelRefFactory.js +0 -69
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiff.css +0 -469
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditor.d.ts +0 -149
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditor.js +0 -933
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditorBrowser.d.ts +0 -180
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffEditorBrowser.js +0 -32
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffList.d.ts +0 -102
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffList.js +0 -643
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffOverviewRuler.d.ts +0 -30
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffOverviewRuler.js +0 -197
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffViewModel.d.ts +0 -75
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/notebookDiffViewModel.js +0 -539
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/unchangedEditorRegions.d.ts +0 -13
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/unchangedEditorRegions.js +0 -39
- package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookMetadataTextModel.d.ts +0 -19
- package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookMetadataTextModel.js +0 -90
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookDiff.d.ts +0 -26
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookDiff.js +0 -92
|
@@ -1,746 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { ResourceTextEdit } from '../../../../../editor/browser/services/bulkEditService.js';
|
|
3
|
-
import { Position } from '../../../../../editor/common/core/position.js';
|
|
4
|
-
import { Range } from '../../../../../editor/common/core/range.js';
|
|
5
|
-
import { EndOfLinePreference } from '../../../../../editor/common/model.js';
|
|
6
|
-
import { PLAINTEXT_LANGUAGE_ID } from '../../../../../editor/common/languages/modesRegistry.js';
|
|
7
|
-
import { ResourceNotebookCellEdit } from '../../../bulkEdit/browser/bulkCellEdits.js';
|
|
8
|
-
import { CellEditState, expandCellRangesWithHiddenCells, CellFocusMode } from '../notebookBrowser.js';
|
|
9
|
-
import { cloneNotebookCellTextModel } from '../../common/model/notebookCellTextModel.js';
|
|
10
|
-
import { CellEditType, SelectionStateType, CellKind } from '../../common/notebookCommon.js';
|
|
11
|
-
import { cellRangeContains, cellRangesToIndexes } from '../../common/notebookRange.js';
|
|
12
|
-
import { localize } from '../../../../../nls.js';
|
|
13
|
-
|
|
14
|
-
async function changeCellToKind(kind, context, language, mime) {
|
|
15
|
-
const {
|
|
16
|
-
notebookEditor
|
|
17
|
-
} = context;
|
|
18
|
-
if (!notebookEditor.hasModel()) {
|
|
19
|
-
return;
|
|
20
|
-
}
|
|
21
|
-
if (notebookEditor.isReadOnly) {
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
if (context.ui && context.cell) {
|
|
25
|
-
const {
|
|
26
|
-
cell
|
|
27
|
-
} = context;
|
|
28
|
-
if (cell.cellKind === kind) {
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
const text = cell.getText();
|
|
32
|
-
const idx = notebookEditor.getCellIndex(cell);
|
|
33
|
-
if (language === undefined) {
|
|
34
|
-
const availableLanguages = notebookEditor.activeKernel?.supportedLanguages ?? [];
|
|
35
|
-
language = availableLanguages[0] ?? PLAINTEXT_LANGUAGE_ID;
|
|
36
|
-
}
|
|
37
|
-
notebookEditor.textModel.applyEdits([{
|
|
38
|
-
editType: CellEditType.Replace,
|
|
39
|
-
index: idx,
|
|
40
|
-
count: 1,
|
|
41
|
-
cells: [{
|
|
42
|
-
cellKind: kind,
|
|
43
|
-
source: text,
|
|
44
|
-
language: language,
|
|
45
|
-
mime: mime ?? cell.mime,
|
|
46
|
-
outputs: cell.model.outputs,
|
|
47
|
-
metadata: cell.metadata
|
|
48
|
-
}]
|
|
49
|
-
}], true, {
|
|
50
|
-
kind: SelectionStateType.Index,
|
|
51
|
-
focus: notebookEditor.getFocus(),
|
|
52
|
-
selections: notebookEditor.getSelections()
|
|
53
|
-
}, () => {
|
|
54
|
-
return {
|
|
55
|
-
kind: SelectionStateType.Index,
|
|
56
|
-
focus: notebookEditor.getFocus(),
|
|
57
|
-
selections: notebookEditor.getSelections()
|
|
58
|
-
};
|
|
59
|
-
}, undefined, true);
|
|
60
|
-
const newCell = notebookEditor.cellAt(idx);
|
|
61
|
-
await notebookEditor.focusNotebookCell(
|
|
62
|
-
newCell,
|
|
63
|
-
cell.getEditState() === CellEditState.Editing ? "editor" : "container"
|
|
64
|
-
);
|
|
65
|
-
} else if (context.selectedCells) {
|
|
66
|
-
const selectedCells = context.selectedCells;
|
|
67
|
-
const rawEdits = [];
|
|
68
|
-
selectedCells.forEach(cell => {
|
|
69
|
-
if (cell.cellKind === kind) {
|
|
70
|
-
return;
|
|
71
|
-
}
|
|
72
|
-
const text = cell.getText();
|
|
73
|
-
const idx = notebookEditor.getCellIndex(cell);
|
|
74
|
-
if (language === undefined) {
|
|
75
|
-
const availableLanguages = notebookEditor.activeKernel?.supportedLanguages ?? [];
|
|
76
|
-
language = availableLanguages[0] ?? PLAINTEXT_LANGUAGE_ID;
|
|
77
|
-
}
|
|
78
|
-
rawEdits.push({
|
|
79
|
-
editType: CellEditType.Replace,
|
|
80
|
-
index: idx,
|
|
81
|
-
count: 1,
|
|
82
|
-
cells: [{
|
|
83
|
-
cellKind: kind,
|
|
84
|
-
source: text,
|
|
85
|
-
language: language,
|
|
86
|
-
mime: mime ?? cell.mime,
|
|
87
|
-
outputs: cell.model.outputs,
|
|
88
|
-
metadata: cell.metadata
|
|
89
|
-
}]
|
|
90
|
-
});
|
|
91
|
-
});
|
|
92
|
-
notebookEditor.textModel.applyEdits(rawEdits, true, {
|
|
93
|
-
kind: SelectionStateType.Index,
|
|
94
|
-
focus: notebookEditor.getFocus(),
|
|
95
|
-
selections: notebookEditor.getSelections()
|
|
96
|
-
}, () => {
|
|
97
|
-
return {
|
|
98
|
-
kind: SelectionStateType.Index,
|
|
99
|
-
focus: notebookEditor.getFocus(),
|
|
100
|
-
selections: notebookEditor.getSelections()
|
|
101
|
-
};
|
|
102
|
-
}, undefined, true);
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
function runDeleteAction(editor, cell) {
|
|
106
|
-
const textModel = editor.textModel;
|
|
107
|
-
const selections = editor.getSelections();
|
|
108
|
-
const targetCellIndex = editor.getCellIndex(cell);
|
|
109
|
-
const containingSelection = selections.find(
|
|
110
|
-
selection => selection.start <= targetCellIndex && targetCellIndex < selection.end
|
|
111
|
-
);
|
|
112
|
-
const computeUndoRedo = !editor.isReadOnly || textModel.viewType === "interactive";
|
|
113
|
-
if (containingSelection) {
|
|
114
|
-
const edits = ( selections.reverse().map(selection => ({
|
|
115
|
-
editType: CellEditType.Replace,
|
|
116
|
-
index: selection.start,
|
|
117
|
-
count: selection.end - selection.start,
|
|
118
|
-
cells: []
|
|
119
|
-
})));
|
|
120
|
-
const nextCellAfterContainingSelection = containingSelection.end >= editor.getLength() ? undefined : editor.cellAt(containingSelection.end);
|
|
121
|
-
textModel.applyEdits(edits, true, {
|
|
122
|
-
kind: SelectionStateType.Index,
|
|
123
|
-
focus: editor.getFocus(),
|
|
124
|
-
selections: editor.getSelections()
|
|
125
|
-
}, () => {
|
|
126
|
-
if (nextCellAfterContainingSelection) {
|
|
127
|
-
const cellIndex = textModel.cells.findIndex(cell => cell.handle === nextCellAfterContainingSelection.handle);
|
|
128
|
-
return {
|
|
129
|
-
kind: SelectionStateType.Index,
|
|
130
|
-
focus: {
|
|
131
|
-
start: cellIndex,
|
|
132
|
-
end: cellIndex + 1
|
|
133
|
-
},
|
|
134
|
-
selections: [{
|
|
135
|
-
start: cellIndex,
|
|
136
|
-
end: cellIndex + 1
|
|
137
|
-
}]
|
|
138
|
-
};
|
|
139
|
-
} else {
|
|
140
|
-
if (textModel.length) {
|
|
141
|
-
const lastCellIndex = textModel.length - 1;
|
|
142
|
-
return {
|
|
143
|
-
kind: SelectionStateType.Index,
|
|
144
|
-
focus: {
|
|
145
|
-
start: lastCellIndex,
|
|
146
|
-
end: lastCellIndex + 1
|
|
147
|
-
},
|
|
148
|
-
selections: [{
|
|
149
|
-
start: lastCellIndex,
|
|
150
|
-
end: lastCellIndex + 1
|
|
151
|
-
}]
|
|
152
|
-
};
|
|
153
|
-
} else {
|
|
154
|
-
return {
|
|
155
|
-
kind: SelectionStateType.Index,
|
|
156
|
-
focus: {
|
|
157
|
-
start: 0,
|
|
158
|
-
end: 0
|
|
159
|
-
},
|
|
160
|
-
selections: [{
|
|
161
|
-
start: 0,
|
|
162
|
-
end: 0
|
|
163
|
-
}]
|
|
164
|
-
};
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
}, undefined, computeUndoRedo);
|
|
168
|
-
} else {
|
|
169
|
-
const focus = editor.getFocus();
|
|
170
|
-
const edits = [{
|
|
171
|
-
editType: CellEditType.Replace,
|
|
172
|
-
index: targetCellIndex,
|
|
173
|
-
count: 1,
|
|
174
|
-
cells: []
|
|
175
|
-
}];
|
|
176
|
-
const finalSelections = [];
|
|
177
|
-
for (let i = 0; i < selections.length; i++) {
|
|
178
|
-
const selection = selections[i];
|
|
179
|
-
if (selection.end <= targetCellIndex) {
|
|
180
|
-
finalSelections.push(selection);
|
|
181
|
-
} else if (selection.start > targetCellIndex) {
|
|
182
|
-
finalSelections.push({
|
|
183
|
-
start: selection.start - 1,
|
|
184
|
-
end: selection.end - 1
|
|
185
|
-
});
|
|
186
|
-
} else {
|
|
187
|
-
finalSelections.push({
|
|
188
|
-
start: targetCellIndex,
|
|
189
|
-
end: targetCellIndex + 1
|
|
190
|
-
});
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
if (editor.cellAt(focus.start) === cell) {
|
|
194
|
-
const newFocus = focus.end === textModel.length ? {
|
|
195
|
-
start: focus.start - 1,
|
|
196
|
-
end: focus.end - 1
|
|
197
|
-
} : focus;
|
|
198
|
-
textModel.applyEdits(edits, true, {
|
|
199
|
-
kind: SelectionStateType.Index,
|
|
200
|
-
focus: editor.getFocus(),
|
|
201
|
-
selections: editor.getSelections()
|
|
202
|
-
}, () => ({
|
|
203
|
-
kind: SelectionStateType.Index,
|
|
204
|
-
focus: newFocus,
|
|
205
|
-
selections: finalSelections
|
|
206
|
-
}), undefined, computeUndoRedo);
|
|
207
|
-
} else {
|
|
208
|
-
const newFocus = focus.start > targetCellIndex ? {
|
|
209
|
-
start: focus.start - 1,
|
|
210
|
-
end: focus.end - 1
|
|
211
|
-
} : focus;
|
|
212
|
-
textModel.applyEdits(edits, true, {
|
|
213
|
-
kind: SelectionStateType.Index,
|
|
214
|
-
focus: editor.getFocus(),
|
|
215
|
-
selections: editor.getSelections()
|
|
216
|
-
}, () => ({
|
|
217
|
-
kind: SelectionStateType.Index,
|
|
218
|
-
focus: newFocus,
|
|
219
|
-
selections: finalSelections
|
|
220
|
-
}), undefined, computeUndoRedo);
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
async function moveCellRange(context, direction) {
|
|
225
|
-
if (!context.notebookEditor.hasModel()) {
|
|
226
|
-
return;
|
|
227
|
-
}
|
|
228
|
-
const editor = context.notebookEditor;
|
|
229
|
-
const textModel = editor.textModel;
|
|
230
|
-
if (editor.isReadOnly) {
|
|
231
|
-
return;
|
|
232
|
-
}
|
|
233
|
-
let range = undefined;
|
|
234
|
-
if (context.cell) {
|
|
235
|
-
const idx = editor.getCellIndex(context.cell);
|
|
236
|
-
range = {
|
|
237
|
-
start: idx,
|
|
238
|
-
end: idx + 1
|
|
239
|
-
};
|
|
240
|
-
} else {
|
|
241
|
-
const selections = editor.getSelections();
|
|
242
|
-
const modelRanges = expandCellRangesWithHiddenCells(editor, selections);
|
|
243
|
-
range = modelRanges[0];
|
|
244
|
-
}
|
|
245
|
-
if (!range || range.start === range.end) {
|
|
246
|
-
return;
|
|
247
|
-
}
|
|
248
|
-
if (direction === "up") {
|
|
249
|
-
if (range.start === 0) {
|
|
250
|
-
return;
|
|
251
|
-
}
|
|
252
|
-
const indexAbove = range.start - 1;
|
|
253
|
-
const finalSelection = {
|
|
254
|
-
start: range.start - 1,
|
|
255
|
-
end: range.end - 1
|
|
256
|
-
};
|
|
257
|
-
const focus = context.notebookEditor.getFocus();
|
|
258
|
-
const newFocus = cellRangeContains(range, focus) ? {
|
|
259
|
-
start: focus.start - 1,
|
|
260
|
-
end: focus.end - 1
|
|
261
|
-
} : {
|
|
262
|
-
start: range.start - 1,
|
|
263
|
-
end: range.start
|
|
264
|
-
};
|
|
265
|
-
textModel.applyEdits([{
|
|
266
|
-
editType: CellEditType.Move,
|
|
267
|
-
index: indexAbove,
|
|
268
|
-
length: 1,
|
|
269
|
-
newIdx: range.end - 1
|
|
270
|
-
}], true, {
|
|
271
|
-
kind: SelectionStateType.Index,
|
|
272
|
-
focus: editor.getFocus(),
|
|
273
|
-
selections: editor.getSelections()
|
|
274
|
-
}, () => ({
|
|
275
|
-
kind: SelectionStateType.Index,
|
|
276
|
-
focus: newFocus,
|
|
277
|
-
selections: [finalSelection]
|
|
278
|
-
}), undefined, true);
|
|
279
|
-
const focusRange = editor.getSelections()[0] ?? editor.getFocus();
|
|
280
|
-
editor.revealCellRangeInView(focusRange);
|
|
281
|
-
} else {
|
|
282
|
-
if (range.end >= textModel.length) {
|
|
283
|
-
return;
|
|
284
|
-
}
|
|
285
|
-
const indexBelow = range.end;
|
|
286
|
-
const finalSelection = {
|
|
287
|
-
start: range.start + 1,
|
|
288
|
-
end: range.end + 1
|
|
289
|
-
};
|
|
290
|
-
const focus = editor.getFocus();
|
|
291
|
-
const newFocus = cellRangeContains(range, focus) ? {
|
|
292
|
-
start: focus.start + 1,
|
|
293
|
-
end: focus.end + 1
|
|
294
|
-
} : {
|
|
295
|
-
start: range.start + 1,
|
|
296
|
-
end: range.start + 2
|
|
297
|
-
};
|
|
298
|
-
textModel.applyEdits([{
|
|
299
|
-
editType: CellEditType.Move,
|
|
300
|
-
index: indexBelow,
|
|
301
|
-
length: 1,
|
|
302
|
-
newIdx: range.start
|
|
303
|
-
}], true, {
|
|
304
|
-
kind: SelectionStateType.Index,
|
|
305
|
-
focus: editor.getFocus(),
|
|
306
|
-
selections: editor.getSelections()
|
|
307
|
-
}, () => ({
|
|
308
|
-
kind: SelectionStateType.Index,
|
|
309
|
-
focus: newFocus,
|
|
310
|
-
selections: [finalSelection]
|
|
311
|
-
}), undefined, true);
|
|
312
|
-
const focusRange = editor.getSelections()[0] ?? editor.getFocus();
|
|
313
|
-
editor.revealCellRangeInView(focusRange);
|
|
314
|
-
}
|
|
315
|
-
}
|
|
316
|
-
async function copyCellRange(context, direction) {
|
|
317
|
-
const editor = context.notebookEditor;
|
|
318
|
-
if (!editor.hasModel()) {
|
|
319
|
-
return;
|
|
320
|
-
}
|
|
321
|
-
const textModel = editor.textModel;
|
|
322
|
-
if (editor.isReadOnly) {
|
|
323
|
-
return;
|
|
324
|
-
}
|
|
325
|
-
let range = undefined;
|
|
326
|
-
if (context.ui) {
|
|
327
|
-
const targetCell = context.cell;
|
|
328
|
-
const targetCellIndex = editor.getCellIndex(targetCell);
|
|
329
|
-
range = {
|
|
330
|
-
start: targetCellIndex,
|
|
331
|
-
end: targetCellIndex + 1
|
|
332
|
-
};
|
|
333
|
-
} else {
|
|
334
|
-
const selections = editor.getSelections();
|
|
335
|
-
const modelRanges = expandCellRangesWithHiddenCells(editor, selections);
|
|
336
|
-
range = modelRanges[0];
|
|
337
|
-
}
|
|
338
|
-
if (!range || range.start === range.end) {
|
|
339
|
-
return;
|
|
340
|
-
}
|
|
341
|
-
if (direction === "up") {
|
|
342
|
-
const focus = editor.getFocus();
|
|
343
|
-
const selections = editor.getSelections();
|
|
344
|
-
textModel.applyEdits([{
|
|
345
|
-
editType: CellEditType.Replace,
|
|
346
|
-
index: range.end,
|
|
347
|
-
count: 0,
|
|
348
|
-
cells: ( cellRangesToIndexes([range]).map(index => cloneNotebookCellTextModel(editor.cellAt(index).model)))
|
|
349
|
-
}], true, {
|
|
350
|
-
kind: SelectionStateType.Index,
|
|
351
|
-
focus: focus,
|
|
352
|
-
selections: selections
|
|
353
|
-
}, () => ({
|
|
354
|
-
kind: SelectionStateType.Index,
|
|
355
|
-
focus: focus,
|
|
356
|
-
selections: selections
|
|
357
|
-
}), undefined, true);
|
|
358
|
-
} else {
|
|
359
|
-
const focus = editor.getFocus();
|
|
360
|
-
const selections = editor.getSelections();
|
|
361
|
-
const newCells = ( cellRangesToIndexes([range]).map(index => cloneNotebookCellTextModel(editor.cellAt(index).model)));
|
|
362
|
-
const countDelta = newCells.length;
|
|
363
|
-
const newFocus = context.ui ? focus : {
|
|
364
|
-
start: focus.start + countDelta,
|
|
365
|
-
end: focus.end + countDelta
|
|
366
|
-
};
|
|
367
|
-
const newSelections = context.ui ? selections : [{
|
|
368
|
-
start: range.start + countDelta,
|
|
369
|
-
end: range.end + countDelta
|
|
370
|
-
}];
|
|
371
|
-
textModel.applyEdits([{
|
|
372
|
-
editType: CellEditType.Replace,
|
|
373
|
-
index: range.end,
|
|
374
|
-
count: 0,
|
|
375
|
-
cells: ( cellRangesToIndexes([range]).map(index => cloneNotebookCellTextModel(editor.cellAt(index).model)))
|
|
376
|
-
}], true, {
|
|
377
|
-
kind: SelectionStateType.Index,
|
|
378
|
-
focus: focus,
|
|
379
|
-
selections: selections
|
|
380
|
-
}, () => ({
|
|
381
|
-
kind: SelectionStateType.Index,
|
|
382
|
-
focus: newFocus,
|
|
383
|
-
selections: newSelections
|
|
384
|
-
}), undefined, true);
|
|
385
|
-
const focusRange = editor.getSelections()[0] ?? editor.getFocus();
|
|
386
|
-
editor.revealCellRangeInView(focusRange);
|
|
387
|
-
}
|
|
388
|
-
}
|
|
389
|
-
async function joinSelectedCells(bulkEditService, notificationService, context) {
|
|
390
|
-
const editor = context.notebookEditor;
|
|
391
|
-
if (editor.isReadOnly) {
|
|
392
|
-
return;
|
|
393
|
-
}
|
|
394
|
-
const edits = [];
|
|
395
|
-
const cells = [];
|
|
396
|
-
for (const selection of editor.getSelections()) {
|
|
397
|
-
cells.push(...editor.getCellsInRange(selection));
|
|
398
|
-
}
|
|
399
|
-
if (cells.length <= 1) {
|
|
400
|
-
return;
|
|
401
|
-
}
|
|
402
|
-
const cellKind = cells[0].cellKind;
|
|
403
|
-
const isSameKind = cells.every(cell => cell.cellKind === cellKind);
|
|
404
|
-
if (!isSameKind) {
|
|
405
|
-
const message = ( localize(11019, "Cannot join cells of different kinds"));
|
|
406
|
-
return notificationService.warn(message);
|
|
407
|
-
}
|
|
408
|
-
const firstCell = cells[0];
|
|
409
|
-
const insertContent = ( cells.map(cell => cell.getText())).join(firstCell.textBuffer.getEOL());
|
|
410
|
-
const firstSelection = editor.getSelections()[0];
|
|
411
|
-
edits.push(( new ResourceNotebookCellEdit(editor.textModel.uri, {
|
|
412
|
-
editType: CellEditType.Replace,
|
|
413
|
-
index: firstSelection.start,
|
|
414
|
-
count: firstSelection.end - firstSelection.start,
|
|
415
|
-
cells: [{
|
|
416
|
-
cellKind: firstCell.cellKind,
|
|
417
|
-
source: insertContent,
|
|
418
|
-
language: firstCell.language,
|
|
419
|
-
mime: firstCell.mime,
|
|
420
|
-
outputs: firstCell.model.outputs,
|
|
421
|
-
metadata: firstCell.metadata
|
|
422
|
-
}]
|
|
423
|
-
})));
|
|
424
|
-
for (const selection of editor.getSelections().slice(1)) {
|
|
425
|
-
edits.push(( new ResourceNotebookCellEdit(editor.textModel.uri, {
|
|
426
|
-
editType: CellEditType.Replace,
|
|
427
|
-
index: selection.start,
|
|
428
|
-
count: selection.end - selection.start,
|
|
429
|
-
cells: []
|
|
430
|
-
})));
|
|
431
|
-
}
|
|
432
|
-
if (edits.length) {
|
|
433
|
-
await bulkEditService.apply(edits, {
|
|
434
|
-
quotableLabel: ( localize(11020, "Join Notebook Cells"))
|
|
435
|
-
});
|
|
436
|
-
}
|
|
437
|
-
}
|
|
438
|
-
async function joinNotebookCells(editor, range, direction, constraint) {
|
|
439
|
-
if (editor.isReadOnly) {
|
|
440
|
-
return null;
|
|
441
|
-
}
|
|
442
|
-
const textModel = editor.textModel;
|
|
443
|
-
const cells = editor.getCellsInRange(range);
|
|
444
|
-
if (!cells.length) {
|
|
445
|
-
return null;
|
|
446
|
-
}
|
|
447
|
-
if (range.start === 0 && direction === "above") {
|
|
448
|
-
return null;
|
|
449
|
-
}
|
|
450
|
-
if (range.end === textModel.length && direction === "below") {
|
|
451
|
-
return null;
|
|
452
|
-
}
|
|
453
|
-
if (direction === "above") {
|
|
454
|
-
const above = editor.cellAt(range.start - 1);
|
|
455
|
-
const insertContent = ( cells.map(cell => (cell.textBuffer.getEOL() ?? "") + cell.getText())).join("");
|
|
456
|
-
const aboveCellLineCount = above.textBuffer.getLineCount();
|
|
457
|
-
const aboveCellLastLineEndColumn = above.textBuffer.getLineLength(aboveCellLineCount);
|
|
458
|
-
return {
|
|
459
|
-
edits: [( new ResourceTextEdit(above.uri, {
|
|
460
|
-
range: ( new Range(
|
|
461
|
-
aboveCellLineCount,
|
|
462
|
-
aboveCellLastLineEndColumn + 1,
|
|
463
|
-
aboveCellLineCount,
|
|
464
|
-
aboveCellLastLineEndColumn + 1
|
|
465
|
-
)),
|
|
466
|
-
text: insertContent
|
|
467
|
-
})), ( new ResourceNotebookCellEdit(textModel.uri, {
|
|
468
|
-
editType: CellEditType.Replace,
|
|
469
|
-
index: range.start,
|
|
470
|
-
count: range.end - range.start,
|
|
471
|
-
cells: []
|
|
472
|
-
}))],
|
|
473
|
-
cell: above,
|
|
474
|
-
endFocus: {
|
|
475
|
-
start: range.start - 1,
|
|
476
|
-
end: range.start
|
|
477
|
-
},
|
|
478
|
-
endSelections: [{
|
|
479
|
-
start: range.start - 1,
|
|
480
|
-
end: range.start
|
|
481
|
-
}]
|
|
482
|
-
};
|
|
483
|
-
} else {
|
|
484
|
-
const below = editor.cellAt(range.end);
|
|
485
|
-
const cell = cells[0];
|
|
486
|
-
const restCells = [...cells.slice(1), below];
|
|
487
|
-
const insertContent = ( restCells.map(cl => (cl.textBuffer.getEOL() ?? "") + cl.getText())).join("");
|
|
488
|
-
const cellLineCount = cell.textBuffer.getLineCount();
|
|
489
|
-
const cellLastLineEndColumn = cell.textBuffer.getLineLength(cellLineCount);
|
|
490
|
-
return {
|
|
491
|
-
edits: [( new ResourceTextEdit(cell.uri, {
|
|
492
|
-
range: ( new Range(
|
|
493
|
-
cellLineCount,
|
|
494
|
-
cellLastLineEndColumn + 1,
|
|
495
|
-
cellLineCount,
|
|
496
|
-
cellLastLineEndColumn + 1
|
|
497
|
-
)),
|
|
498
|
-
text: insertContent
|
|
499
|
-
})), ( new ResourceNotebookCellEdit(textModel.uri, {
|
|
500
|
-
editType: CellEditType.Replace,
|
|
501
|
-
index: range.start + 1,
|
|
502
|
-
count: range.end - range.start,
|
|
503
|
-
cells: []
|
|
504
|
-
}))],
|
|
505
|
-
cell,
|
|
506
|
-
endFocus: {
|
|
507
|
-
start: range.start,
|
|
508
|
-
end: range.start + 1
|
|
509
|
-
},
|
|
510
|
-
endSelections: [{
|
|
511
|
-
start: range.start,
|
|
512
|
-
end: range.start + 1
|
|
513
|
-
}]
|
|
514
|
-
};
|
|
515
|
-
}
|
|
516
|
-
}
|
|
517
|
-
async function joinCellsWithSurrounds(bulkEditService, context, direction) {
|
|
518
|
-
const editor = context.notebookEditor;
|
|
519
|
-
const textModel = editor.textModel;
|
|
520
|
-
const viewModel = editor.getViewModel();
|
|
521
|
-
let ret = null;
|
|
522
|
-
if (context.ui) {
|
|
523
|
-
const focusMode = context.cell.focusMode;
|
|
524
|
-
const cellIndex = editor.getCellIndex(context.cell);
|
|
525
|
-
ret = await joinNotebookCells(editor, {
|
|
526
|
-
start: cellIndex,
|
|
527
|
-
end: cellIndex + 1
|
|
528
|
-
}, direction);
|
|
529
|
-
if (!ret) {
|
|
530
|
-
return;
|
|
531
|
-
}
|
|
532
|
-
await bulkEditService.apply(ret?.edits, {
|
|
533
|
-
quotableLabel: "Join Notebook Cells"
|
|
534
|
-
});
|
|
535
|
-
viewModel.updateSelectionsState({
|
|
536
|
-
kind: SelectionStateType.Index,
|
|
537
|
-
focus: ret.endFocus,
|
|
538
|
-
selections: ret.endSelections
|
|
539
|
-
});
|
|
540
|
-
ret.cell.updateEditState(CellEditState.Editing, "joinCellsWithSurrounds");
|
|
541
|
-
editor.revealCellRangeInView(editor.getFocus());
|
|
542
|
-
if (focusMode === CellFocusMode.Editor) {
|
|
543
|
-
ret.cell.focusMode = CellFocusMode.Editor;
|
|
544
|
-
}
|
|
545
|
-
} else {
|
|
546
|
-
const selections = editor.getSelections();
|
|
547
|
-
if (!selections.length) {
|
|
548
|
-
return;
|
|
549
|
-
}
|
|
550
|
-
const focus = editor.getFocus();
|
|
551
|
-
const focusMode = editor.cellAt(focus.start)?.focusMode;
|
|
552
|
-
const edits = [];
|
|
553
|
-
let cell = null;
|
|
554
|
-
const cells = [];
|
|
555
|
-
for (let i = selections.length - 1; i >= 0; i--) {
|
|
556
|
-
const selection = selections[i];
|
|
557
|
-
const containFocus = cellRangeContains(selection, focus);
|
|
558
|
-
if (selection.end >= textModel.length && direction === "below" || selection.start === 0 && direction === "above") {
|
|
559
|
-
if (containFocus) {
|
|
560
|
-
cell = editor.cellAt(focus.start);
|
|
561
|
-
}
|
|
562
|
-
cells.push(...editor.getCellsInRange(selection));
|
|
563
|
-
continue;
|
|
564
|
-
}
|
|
565
|
-
const singleRet = await joinNotebookCells(editor, selection, direction);
|
|
566
|
-
if (!singleRet) {
|
|
567
|
-
return;
|
|
568
|
-
}
|
|
569
|
-
edits.push(...singleRet.edits);
|
|
570
|
-
cells.push(singleRet.cell);
|
|
571
|
-
if (containFocus) {
|
|
572
|
-
cell = singleRet.cell;
|
|
573
|
-
}
|
|
574
|
-
}
|
|
575
|
-
if (!edits.length) {
|
|
576
|
-
return;
|
|
577
|
-
}
|
|
578
|
-
if (!cell || !cells.length) {
|
|
579
|
-
return;
|
|
580
|
-
}
|
|
581
|
-
await bulkEditService.apply(edits, {
|
|
582
|
-
quotableLabel: "Join Notebook Cells"
|
|
583
|
-
});
|
|
584
|
-
cells.forEach(cell => {
|
|
585
|
-
cell.updateEditState(CellEditState.Editing, "joinCellsWithSurrounds");
|
|
586
|
-
});
|
|
587
|
-
viewModel.updateSelectionsState({
|
|
588
|
-
kind: SelectionStateType.Handle,
|
|
589
|
-
primary: cell.handle,
|
|
590
|
-
selections: ( cells.map(cell => cell.handle))
|
|
591
|
-
});
|
|
592
|
-
editor.revealCellRangeInView(editor.getFocus());
|
|
593
|
-
const newFocusedCell = editor.cellAt(editor.getFocus().start);
|
|
594
|
-
if (focusMode === CellFocusMode.Editor && newFocusedCell) {
|
|
595
|
-
newFocusedCell.focusMode = CellFocusMode.Editor;
|
|
596
|
-
}
|
|
597
|
-
}
|
|
598
|
-
}
|
|
599
|
-
function _splitPointsToBoundaries(splitPoints, textBuffer) {
|
|
600
|
-
const boundaries = [];
|
|
601
|
-
const lineCnt = textBuffer.getLineCount();
|
|
602
|
-
const getLineLen = lineNumber => {
|
|
603
|
-
return textBuffer.getLineLength(lineNumber);
|
|
604
|
-
};
|
|
605
|
-
splitPoints = splitPoints.sort((l, r) => {
|
|
606
|
-
const lineDiff = l.lineNumber - r.lineNumber;
|
|
607
|
-
const columnDiff = l.column - r.column;
|
|
608
|
-
return lineDiff !== 0 ? lineDiff : columnDiff;
|
|
609
|
-
});
|
|
610
|
-
for (let sp of splitPoints) {
|
|
611
|
-
if (getLineLen(sp.lineNumber) + 1 === sp.column && sp.column !== 1 && sp.lineNumber < lineCnt) {
|
|
612
|
-
sp = ( new Position(sp.lineNumber + 1, 1));
|
|
613
|
-
}
|
|
614
|
-
_pushIfAbsent(boundaries, sp);
|
|
615
|
-
}
|
|
616
|
-
if (boundaries.length === 0) {
|
|
617
|
-
return null;
|
|
618
|
-
}
|
|
619
|
-
const modelStart = ( new Position(1, 1));
|
|
620
|
-
const modelEnd = ( new Position(lineCnt, getLineLen(lineCnt) + 1));
|
|
621
|
-
return [modelStart, ...boundaries, modelEnd];
|
|
622
|
-
}
|
|
623
|
-
function _pushIfAbsent(positions, p) {
|
|
624
|
-
const last = positions.length > 0 ? positions[positions.length - 1] : undefined;
|
|
625
|
-
if (!last || last.lineNumber !== p.lineNumber || last.column !== p.column) {
|
|
626
|
-
positions.push(p);
|
|
627
|
-
}
|
|
628
|
-
}
|
|
629
|
-
function computeCellLinesContents(cell, splitPoints) {
|
|
630
|
-
const rangeBoundaries = _splitPointsToBoundaries(splitPoints, cell.textBuffer);
|
|
631
|
-
if (!rangeBoundaries) {
|
|
632
|
-
return null;
|
|
633
|
-
}
|
|
634
|
-
const newLineModels = [];
|
|
635
|
-
for (let i = 1; i < rangeBoundaries.length; i++) {
|
|
636
|
-
const start = rangeBoundaries[i - 1];
|
|
637
|
-
const end = rangeBoundaries[i];
|
|
638
|
-
newLineModels.push(cell.textBuffer.getValueInRange(( new Range(start.lineNumber, start.column, end.lineNumber, end.column)), EndOfLinePreference.TextDefined));
|
|
639
|
-
}
|
|
640
|
-
return newLineModels;
|
|
641
|
-
}
|
|
642
|
-
function insertCell(
|
|
643
|
-
languageService,
|
|
644
|
-
editor,
|
|
645
|
-
index,
|
|
646
|
-
type,
|
|
647
|
-
direction = "above",
|
|
648
|
-
initialText = "",
|
|
649
|
-
ui = false,
|
|
650
|
-
kernelHistoryService
|
|
651
|
-
) {
|
|
652
|
-
const viewModel = editor.getViewModel();
|
|
653
|
-
const activeKernel = editor.activeKernel;
|
|
654
|
-
if (viewModel.options.isReadOnly) {
|
|
655
|
-
return null;
|
|
656
|
-
}
|
|
657
|
-
const cell = editor.cellAt(index);
|
|
658
|
-
const nextIndex = ui ? viewModel.getNextVisibleCellIndex(index) : index + 1;
|
|
659
|
-
let language;
|
|
660
|
-
if (type === CellKind.Code) {
|
|
661
|
-
const supportedLanguages = activeKernel?.supportedLanguages ?? languageService.getRegisteredLanguageIds();
|
|
662
|
-
const defaultLanguage = supportedLanguages[0] || PLAINTEXT_LANGUAGE_ID;
|
|
663
|
-
if (cell?.cellKind === CellKind.Code) {
|
|
664
|
-
language = cell.language;
|
|
665
|
-
} else if (cell?.cellKind === CellKind.Markup) {
|
|
666
|
-
const nearestCodeCellIndex = viewModel.nearestCodeCellIndex(index);
|
|
667
|
-
if (nearestCodeCellIndex > -1) {
|
|
668
|
-
language = viewModel.cellAt(nearestCodeCellIndex).language;
|
|
669
|
-
} else {
|
|
670
|
-
language = defaultLanguage;
|
|
671
|
-
}
|
|
672
|
-
} else if (!cell && viewModel.length === 0) {
|
|
673
|
-
const lastKernels = kernelHistoryService?.getKernels(viewModel.notebookDocument);
|
|
674
|
-
if (lastKernels?.all.length) {
|
|
675
|
-
const lastKernel = lastKernels.all[0];
|
|
676
|
-
language = lastKernel.supportedLanguages[0] || defaultLanguage;
|
|
677
|
-
} else {
|
|
678
|
-
language = defaultLanguage;
|
|
679
|
-
}
|
|
680
|
-
} else {
|
|
681
|
-
if (cell === undefined && direction === "above") {
|
|
682
|
-
language = viewModel.viewCells.find(cell => cell.cellKind === CellKind.Code)?.language || defaultLanguage;
|
|
683
|
-
} else {
|
|
684
|
-
language = defaultLanguage;
|
|
685
|
-
}
|
|
686
|
-
}
|
|
687
|
-
if (!supportedLanguages.includes(language)) {
|
|
688
|
-
language = defaultLanguage;
|
|
689
|
-
}
|
|
690
|
-
} else {
|
|
691
|
-
language = "markdown";
|
|
692
|
-
}
|
|
693
|
-
const insertIndex = cell ? (direction === "above" ? index : nextIndex) : index;
|
|
694
|
-
return insertCellAtIndex(
|
|
695
|
-
viewModel,
|
|
696
|
-
insertIndex,
|
|
697
|
-
initialText,
|
|
698
|
-
language,
|
|
699
|
-
type,
|
|
700
|
-
undefined,
|
|
701
|
-
[],
|
|
702
|
-
true);
|
|
703
|
-
}
|
|
704
|
-
function insertCellAtIndex(
|
|
705
|
-
viewModel,
|
|
706
|
-
index,
|
|
707
|
-
source,
|
|
708
|
-
language,
|
|
709
|
-
type,
|
|
710
|
-
metadata,
|
|
711
|
-
outputs,
|
|
712
|
-
synchronous,
|
|
713
|
-
pushUndoStop
|
|
714
|
-
) {
|
|
715
|
-
const endSelections = {
|
|
716
|
-
kind: SelectionStateType.Index,
|
|
717
|
-
focus: {
|
|
718
|
-
start: index,
|
|
719
|
-
end: index + 1
|
|
720
|
-
},
|
|
721
|
-
selections: [{
|
|
722
|
-
start: index,
|
|
723
|
-
end: index + 1
|
|
724
|
-
}]
|
|
725
|
-
};
|
|
726
|
-
viewModel.notebookDocument.applyEdits([{
|
|
727
|
-
editType: CellEditType.Replace,
|
|
728
|
-
index,
|
|
729
|
-
count: 0,
|
|
730
|
-
cells: [{
|
|
731
|
-
cellKind: type,
|
|
732
|
-
language: language,
|
|
733
|
-
mime: undefined,
|
|
734
|
-
outputs: outputs,
|
|
735
|
-
metadata: metadata,
|
|
736
|
-
source: source
|
|
737
|
-
}]
|
|
738
|
-
}], synchronous, {
|
|
739
|
-
kind: SelectionStateType.Index,
|
|
740
|
-
focus: viewModel.getFocus(),
|
|
741
|
-
selections: viewModel.getSelections()
|
|
742
|
-
}, () => endSelections, undefined, !viewModel.options.isReadOnly);
|
|
743
|
-
return viewModel.cellAt(index);
|
|
744
|
-
}
|
|
745
|
-
|
|
746
|
-
export { changeCellToKind, computeCellLinesContents, copyCellRange, insertCell, insertCellAtIndex, joinCellsWithSurrounds, joinNotebookCells, joinSelectedCells, moveCellRange, runDeleteAction };
|