@codingame/monaco-vscode-api 11.1.0 → 11.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +8 -8
- package/vscode/src/vs/base/browser/ui/actionbar/actionViewItems.js +1 -1
- package/vscode/src/vs/base/browser/ui/button/button.js +1 -1
- package/vscode/src/vs/base/browser/ui/dialog/dialog.js +6 -6
- package/vscode/src/vs/base/browser/ui/dropdown/dropdownActionViewItem.js +1 -1
- package/vscode/src/vs/base/browser/ui/findinput/findInput.js +1 -1
- package/vscode/src/vs/base/browser/ui/findinput/findInputToggles.js +3 -3
- package/vscode/src/vs/base/browser/ui/hover/hoverWidget.js +2 -2
- package/vscode/src/vs/base/browser/ui/inputbox/inputBox.js +6 -6
- package/vscode/src/vs/base/browser/ui/keybindingLabel/keybindingLabel.js +1 -1
- package/vscode/src/vs/base/browser/ui/menu/menubar.js +1 -1
- package/vscode/src/vs/base/browser/ui/splitview/paneview.js +1 -1
- package/vscode/src/vs/base/browser/ui/toolbar/toolbar.js +1 -1
- package/vscode/src/vs/base/browser/ui/tree/abstractTree.js +9 -9
- package/vscode/src/vs/base/browser/ui/tree/treeDefaults.js +1 -1
- package/vscode/src/vs/base/common/date.js +61 -61
- package/vscode/src/vs/base/common/errorMessage.js +6 -15
- package/vscode/src/vs/base/common/jsonErrorMessages.js +9 -9
- package/vscode/src/vs/base/common/keybindingLabels.js +20 -20
- package/vscode/src/vs/editor/browser/controller/editContext/textArea/textAreaEditContext.js +1 -1
- package/vscode/src/vs/editor/browser/editorExtensions.js +6 -6
- package/vscode/src/vs/editor/browser/gpu/viewGpuContext.js +1 -1
- package/vscode/src/vs/editor/browser/services/hoverService/hoverWidget.js +1 -1
- package/vscode/src/vs/editor/browser/services/hoverService/updatableHoverWidget.js +1 -1
- package/vscode/src/vs/editor/browser/widget/diffEditor/commands.js +12 -12
- package/vscode/src/vs/editor/browser/widget/diffEditor/components/accessibleDiffViewer.js +14 -14
- package/vscode/src/vs/editor/browser/widget/diffEditor/components/diffEditorEditors.js +1 -1
- package/vscode/src/vs/editor/browser/widget/diffEditor/components/diffEditorViewZones/inlineDiffDeletedCodeMargin.js +7 -7
- package/vscode/src/vs/editor/browser/widget/diffEditor/features/hideUnchangedRegionsFeature.js +7 -7
- package/vscode/src/vs/editor/browser/widget/diffEditor/features/movedBlocksLinesFeature.js +4 -4
- package/vscode/src/vs/editor/browser/widget/diffEditor/features/revertButtonsFeature.js +2 -2
- package/vscode/src/vs/editor/browser/widget/diffEditor/registrations.contribution.js +5 -5
- package/vscode/src/vs/editor/browser/widget/multiDiffEditor/colors.js +3 -3
- package/vscode/src/vs/editor/browser/widget/multiDiffEditor/multiDiffEditorWidgetImpl.js +2 -2
- package/vscode/src/vs/editor/common/config/editorConfigurationSchema.js +51 -51
- package/vscode/src/vs/editor/common/config/editorOptions.js +364 -364
- package/vscode/src/vs/editor/common/core/editorColorRegistry.js +71 -71
- package/vscode/src/vs/editor/common/editorContextKeys.js +46 -46
- package/vscode/src/vs/editor/common/languages.js +27 -27
- package/vscode/src/vs/editor/common/model/editStack.js +1 -1
- package/vscode/src/vs/editor/common/standaloneStrings.js +32 -32
- package/vscode/src/vs/editor/common/viewLayout/viewLineRenderer.js +2 -2
- package/vscode/src/vs/editor/contrib/codeAction/browser/codeAction.js +1 -1
- package/vscode/src/vs/editor/contrib/codeAction/browser/codeActionCommands.js +28 -28
- package/vscode/src/vs/editor/contrib/codeAction/browser/codeActionContributions.js +3 -3
- package/vscode/src/vs/editor/contrib/codeAction/browser/codeActionController.js +3 -3
- package/vscode/src/vs/editor/contrib/codeAction/browser/codeActionMenu.js +8 -8
- package/vscode/src/vs/editor/contrib/codeAction/browser/lightBulbWidget.js +9 -9
- package/vscode/src/vs/editor/contrib/codelens/browser/codelensController.js +2 -2
- package/vscode/src/vs/editor/contrib/colorPicker/browser/hoverColorPicker/hoverColorPickerParticipant.js +1 -1
- package/vscode/src/vs/editor/contrib/colorPicker/browser/standaloneColorPicker/standaloneColorPickerActions.js +7 -7
- package/vscode/src/vs/editor/contrib/contextmenu/browser/contextmenu.js +10 -10
- package/vscode/src/vs/editor/contrib/cursorUndo/browser/cursorUndo.js +2 -2
- package/vscode/src/vs/editor/contrib/dropOrPasteInto/browser/copyPasteController.js +7 -7
- package/vscode/src/vs/editor/contrib/dropOrPasteInto/browser/defaultProviders.js +8 -8
- package/vscode/src/vs/editor/contrib/dropOrPasteInto/browser/dropIntoEditorController.js +3 -3
- package/vscode/src/vs/editor/contrib/dropOrPasteInto/browser/postEditWidget.js +2 -2
- package/vscode/src/vs/editor/contrib/editorState/browser/keybindingCancellation.js +1 -1
- package/vscode/src/vs/editor/contrib/find/browser/findWidget.js +27 -27
- package/vscode/src/vs/editor/contrib/folding/browser/foldingDecorations.js +9 -9
- package/vscode/src/vs/editor/contrib/gotoError/browser/gotoErrorWidget.js +14 -14
- package/vscode/src/vs/editor/contrib/gotoSymbol/browser/peek/referencesController.js +3 -3
- package/vscode/src/vs/editor/contrib/gotoSymbol/browser/peek/referencesTree.js +3 -3
- package/vscode/src/vs/editor/contrib/gotoSymbol/browser/peek/referencesWidget.js +3 -3
- package/vscode/src/vs/editor/contrib/gotoSymbol/browser/referencesModel.js +8 -8
- package/vscode/src/vs/editor/contrib/gotoSymbol/browser/symbolNavigation.js +3 -3
- package/vscode/src/vs/editor/contrib/hover/browser/hoverAccessibleViews.js +2 -2
- package/vscode/src/vs/editor/contrib/hover/browser/hoverActionIds.js +2 -2
- package/vscode/src/vs/editor/contrib/hover/browser/hoverActions.js +23 -23
- package/vscode/src/vs/editor/contrib/hover/browser/markdownHoverParticipant.js +9 -9
- package/vscode/src/vs/editor/contrib/hover/browser/markerHoverParticipant.js +5 -5
- package/vscode/src/vs/editor/contrib/inlayHints/browser/inlayHintsHover.js +8 -8
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/controller/commands.js +15 -15
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionContextKeys.js +8 -8
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/controller/inlineCompletionsController.js +1 -1
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/hintsWidget/hoverParticipant.js +2 -2
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/hintsWidget/inlineCompletionsHintsWidget.js +5 -5
- package/vscode/src/vs/editor/contrib/lineSelection/browser/lineSelection.js +1 -1
- package/vscode/src/vs/editor/contrib/linesOperations/browser/linesOperations.js +30 -30
- package/vscode/src/vs/editor/contrib/message/browser/messageController.js +1 -1
- package/vscode/src/vs/editor/contrib/parameterHints/browser/parameterHintsWidget.js +4 -4
- package/vscode/src/vs/editor/contrib/peekView/browser/peekView.js +17 -17
- package/vscode/src/vs/editor/contrib/quickAccess/browser/gotoLineQuickAccess.js +5 -5
- package/vscode/src/vs/editor/contrib/quickAccess/browser/gotoSymbolQuickAccess.js +32 -32
- package/vscode/src/vs/editor/contrib/rename/browser/renameWidget.js +6 -6
- package/vscode/src/vs/editor/contrib/snippet/browser/snippetVariables.js +4 -4
- package/vscode/src/vs/editor/contrib/stickyScroll/browser/stickyScrollActions.js +11 -11
- package/vscode/src/vs/editor/contrib/suggest/browser/suggest.js +8 -8
- package/vscode/src/vs/editor/contrib/suggest/browser/suggestWidget.js +16 -16
- package/vscode/src/vs/editor/contrib/suggest/browser/suggestWidgetDetails.js +2 -2
- package/vscode/src/vs/editor/contrib/suggest/browser/suggestWidgetRenderer.js +2 -2
- package/vscode/src/vs/editor/contrib/symbolIcons/browser/symbolIcons.js +33 -33
- package/vscode/src/vs/editor/contrib/tokenization/browser/tokenization.js +1 -1
- package/vscode/src/vs/editor/contrib/unicodeHighlighter/browser/unicodeHighlighter.js +24 -24
- package/vscode/src/vs/editor/contrib/unusualLineTerminators/browser/unusualLineTerminators.js +5 -5
- package/vscode/src/vs/editor/contrib/wordHighlighter/browser/highlightDecorations.js +9 -9
- package/vscode/src/vs/platform/accessibilitySignal/browser/accessibilitySignalService.js +49 -49
- package/vscode/src/vs/platform/action/common/actionCommonCategories.js +6 -6
- package/vscode/src/vs/platform/actionWidget/browser/actionWidget.js +7 -7
- package/vscode/src/vs/platform/actions/browser/menuEntryActionViewItem.js +5 -5
- package/vscode/src/vs/platform/actions/browser/toolbar.js +2 -2
- package/vscode/src/vs/platform/actions/common/menuResetAction.js +1 -1
- package/vscode/src/vs/platform/actions/common/menuService.js +2 -2
- package/vscode/src/vs/platform/contextkey/browser/contextKeyService.js +1 -1
- package/vscode/src/vs/platform/contextkey/common/contextkeys.js +9 -9
- package/vscode/src/vs/platform/contextkey/common/scanner.js +5 -5
- package/vscode/src/vs/platform/dialogs/common/dialogs.js +9 -9
- package/vscode/src/vs/platform/dnd/browser/dnd.js +1 -1
- package/vscode/src/vs/platform/extensionManagement/common/extensionManagement.js +2 -2
- package/vscode/src/vs/platform/extensionManagement/common/extensionNls.js +1 -1
- package/vscode/src/vs/platform/extensionManagement/common/extensionsScannerService.js +7 -7
- package/vscode/src/vs/platform/extensions/common/extensionValidator.js +20 -28
- package/vscode/src/vs/platform/files/browser/htmlFileSystemProvider.js +2 -2
- package/vscode/src/vs/platform/files/common/files.js +6 -6
- package/vscode/src/vs/platform/history/browser/contextScopedHistoryWidget.js +1 -1
- package/vscode/src/vs/platform/keybinding/common/abstractKeybindingService.js +4 -4
- package/vscode/src/vs/platform/languagePacks/common/languagePacks.js +1 -1
- package/vscode/src/vs/platform/languagePacks/common/localizedStrings.js +3 -3
- package/vscode/src/vs/platform/list/browser/listService.js +27 -27
- package/vscode/src/vs/platform/log/common/log.js +6 -6
- package/vscode/src/vs/platform/markers/common/markers.js +3 -3
- package/vscode/src/vs/platform/quickinput/browser/quickInput.js +8 -8
- package/vscode/src/vs/platform/quickinput/browser/quickInputActions.js +3 -3
- package/vscode/src/vs/platform/quickinput/browser/quickInputController.js +6 -6
- package/vscode/src/vs/platform/quickinput/browser/quickInputTree.js +1 -1
- package/vscode/src/vs/platform/quickinput/browser/quickInputUtils.js +1 -1
- package/vscode/src/vs/platform/request/common/request.js +14 -14
- package/vscode/src/vs/platform/terminal/common/terminalStrings.js +17 -0
- package/vscode/src/vs/platform/theme/common/colorUtils.js +2 -2
- package/vscode/src/vs/platform/theme/common/colors/baseColors.js +17 -17
- package/vscode/src/vs/platform/theme/common/colors/chartsColors.js +8 -8
- package/vscode/src/vs/platform/theme/common/colors/editorColors.js +94 -94
- package/vscode/src/vs/platform/theme/common/colors/inputColors.js +45 -45
- package/vscode/src/vs/platform/theme/common/colors/listColors.js +36 -36
- package/vscode/src/vs/platform/theme/common/colors/menuColors.js +7 -7
- package/vscode/src/vs/platform/theme/common/colors/minimapColors.js +11 -11
- package/vscode/src/vs/platform/theme/common/colors/miscColors.js +8 -8
- package/vscode/src/vs/platform/theme/common/colors/quickpickColors.js +9 -9
- package/vscode/src/vs/platform/theme/common/colors/searchColors.js +3 -3
- package/vscode/src/vs/platform/theme/common/iconRegistry.js +5 -5
- package/vscode/src/vs/platform/theme/common/tokenClassificationRegistry.js +42 -42
- package/vscode/src/vs/platform/undoRedo/common/undoRedoService.js +20 -20
- package/vscode/src/vs/platform/userDataProfile/common/userDataProfile.js +1 -1
- package/vscode/src/vs/platform/userDataSync/common/abstractSynchronizer.js +2 -2
- package/vscode/src/vs/platform/userDataSync/common/userDataSync.js +5 -5
- package/vscode/src/vs/platform/userDataSync/common/userDataSyncMachines.js +1 -1
- package/vscode/src/vs/platform/workspace/common/workspace.js +1 -1
- package/vscode/src/vs/workbench/api/common/extHostDiagnostics.js +1 -1
- package/vscode/src/vs/workbench/api/common/extHostExtensionService.js +2 -2
- package/vscode/src/vs/workbench/api/common/extHostLanguageFeatures.js +2 -2
- package/vscode/src/vs/workbench/api/common/extHostLanguageModels.js +1 -1
- package/vscode/src/vs/workbench/api/common/extHostLogService.js +1 -1
- package/vscode/src/vs/workbench/api/common/extHostNotebook.js +2 -2
- package/vscode/src/vs/workbench/api/common/extHostStatusBar.js +2 -2
- package/vscode/src/vs/workbench/api/common/extHostTelemetry.js +1 -1
- package/vscode/src/vs/workbench/api/common/extHostTerminalService.js +1 -1
- package/vscode/src/vs/workbench/api/common/extHostTreeViews.js +1 -1
- package/vscode/src/vs/workbench/api/common/extHostTunnelService.js +2 -2
- package/vscode/src/vs/workbench/api/common/extHostWorkspace.js +1 -1
- package/vscode/src/vs/workbench/api/common/jsonValidationExtensionPoint.js +12 -12
- package/vscode/src/vs/workbench/browser/actions/developerActions.js +31 -31
- package/vscode/src/vs/workbench/browser/actions/layoutActions.js +129 -129
- package/vscode/src/vs/workbench/browser/actions/textInputActions.js +6 -6
- package/vscode/src/vs/workbench/browser/actions/windowActions.js +25 -25
- package/vscode/src/vs/workbench/browser/actions/workspaceActions.js +21 -21
- package/vscode/src/vs/workbench/browser/actions/workspaceCommands.js +4 -4
- package/vscode/src/vs/workbench/browser/editor.js +2 -2
- package/vscode/src/vs/workbench/browser/labels.js +2 -2
- package/vscode/src/vs/workbench/browser/parts/auxiliarybar/auxiliaryBarActions.js +11 -11
- package/vscode/src/vs/workbench/browser/parts/compositeBarActions.js +11 -11
- package/vscode/src/vs/workbench/browser/parts/editor/binaryDiffEditor.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/editor/binaryEditor.js +3 -3
- package/vscode/src/vs/workbench/browser/parts/editor/diffEditorCommands.js +6 -6
- package/vscode/src/vs/workbench/browser/parts/editor/editorCommands.js +18 -18
- package/vscode/src/vs/workbench/browser/parts/editor/editorQuickAccess.js +5 -5
- package/vscode/src/vs/workbench/browser/parts/editor/editorStatus.js +61 -61
- package/vscode/src/vs/workbench/browser/parts/editor/editorTabsControl.js +2 -2
- package/vscode/src/vs/workbench/browser/parts/editor/sideBySideEditor.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/editor/textCodeEditor.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/editor/textDiffEditor.js +3 -3
- package/vscode/src/vs/workbench/browser/parts/globalCompositeBar.js +15 -15
- package/vscode/src/vs/workbench/browser/parts/panel/panelActions.js +34 -34
- package/vscode/src/vs/workbench/browser/parts/titlebar/menubarControl.js +18 -18
- package/vscode/src/vs/workbench/browser/parts/titlebar/titlebarActions.js +13 -13
- package/vscode/src/vs/workbench/browser/parts/titlebar/windowTitle.js +2 -2
- package/vscode/src/vs/workbench/browser/parts/views/checkbox.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/views/treeView.js +7 -7
- package/vscode/src/vs/workbench/browser/parts/views/viewFilter.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/views/viewPane.js +4 -4
- package/vscode/src/vs/workbench/browser/parts/views/viewPaneContainer.js +6 -6
- package/vscode/src/vs/workbench/browser/quickaccess.js +1 -1
- package/vscode/src/vs/workbench/browser/window.js +16 -16
- package/vscode/src/vs/workbench/browser/workbench.contribution.js +217 -217
- package/vscode/src/vs/workbench/common/configuration.js +10 -10
- package/vscode/src/vs/workbench/common/contextkeys.js +70 -70
- 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/theme.js +156 -156
- package/vscode/src/vs/workbench/common/views.js +4 -4
- package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibilityConfiguration.js +131 -131
- package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibleViewActions.js +12 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatConstants.js +7 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatContextKeys.js +25 -25
- package/vscode/src/vs/workbench/contrib/codeActions/browser/codeActionsContribution.js +15 -15
- package/vscode/src/vs/workbench/contrib/codeActions/common/codeActionsExtensionPoint.js +10 -10
- package/vscode/src/vs/workbench/contrib/codeActions/common/documentationExtensionPoint.js +6 -6
- 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/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.js +6 -6
- 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 +4 -4
- 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/comments/browser/commentsAccessibility.js +12 -12
- package/vscode/src/vs/workbench/contrib/comments/common/commentContextKeys.js +10 -10
- package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditorInput.js +3 -3
- package/vscode/src/vs/workbench/contrib/debug/browser/callStackEditorContribution.js +2 -2
- package/vscode/src/vs/workbench/contrib/debug/browser/debugColors.js +12 -12
- package/vscode/src/vs/workbench/contrib/debug/browser/debugIcons.js +57 -57
- package/vscode/src/vs/workbench/contrib/debug/common/abstractDebugAdapter.js +1 -1
- package/vscode/src/vs/workbench/contrib/debug/common/debug.js +63 -63
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsActions.js +173 -173
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsIcons.js +24 -24
- 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/externalUriOpener/common/configuration.js +4 -4
- package/vscode/src/vs/workbench/contrib/externalUriOpener/common/externalUriOpenerService.js +4 -4
- 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.js +84 -84
- package/vscode/src/vs/workbench/contrib/files/browser/fileCommands._save.js +4 -4
- package/vscode/src/vs/workbench/contrib/files/browser/fileConstants.js +6 -6
- package/vscode/src/vs/workbench/contrib/files/browser/fileImportExport.js +33 -33
- package/vscode/src/vs/workbench/contrib/files/browser/files.contribution._configuration.js +52 -52
- 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/explorerView.js +8 -8
- 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 +14 -14
- 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/logs/common/logsActions.js +12 -12
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorInput.js +1 -1
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorInputModel.js +29 -29
- package/vscode/src/vs/workbench/contrib/mergeEditor/common/mergeEditor.js +8 -8
- package/vscode/src/vs/workbench/contrib/multiDiffEditor/browser/icons.contribution.js +1 -1
- package/vscode/src/vs/workbench/contrib/multiDiffEditor/browser/multiDiffEditorInput.js +2 -2
- package/vscode/src/vs/workbench/contrib/multiDiffEditor/browser/scmMultiDiffSourceResolver.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/cellStatusBar/executionStatusBarItemController.js +6 -6
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/find/notebookFindWidget.js +3 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookEditor.js +8 -8
- 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 +12 -12
- package/vscode/src/vs/workbench/contrib/preferences/browser/preferencesWidgets.js +10 -10
- package/vscode/src/vs/workbench/contrib/preferences/browser/settingsLayout.js +50 -50
- package/vscode/src/vs/workbench/contrib/preferences/common/preferences.js +2 -2
- 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 +60 -60
- package/vscode/src/vs/workbench/contrib/scm/browser/dirtyDiffSwitcher.js +2 -2
- package/vscode/src/vs/workbench/contrib/scm/browser/dirtydiffDecorator.js +23 -23
- package/vscode/src/vs/workbench/contrib/scm/browser/scmHistory.js +13 -13
- package/vscode/src/vs/workbench/contrib/search/browser/anythingQuickAccess.js +15 -11
- package/vscode/src/vs/workbench/contrib/search/browser/searchActionsBase.js +1 -1
- package/vscode/src/vs/workbench/contrib/search/browser/searchActionsFind.js +10 -10
- package/vscode/src/vs/workbench/contrib/search/browser/searchActionsTopBar.js +8 -8
- package/vscode/src/vs/workbench/contrib/search/browser/searchIcons.js +20 -20
- package/vscode/src/vs/workbench/contrib/search/browser/symbolsQuickAccess.js +2 -2
- package/vscode/src/vs/workbench/contrib/snippets/browser/commands/abstractSnippetsActions.js +1 -1
- package/vscode/src/vs/workbench/contrib/snippets/browser/commands/fileTemplateSnippets.js +2 -2
- 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/taskDefinitionRegistry.js +5 -5
- package/vscode/src/vs/workbench/contrib/tasks/common/taskService.js +5 -5
- package/vscode/src/vs/workbench/contrib/tasks/common/tasks.js +3 -3
- package/vscode/src/vs/workbench/contrib/terminal/browser/detachedTerminal.js +3 -3
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminal.js +6 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalEditorInput.js +200 -0
- package/vscode/src/vs/workbench/contrib/terminal/common/terminalColorRegistry.js +23 -23
- package/vscode/src/vs/workbench/contrib/terminal/common/terminalContextKey.js +170 -0
- package/vscode/src/vs/workbench/contrib/testing/common/testResult.js +2 -2
- 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/webviewPanel/browser/webviewEditor.js +1 -1
- package/vscode/src/vs/workbench/contrib/workspace/common/workspace.js +2 -2
- package/vscode/src/vs/workbench/services/activity/common/activity.js +4 -4
- package/vscode/src/vs/workbench/services/authentication/browser/authenticationService.js +3 -3
- package/vscode/src/vs/workbench/services/auxiliaryWindow/browser/auxiliaryWindowService.js +5 -5
- 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 +15 -15
- package/vscode/src/vs/workbench/services/editor/common/editorResolverService.js +1 -1
- package/vscode/src/vs/workbench/services/extensionManagement/common/extensionManagement.js +1 -1
- package/vscode/src/vs/workbench/services/extensionRecommendations/common/workspaceExtensionsConfig.js +6 -6
- package/vscode/src/vs/workbench/services/extensions/common/extensionsRegistry.js +82 -82
- package/vscode/src/vs/workbench/services/filesConfiguration/common/filesConfigurationService.js +5 -5
- package/vscode/src/vs/workbench/services/language/common/languageService.js +28 -28
- 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 +2 -2
- 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 +22 -22
- 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/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 +11 -11
- package/vscode/src/vs/workbench/services/views/browser/viewsService.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.js +0 -166
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.js +0 -474
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.js +0 -942
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSession.js +0 -476
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.js +0 -288
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatStrategies.js +0 -521
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatZoneWidget.js +0 -253
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/utils.js +0 -64
|
@@ -1,942 +0,0 @@
|
|
|
1
|
-
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
-
import { alert } from '../../../../base/browser/ui/aria/aria.js';
|
|
3
|
-
import { Barrier, DeferredPromise, Queue } from '../../../../base/common/async.js';
|
|
4
|
-
import { CancellationTokenSource, CancellationToken } from '../../../../base/common/cancellation.js';
|
|
5
|
-
import { toErrorMessage } from '../../../../base/common/errorMessage.js';
|
|
6
|
-
import { onUnexpectedError } from '../../../../base/common/errors.js';
|
|
7
|
-
import { Emitter, Event } from '../../../../base/common/event.js';
|
|
8
|
-
import { Lazy } from '../../../../base/common/lazy.js';
|
|
9
|
-
import { DisposableStore, MutableDisposable, toDisposable } from '../../../../base/common/lifecycle.js';
|
|
10
|
-
import { MovingAverage } from '../../../../base/common/numbers.js';
|
|
11
|
-
import { isEqual } from '../../../../base/common/resources.js';
|
|
12
|
-
import { StopWatch } from '../../../../base/common/stopwatch.js';
|
|
13
|
-
import { assertType } from '../../../../base/common/types.js';
|
|
14
|
-
import { generateUuid } from '../../../../base/common/uuid.js';
|
|
15
|
-
import { isCodeEditor } from '../../../../editor/browser/editorBrowser.js';
|
|
16
|
-
import { Position } from '../../../../editor/common/core/position.js';
|
|
17
|
-
import { Range } from '../../../../editor/common/core/range.js';
|
|
18
|
-
import { Selection } from '../../../../editor/common/core/selection.js';
|
|
19
|
-
import { TextEdit } from '../../../../editor/common/languages.js';
|
|
20
|
-
import { IEditorWorkerService } from '../../../../editor/common/services/editorWorker.js';
|
|
21
|
-
import { DefaultModelSHA1Computer } from '../../../../editor/common/services/modelService.js';
|
|
22
|
-
import { InlineCompletionsController } from '../../../../editor/contrib/inlineCompletions/browser/controller/inlineCompletionsController.js';
|
|
23
|
-
import { MessageController } from '../../../../editor/contrib/message/browser/messageController.js';
|
|
24
|
-
import { localize } from '../../../../nls.js';
|
|
25
|
-
import { IConfigurationService } from '../../../../platform/configuration/common/configuration.service.js';
|
|
26
|
-
import { IContextKeyService } from '../../../../platform/contextkey/common/contextkey.service.js';
|
|
27
|
-
import { IDialogService } from '../../../../platform/dialogs/common/dialogs.service.js';
|
|
28
|
-
import { IInstantiationService } from '../../../../platform/instantiation/common/instantiation.js';
|
|
29
|
-
import { ILogService } from '../../../../platform/log/common/log.service.js';
|
|
30
|
-
import { showChatView } from '@codingame/monaco-vscode-chat-extensions-interactive-notebook-quickaccess-search-terminal-common/vscode/vs/workbench/contrib/chat/browser/chat';
|
|
31
|
-
import { ChatAgentLocation } from '../../chat/common/chatAgents.js';
|
|
32
|
-
import { IChatService } from '../../chat/common/chatService.service.js';
|
|
33
|
-
import { Session } from './inlineChatSession.js';
|
|
34
|
-
import { InlineChatError } from './inlineChatSessionServiceImpl.js';
|
|
35
|
-
import { LiveStrategy, PreviewStrategy } from './inlineChatStrategies.js';
|
|
36
|
-
import { INLINE_CHAT_ID, CTX_INLINE_CHAT_VISIBLE, CTX_INLINE_CHAT_EDITING, CTX_INLINE_CHAT_USER_DID_EDIT, CTX_INLINE_CHAT_RESPONSE_TYPE, CTX_INLINE_CHAT_REQUEST_IN_PROGRESS } from '@codingame/monaco-vscode-chat-extensions-interactive-notebook-quickaccess-search-terminal-common/vscode/vs/workbench/contrib/inlineChat/common/inlineChat';
|
|
37
|
-
import { INotebookEditorService } from '../../notebook/browser/services/notebookEditorService.service.js';
|
|
38
|
-
import { SIDE_GROUP } from '../../../services/editor/common/editorService.js';
|
|
39
|
-
import { IEditorService } from '../../../services/editor/common/editorService.service.js';
|
|
40
|
-
import { IViewsService } from '../../../services/views/common/viewsService.service.js';
|
|
41
|
-
import { IInlineChatSavingService } from './inlineChatSavingService.service.js';
|
|
42
|
-
import { IInlineChatSessionService } from './inlineChatSessionService.service.js';
|
|
43
|
-
import { InlineChatZoneWidget } from './inlineChatZoneWidget.js';
|
|
44
|
-
import { CONTEXT_RESPONSE, CONTEXT_RESPONSE_ERROR } from '../../chat/common/chatContextKeys.js';
|
|
45
|
-
|
|
46
|
-
var InlineChatController_1;
|
|
47
|
-
class InlineChatRunOptions {
|
|
48
|
-
static isInlineChatRunOptions(options) {
|
|
49
|
-
const { initialSelection, initialRange, message, autoSend, position, existingSession } = options;
|
|
50
|
-
if (typeof message !== 'undefined' && typeof message !== 'string'
|
|
51
|
-
|| typeof autoSend !== 'undefined' && typeof autoSend !== 'boolean'
|
|
52
|
-
|| typeof initialRange !== 'undefined' && !Range.isIRange(initialRange)
|
|
53
|
-
|| typeof initialSelection !== 'undefined' && !Selection.isISelection(initialSelection)
|
|
54
|
-
|| typeof position !== 'undefined' && !Position.isIPosition(position)
|
|
55
|
-
|| typeof existingSession !== 'undefined' && !(existingSession instanceof Session)) {
|
|
56
|
-
return false;
|
|
57
|
-
}
|
|
58
|
-
return true;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
let InlineChatController = InlineChatController_1 = class InlineChatController {
|
|
62
|
-
static get(editor) {
|
|
63
|
-
return editor.getContribution(INLINE_CHAT_ID);
|
|
64
|
-
}
|
|
65
|
-
get chatWidget() {
|
|
66
|
-
return this._ui.value.widget.chatWidget;
|
|
67
|
-
}
|
|
68
|
-
constructor(_editor, _instaService, _inlineChatSessionService, _inlineChatSavingService, _editorWorkerService, _logService, _configurationService, _dialogService, contextKeyService, _chatService, _editorService, notebookEditorService) {
|
|
69
|
-
this._editor = _editor;
|
|
70
|
-
this._instaService = _instaService;
|
|
71
|
-
this._inlineChatSessionService = _inlineChatSessionService;
|
|
72
|
-
this._inlineChatSavingService = _inlineChatSavingService;
|
|
73
|
-
this._editorWorkerService = _editorWorkerService;
|
|
74
|
-
this._logService = _logService;
|
|
75
|
-
this._configurationService = _configurationService;
|
|
76
|
-
this._dialogService = _dialogService;
|
|
77
|
-
this._chatService = _chatService;
|
|
78
|
-
this._editorService = _editorService;
|
|
79
|
-
this._isDisposed = false;
|
|
80
|
-
this._store = ( (new DisposableStore()));
|
|
81
|
-
this._messages = this._store.add(( (new Emitter())));
|
|
82
|
-
this._onDidEnterState = this._store.add(( (new Emitter())));
|
|
83
|
-
this.onDidEnterState = this._onDidEnterState.event;
|
|
84
|
-
this._onWillStartSession = this._store.add(( (new Emitter())));
|
|
85
|
-
this.onWillStartSession = this._onWillStartSession.event;
|
|
86
|
-
this._sessionStore = this._store.add(( (new DisposableStore())));
|
|
87
|
-
this._stashedSession = this._store.add(( (new MutableDisposable())));
|
|
88
|
-
this._forcedPlaceholder = undefined;
|
|
89
|
-
this._ctxVisible = CTX_INLINE_CHAT_VISIBLE.bindTo(contextKeyService);
|
|
90
|
-
this._ctxEditing = CTX_INLINE_CHAT_EDITING.bindTo(contextKeyService);
|
|
91
|
-
this._ctxUserDidEdit = CTX_INLINE_CHAT_USER_DID_EDIT.bindTo(contextKeyService);
|
|
92
|
-
this._ctxResponseType = CTX_INLINE_CHAT_RESPONSE_TYPE.bindTo(contextKeyService);
|
|
93
|
-
this._ctxRequestInProgress = CTX_INLINE_CHAT_REQUEST_IN_PROGRESS.bindTo(contextKeyService);
|
|
94
|
-
this._ctxResponse = CONTEXT_RESPONSE.bindTo(contextKeyService);
|
|
95
|
-
CONTEXT_RESPONSE_ERROR.bindTo(contextKeyService);
|
|
96
|
-
this._ui = ( (new Lazy(() => {
|
|
97
|
-
const location = {
|
|
98
|
-
location: ChatAgentLocation.Editor,
|
|
99
|
-
resolveData: () => {
|
|
100
|
-
assertType(this._editor.hasModel());
|
|
101
|
-
assertType(this._session);
|
|
102
|
-
return {
|
|
103
|
-
type: ChatAgentLocation.Editor,
|
|
104
|
-
selection: this._editor.getSelection(),
|
|
105
|
-
document: this._session.textModelN.uri,
|
|
106
|
-
wholeRange: this._session?.wholeRange.trackedInitialRange,
|
|
107
|
-
};
|
|
108
|
-
}
|
|
109
|
-
};
|
|
110
|
-
for (const notebookEditor of notebookEditorService.listNotebookEditors()) {
|
|
111
|
-
for (const [, codeEditor] of notebookEditor.codeEditors) {
|
|
112
|
-
if (codeEditor === this._editor) {
|
|
113
|
-
location.location = ChatAgentLocation.Notebook;
|
|
114
|
-
break;
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
return this._store.add(_instaService.createInstance(InlineChatZoneWidget, location, this._editor));
|
|
119
|
-
})));
|
|
120
|
-
this._store.add(this._editor.onDidChangeModel(async (e) => {
|
|
121
|
-
if (this._session || !e.newModelUrl) {
|
|
122
|
-
return;
|
|
123
|
-
}
|
|
124
|
-
const existingSession = this._inlineChatSessionService.getSession(this._editor, e.newModelUrl);
|
|
125
|
-
if (!existingSession) {
|
|
126
|
-
return;
|
|
127
|
-
}
|
|
128
|
-
this._log('session RESUMING after model change', e);
|
|
129
|
-
await this.run({ existingSession });
|
|
130
|
-
}));
|
|
131
|
-
this._store.add(this._inlineChatSessionService.onDidEndSession(e => {
|
|
132
|
-
if (e.session === this._session && e.endedByExternalCause) {
|
|
133
|
-
this._log('session ENDED by external cause');
|
|
134
|
-
this.finishExistingSession();
|
|
135
|
-
}
|
|
136
|
-
}));
|
|
137
|
-
this._store.add(this._inlineChatSessionService.onDidMoveSession(async (e) => {
|
|
138
|
-
if (e.editor === this._editor) {
|
|
139
|
-
this._log('session RESUMING after move', e);
|
|
140
|
-
await this.run({ existingSession: e.session });
|
|
141
|
-
}
|
|
142
|
-
}));
|
|
143
|
-
this._log(`NEW controller`);
|
|
144
|
-
}
|
|
145
|
-
dispose() {
|
|
146
|
-
if (this._currentRun) {
|
|
147
|
-
this._messages.fire(this._session?.chatModel.hasRequests
|
|
148
|
-
? 4
|
|
149
|
-
: 2 );
|
|
150
|
-
}
|
|
151
|
-
this._store.dispose();
|
|
152
|
-
this._isDisposed = true;
|
|
153
|
-
this._log('DISPOSED controller');
|
|
154
|
-
}
|
|
155
|
-
saveViewState() {
|
|
156
|
-
if (!this._ui.rawValue) {
|
|
157
|
-
return undefined;
|
|
158
|
-
}
|
|
159
|
-
const { selectedLanguageModelId } = this._ui.rawValue.widget.chatWidget.getViewState();
|
|
160
|
-
return { selectedLanguageModelId };
|
|
161
|
-
}
|
|
162
|
-
restoreViewState(state) {
|
|
163
|
-
this._uiInitViewState = state;
|
|
164
|
-
}
|
|
165
|
-
_log(message, ...more) {
|
|
166
|
-
if (message instanceof Error) {
|
|
167
|
-
this._logService.error(message, ...more);
|
|
168
|
-
}
|
|
169
|
-
else {
|
|
170
|
-
this._logService.trace(`[IE] (editor:${this._editor.getId()}) ${message}`, ...more);
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
getMessage() {
|
|
174
|
-
return this._ui.value.widget.responseContent;
|
|
175
|
-
}
|
|
176
|
-
getId() {
|
|
177
|
-
return INLINE_CHAT_ID;
|
|
178
|
-
}
|
|
179
|
-
_getMode() {
|
|
180
|
-
return this._configurationService.getValue("inlineChat.mode" );
|
|
181
|
-
}
|
|
182
|
-
getWidgetPosition() {
|
|
183
|
-
return this._ui.value.position;
|
|
184
|
-
}
|
|
185
|
-
async run(options = {}) {
|
|
186
|
-
try {
|
|
187
|
-
this.finishExistingSession();
|
|
188
|
-
if (this._currentRun) {
|
|
189
|
-
await this._currentRun;
|
|
190
|
-
}
|
|
191
|
-
if (options.initialSelection) {
|
|
192
|
-
this._editor.setSelection(options.initialSelection);
|
|
193
|
-
}
|
|
194
|
-
this._stashedSession.clear();
|
|
195
|
-
this._onWillStartSession.fire();
|
|
196
|
-
this._currentRun = this._nextState("CREATE_SESSION" , options);
|
|
197
|
-
await this._currentRun;
|
|
198
|
-
}
|
|
199
|
-
catch (error) {
|
|
200
|
-
this._log('error during run', error);
|
|
201
|
-
onUnexpectedError(error);
|
|
202
|
-
if (this._session) {
|
|
203
|
-
this._inlineChatSessionService.releaseSession(this._session);
|
|
204
|
-
}
|
|
205
|
-
this["PAUSE" ]();
|
|
206
|
-
}
|
|
207
|
-
finally {
|
|
208
|
-
this._currentRun = undefined;
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
async _nextState(state, options) {
|
|
212
|
-
let nextState = state;
|
|
213
|
-
while (nextState && !this._isDisposed) {
|
|
214
|
-
this._log('setState to ', nextState);
|
|
215
|
-
const p = this[nextState](options);
|
|
216
|
-
this._onDidEnterState.fire(nextState);
|
|
217
|
-
nextState = await p;
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
async ["CREATE_SESSION" ](options) {
|
|
221
|
-
assertType(this._session === undefined);
|
|
222
|
-
assertType(this._editor.hasModel());
|
|
223
|
-
let session = options.existingSession;
|
|
224
|
-
let initPosition;
|
|
225
|
-
if (options.position) {
|
|
226
|
-
initPosition = Position.lift(options.position).delta(-1);
|
|
227
|
-
delete options.position;
|
|
228
|
-
}
|
|
229
|
-
const widgetPosition = this._showWidget(options.headless ?? session?.headless, true, initPosition);
|
|
230
|
-
let errorMessage = ( localize(5714, "Failed to start editor chat"));
|
|
231
|
-
if (!session) {
|
|
232
|
-
const createSessionCts = ( (new CancellationTokenSource()));
|
|
233
|
-
const msgListener = Event.once(this._messages.event)(m => {
|
|
234
|
-
this._log('state=_createSession) message received', m);
|
|
235
|
-
if (m === 32 ) {
|
|
236
|
-
options.autoSend = true;
|
|
237
|
-
this._ui.value.widget.updateInfo(( localize(5715, "Getting ready...")));
|
|
238
|
-
}
|
|
239
|
-
else {
|
|
240
|
-
createSessionCts.cancel();
|
|
241
|
-
}
|
|
242
|
-
});
|
|
243
|
-
try {
|
|
244
|
-
session = await this._inlineChatSessionService.createSession(this._editor, { editMode: this._getMode(), wholeRange: options.initialRange }, createSessionCts.token);
|
|
245
|
-
}
|
|
246
|
-
catch (error) {
|
|
247
|
-
if (error instanceof InlineChatError || error?.name === InlineChatError.code) {
|
|
248
|
-
errorMessage = error.message;
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
createSessionCts.dispose();
|
|
252
|
-
msgListener.dispose();
|
|
253
|
-
if (createSessionCts.token.isCancellationRequested) {
|
|
254
|
-
if (session) {
|
|
255
|
-
this._inlineChatSessionService.releaseSession(session);
|
|
256
|
-
}
|
|
257
|
-
return "CANCEL" ;
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
delete options.initialRange;
|
|
261
|
-
delete options.existingSession;
|
|
262
|
-
if (!session) {
|
|
263
|
-
MessageController.get(this._editor)?.showMessage(errorMessage, widgetPosition);
|
|
264
|
-
this._log('Failed to start editor chat');
|
|
265
|
-
return "CANCEL" ;
|
|
266
|
-
}
|
|
267
|
-
await session.chatModel.waitForInitialization();
|
|
268
|
-
switch (session.editMode) {
|
|
269
|
-
case "preview" :
|
|
270
|
-
this._strategy = this._instaService.createInstance(PreviewStrategy, session, this._editor, this._ui.value);
|
|
271
|
-
break;
|
|
272
|
-
case "live" :
|
|
273
|
-
default:
|
|
274
|
-
this._strategy = this._instaService.createInstance(LiveStrategy, session, this._editor, this._ui.value, session.headless);
|
|
275
|
-
break;
|
|
276
|
-
}
|
|
277
|
-
this._session = session;
|
|
278
|
-
return "INIT_UI" ;
|
|
279
|
-
}
|
|
280
|
-
async ["INIT_UI" ](options) {
|
|
281
|
-
assertType(this._session);
|
|
282
|
-
assertType(this._strategy);
|
|
283
|
-
InlineCompletionsController.get(this._editor)?.hide();
|
|
284
|
-
this._sessionStore.clear();
|
|
285
|
-
const wholeRangeDecoration = this._editor.createDecorationsCollection();
|
|
286
|
-
const handleWholeRangeChange = () => {
|
|
287
|
-
const newDecorations = this._strategy?.getWholeRangeDecoration() ?? [];
|
|
288
|
-
wholeRangeDecoration.set(newDecorations);
|
|
289
|
-
this._ctxEditing.set(!this._session?.wholeRange.trackedInitialRange.isEmpty());
|
|
290
|
-
};
|
|
291
|
-
this._sessionStore.add(toDisposable(() => {
|
|
292
|
-
wholeRangeDecoration.clear();
|
|
293
|
-
this._ctxEditing.reset();
|
|
294
|
-
}));
|
|
295
|
-
this._sessionStore.add(this._session.wholeRange.onDidChange(handleWholeRangeChange));
|
|
296
|
-
handleWholeRangeChange();
|
|
297
|
-
this._ui.value.widget.setChatModel(this._session.chatModel, this._uiInitViewState);
|
|
298
|
-
this._uiInitViewState = undefined;
|
|
299
|
-
this._updatePlaceholder();
|
|
300
|
-
const isModelEmpty = !this._session.chatModel.hasRequests;
|
|
301
|
-
this._ui.value.widget.updateToolbar(true);
|
|
302
|
-
this._ui.value.widget.toggleStatus(!isModelEmpty);
|
|
303
|
-
this._showWidget(this._session.headless, isModelEmpty);
|
|
304
|
-
this._sessionStore.add(this._editor.onDidChangeModel((e) => {
|
|
305
|
-
const msg = this._session?.chatModel.hasRequests
|
|
306
|
-
? 4
|
|
307
|
-
: 2 ;
|
|
308
|
-
this._log('model changed, pause or cancel session', msg, e);
|
|
309
|
-
this._messages.fire(msg);
|
|
310
|
-
}));
|
|
311
|
-
const altVersionNow = this._editor.getModel()?.getAlternativeVersionId();
|
|
312
|
-
this._sessionStore.add(this._editor.onDidChangeModelContent(e => {
|
|
313
|
-
if (!this._session?.hunkData.ignoreTextModelNChanges) {
|
|
314
|
-
this._ctxUserDidEdit.set(altVersionNow !== this._editor.getModel()?.getAlternativeVersionId());
|
|
315
|
-
}
|
|
316
|
-
if (this._session?.hunkData.ignoreTextModelNChanges || this._strategy?.hasFocus()) {
|
|
317
|
-
return;
|
|
318
|
-
}
|
|
319
|
-
const wholeRange = this._session.wholeRange;
|
|
320
|
-
let shouldFinishSession = false;
|
|
321
|
-
if (this._configurationService.getValue("inlineChat.finishOnType" )) {
|
|
322
|
-
for (const { range } of e.changes) {
|
|
323
|
-
shouldFinishSession = !Range.areIntersectingOrTouching(range, wholeRange.value);
|
|
324
|
-
}
|
|
325
|
-
}
|
|
326
|
-
this._session.recordExternalEditOccurred(shouldFinishSession);
|
|
327
|
-
if (shouldFinishSession) {
|
|
328
|
-
this._log('text changed outside of whole range, FINISH session');
|
|
329
|
-
this.finishExistingSession();
|
|
330
|
-
}
|
|
331
|
-
}));
|
|
332
|
-
this._sessionStore.add(this._session.chatModel.onDidChange(async (e) => {
|
|
333
|
-
if (e.kind === 'removeRequest') {
|
|
334
|
-
await this._session.undoChangesUntil(e.requestId);
|
|
335
|
-
}
|
|
336
|
-
}));
|
|
337
|
-
const editState = this._createChatTextEditGroupState();
|
|
338
|
-
let didEdit = false;
|
|
339
|
-
for (const request of this._session.chatModel.getRequests()) {
|
|
340
|
-
if (!request.response) {
|
|
341
|
-
break;
|
|
342
|
-
}
|
|
343
|
-
for (const part of request.response.response.value) {
|
|
344
|
-
if (part.kind !== 'textEditGroup' || !isEqual(part.uri, this._session.textModelN.uri)) {
|
|
345
|
-
continue;
|
|
346
|
-
}
|
|
347
|
-
if (part.state?.applied) {
|
|
348
|
-
continue;
|
|
349
|
-
}
|
|
350
|
-
for (const edit of part.edits) {
|
|
351
|
-
this._makeChanges(edit, undefined, !didEdit);
|
|
352
|
-
didEdit = true;
|
|
353
|
-
}
|
|
354
|
-
part.state ??= editState;
|
|
355
|
-
}
|
|
356
|
-
}
|
|
357
|
-
if (didEdit) {
|
|
358
|
-
const diff = await this._editorWorkerService.computeDiff(this._session.textModel0.uri, this._session.textModelN.uri, { computeMoves: false, maxComputationTimeMs: Number.MAX_SAFE_INTEGER, ignoreTrimWhitespace: false }, 'advanced');
|
|
359
|
-
this._session.wholeRange.fixup(diff?.changes ?? []);
|
|
360
|
-
await this._session.hunkData.recompute(editState, diff);
|
|
361
|
-
this._updateCtxResponseType();
|
|
362
|
-
}
|
|
363
|
-
options.position = await this._strategy.renderChanges();
|
|
364
|
-
if (this._session.chatModel.requestInProgress) {
|
|
365
|
-
return "SHOW_REQUEST" ;
|
|
366
|
-
}
|
|
367
|
-
else {
|
|
368
|
-
return "WAIT_FOR_INPUT" ;
|
|
369
|
-
}
|
|
370
|
-
}
|
|
371
|
-
async ["WAIT_FOR_INPUT" ](options) {
|
|
372
|
-
assertType(this._session);
|
|
373
|
-
assertType(this._strategy);
|
|
374
|
-
this._updatePlaceholder();
|
|
375
|
-
if (options.message) {
|
|
376
|
-
this.updateInput(options.message);
|
|
377
|
-
alert(options.message);
|
|
378
|
-
delete options.message;
|
|
379
|
-
this._showWidget(this._session.headless, false);
|
|
380
|
-
}
|
|
381
|
-
let message = 0 ;
|
|
382
|
-
let request;
|
|
383
|
-
const barrier = ( (new Barrier()));
|
|
384
|
-
const store = ( (new DisposableStore()));
|
|
385
|
-
store.add(this._session.chatModel.onDidChange(e => {
|
|
386
|
-
if (e.kind === 'addRequest') {
|
|
387
|
-
request = e.request;
|
|
388
|
-
message = 32 ;
|
|
389
|
-
barrier.open();
|
|
390
|
-
}
|
|
391
|
-
}));
|
|
392
|
-
store.add(this._strategy.onDidAccept(() => this.acceptSession()));
|
|
393
|
-
store.add(this._strategy.onDidDiscard(() => this.cancelSession()));
|
|
394
|
-
store.add(Event.once(this._messages.event)(m => {
|
|
395
|
-
this._log('state=_waitForInput) message received', m);
|
|
396
|
-
message = m;
|
|
397
|
-
barrier.open();
|
|
398
|
-
}));
|
|
399
|
-
if (options.autoSend) {
|
|
400
|
-
delete options.autoSend;
|
|
401
|
-
this._showWidget(this._session.headless, false);
|
|
402
|
-
this._ui.value.widget.chatWidget.acceptInput();
|
|
403
|
-
}
|
|
404
|
-
await barrier.wait();
|
|
405
|
-
store.dispose();
|
|
406
|
-
if (message & ((16 | 2) )) {
|
|
407
|
-
return "CANCEL" ;
|
|
408
|
-
}
|
|
409
|
-
if (message & 4 ) {
|
|
410
|
-
return "PAUSE" ;
|
|
411
|
-
}
|
|
412
|
-
if (message & 1 ) {
|
|
413
|
-
this._ui.value.widget.selectAll(false);
|
|
414
|
-
return "DONE" ;
|
|
415
|
-
}
|
|
416
|
-
if (!request?.message.text) {
|
|
417
|
-
return "WAIT_FOR_INPUT" ;
|
|
418
|
-
}
|
|
419
|
-
return "SHOW_REQUEST" ;
|
|
420
|
-
}
|
|
421
|
-
async ["SHOW_REQUEST" ](options) {
|
|
422
|
-
assertType(this._session);
|
|
423
|
-
assertType(this._strategy);
|
|
424
|
-
assertType(this._session.chatModel.requestInProgress);
|
|
425
|
-
this._ctxRequestInProgress.set(true);
|
|
426
|
-
const { chatModel } = this._session;
|
|
427
|
-
const request = chatModel.lastRequest;
|
|
428
|
-
assertType(request);
|
|
429
|
-
assertType(request.response);
|
|
430
|
-
this._showWidget(this._session.headless, false);
|
|
431
|
-
this._ui.value.widget.selectAll(false);
|
|
432
|
-
this._ui.value.widget.updateInfo('');
|
|
433
|
-
this._ui.value.widget.toggleStatus(true);
|
|
434
|
-
const { response } = request;
|
|
435
|
-
const responsePromise = ( (new DeferredPromise()));
|
|
436
|
-
const store = ( (new DisposableStore()));
|
|
437
|
-
const progressiveEditsCts = store.add(( (new CancellationTokenSource())));
|
|
438
|
-
const progressiveEditsAvgDuration = ( (new MovingAverage()));
|
|
439
|
-
const progressiveEditsClock = StopWatch.create();
|
|
440
|
-
const progressiveEditsQueue = ( (new Queue()));
|
|
441
|
-
let next = "WAIT_FOR_INPUT" ;
|
|
442
|
-
store.add(Event.once(this._messages.event)(message => {
|
|
443
|
-
this._log('state=_makeRequest) message received', message);
|
|
444
|
-
this._chatService.cancelCurrentRequestForSession(chatModel.sessionId);
|
|
445
|
-
if (message & 2 ) {
|
|
446
|
-
next = "CANCEL" ;
|
|
447
|
-
}
|
|
448
|
-
else if (message & 4 ) {
|
|
449
|
-
next = "PAUSE" ;
|
|
450
|
-
}
|
|
451
|
-
else if (message & 1 ) {
|
|
452
|
-
next = "DONE" ;
|
|
453
|
-
}
|
|
454
|
-
}));
|
|
455
|
-
store.add(chatModel.onDidChange(async (e) => {
|
|
456
|
-
if (e.kind === 'removeRequest' && e.requestId === request.id) {
|
|
457
|
-
progressiveEditsCts.cancel();
|
|
458
|
-
responsePromise.complete();
|
|
459
|
-
if (e.reason === 1 ) {
|
|
460
|
-
next = "SHOW_REQUEST" ;
|
|
461
|
-
}
|
|
462
|
-
else {
|
|
463
|
-
next = "CANCEL" ;
|
|
464
|
-
}
|
|
465
|
-
return;
|
|
466
|
-
}
|
|
467
|
-
if (e.kind === 'move') {
|
|
468
|
-
assertType(this._session);
|
|
469
|
-
const log = (msg, ...args) => this._log('state=_showRequest) moving inline chat', msg, ...args);
|
|
470
|
-
log('move was requested', e.target, e.range);
|
|
471
|
-
const initialSelection = Selection.fromRange(Range.lift(e.range), 0 );
|
|
472
|
-
const editorPane = await this._editorService.openEditor({ resource: e.target, options: { selection: initialSelection } }, SIDE_GROUP);
|
|
473
|
-
if (!editorPane) {
|
|
474
|
-
log('opening editor failed');
|
|
475
|
-
return;
|
|
476
|
-
}
|
|
477
|
-
const newEditor = editorPane.getControl();
|
|
478
|
-
if (!isCodeEditor(newEditor) || !newEditor.hasModel()) {
|
|
479
|
-
log('new editor is either missing or not a code editor or does not have a model');
|
|
480
|
-
return;
|
|
481
|
-
}
|
|
482
|
-
if (this._inlineChatSessionService.getSession(newEditor, e.target)) {
|
|
483
|
-
log('new editor ALREADY has a session');
|
|
484
|
-
return;
|
|
485
|
-
}
|
|
486
|
-
const newSession = await this._inlineChatSessionService.createSession(newEditor, {
|
|
487
|
-
editMode: this._getMode(),
|
|
488
|
-
session: this._session,
|
|
489
|
-
}, CancellationToken.None);
|
|
490
|
-
InlineChatController_1.get(newEditor)?.run({ existingSession: newSession });
|
|
491
|
-
next = "CANCEL" ;
|
|
492
|
-
responsePromise.complete();
|
|
493
|
-
return;
|
|
494
|
-
}
|
|
495
|
-
}));
|
|
496
|
-
store.add(this._ui.value.widget.chatWidget.inputEditor.onDidChangeModelContent(() => {
|
|
497
|
-
this._chatService.cancelCurrentRequestForSession(chatModel.sessionId);
|
|
498
|
-
}));
|
|
499
|
-
let lastLength = 0;
|
|
500
|
-
let isFirstChange = true;
|
|
501
|
-
const editState = this._createChatTextEditGroupState();
|
|
502
|
-
let localEditGroup;
|
|
503
|
-
const handleResponse = () => {
|
|
504
|
-
this._updateCtxResponseType();
|
|
505
|
-
if (!localEditGroup) {
|
|
506
|
-
localEditGroup = response.response.value.find(part => part.kind === 'textEditGroup' && isEqual(part.uri, this._session?.textModelN.uri));
|
|
507
|
-
}
|
|
508
|
-
if (localEditGroup) {
|
|
509
|
-
localEditGroup.state ??= editState;
|
|
510
|
-
const edits = localEditGroup.edits;
|
|
511
|
-
const newEdits = edits.slice(lastLength);
|
|
512
|
-
if (newEdits.length > 0) {
|
|
513
|
-
this._log(`${this._session?.textModelN.uri.toString()} received ${newEdits.length} edits`);
|
|
514
|
-
lastLength = edits.length;
|
|
515
|
-
progressiveEditsAvgDuration.update(progressiveEditsClock.elapsed());
|
|
516
|
-
progressiveEditsClock.reset();
|
|
517
|
-
progressiveEditsQueue.queue(async () => {
|
|
518
|
-
const startThen = this._session.wholeRange.value.getStartPosition();
|
|
519
|
-
for (const edits of newEdits) {
|
|
520
|
-
await this._makeChanges(edits, {
|
|
521
|
-
duration: progressiveEditsAvgDuration.value,
|
|
522
|
-
token: progressiveEditsCts.token
|
|
523
|
-
}, isFirstChange);
|
|
524
|
-
isFirstChange = false;
|
|
525
|
-
}
|
|
526
|
-
const startNow = this._session.wholeRange.value.getStartPosition();
|
|
527
|
-
if (!startNow.equals(startThen) || !this._ui.value.position?.equals(startNow)) {
|
|
528
|
-
this._showWidget(this._session.headless, false, startNow.delta(-1));
|
|
529
|
-
}
|
|
530
|
-
});
|
|
531
|
-
}
|
|
532
|
-
}
|
|
533
|
-
if (response.isCanceled) {
|
|
534
|
-
progressiveEditsCts.cancel();
|
|
535
|
-
responsePromise.complete();
|
|
536
|
-
}
|
|
537
|
-
else if (response.isComplete) {
|
|
538
|
-
responsePromise.complete();
|
|
539
|
-
}
|
|
540
|
-
};
|
|
541
|
-
store.add(response.onDidChange(handleResponse));
|
|
542
|
-
handleResponse();
|
|
543
|
-
await responsePromise.p;
|
|
544
|
-
await progressiveEditsQueue.whenIdle();
|
|
545
|
-
if (response.result?.errorDetails) {
|
|
546
|
-
await this._session.undoChangesUntil(response.requestId);
|
|
547
|
-
}
|
|
548
|
-
store.dispose();
|
|
549
|
-
const diff = await this._editorWorkerService.computeDiff(this._session.textModel0.uri, this._session.textModelN.uri, { computeMoves: false, maxComputationTimeMs: Number.MAX_SAFE_INTEGER, ignoreTrimWhitespace: false }, 'advanced');
|
|
550
|
-
this._session.wholeRange.fixup(diff?.changes ?? []);
|
|
551
|
-
await this._session.hunkData.recompute(editState, diff);
|
|
552
|
-
this._ctxRequestInProgress.set(false);
|
|
553
|
-
let newPosition;
|
|
554
|
-
if (response.result?.errorDetails) ;
|
|
555
|
-
else if (response.response.value.length === 0) {
|
|
556
|
-
const status = ( localize(5716, "No results, please refine your input and try again"));
|
|
557
|
-
this._ui.value.widget.updateStatus(status, { classes: ['warn'] });
|
|
558
|
-
}
|
|
559
|
-
else {
|
|
560
|
-
this._ui.value.widget.updateStatus('');
|
|
561
|
-
}
|
|
562
|
-
const position = await this._strategy.renderChanges();
|
|
563
|
-
if (position) {
|
|
564
|
-
const selection = this._editor.getSelection();
|
|
565
|
-
if (selection?.containsPosition(position)) {
|
|
566
|
-
if (position.lineNumber - selection.startLineNumber > 8) {
|
|
567
|
-
newPosition = position;
|
|
568
|
-
}
|
|
569
|
-
}
|
|
570
|
-
else {
|
|
571
|
-
newPosition = position;
|
|
572
|
-
}
|
|
573
|
-
}
|
|
574
|
-
this._showWidget(this._session.headless, false, newPosition);
|
|
575
|
-
return next;
|
|
576
|
-
}
|
|
577
|
-
async ["PAUSE" ]() {
|
|
578
|
-
this._resetWidget();
|
|
579
|
-
this._strategy?.dispose?.();
|
|
580
|
-
this._session = undefined;
|
|
581
|
-
}
|
|
582
|
-
async ["DONE" ]() {
|
|
583
|
-
assertType(this._session);
|
|
584
|
-
assertType(this._strategy);
|
|
585
|
-
this._sessionStore.clear();
|
|
586
|
-
try {
|
|
587
|
-
await this._strategy.apply();
|
|
588
|
-
}
|
|
589
|
-
catch (err) {
|
|
590
|
-
this._dialogService.error(( localize(5717, "Failed to apply changes.", toErrorMessage(err))));
|
|
591
|
-
this._log('FAILED to apply changes');
|
|
592
|
-
this._log(err);
|
|
593
|
-
}
|
|
594
|
-
this._inlineChatSessionService.releaseSession(this._session);
|
|
595
|
-
this._resetWidget();
|
|
596
|
-
this._strategy?.dispose();
|
|
597
|
-
this._strategy = undefined;
|
|
598
|
-
this._session = undefined;
|
|
599
|
-
}
|
|
600
|
-
async ["CANCEL" ]() {
|
|
601
|
-
if (this._session) {
|
|
602
|
-
assertType(this._strategy);
|
|
603
|
-
this._sessionStore.clear();
|
|
604
|
-
const shouldStash = !this._session.isUnstashed && this._session.chatModel.hasRequests && this._session.hunkData.size === this._session.hunkData.pending;
|
|
605
|
-
let undoCancelEdits = [];
|
|
606
|
-
try {
|
|
607
|
-
undoCancelEdits = this._strategy.cancel();
|
|
608
|
-
}
|
|
609
|
-
catch (err) {
|
|
610
|
-
this._dialogService.error(( localize(5718, "Failed to discard changes.", toErrorMessage(err))));
|
|
611
|
-
this._log('FAILED to discard changes');
|
|
612
|
-
this._log(err);
|
|
613
|
-
}
|
|
614
|
-
this._stashedSession.clear();
|
|
615
|
-
if (shouldStash) {
|
|
616
|
-
this._stashedSession.value = this._inlineChatSessionService.stashSession(this._session, this._editor, undoCancelEdits);
|
|
617
|
-
}
|
|
618
|
-
else {
|
|
619
|
-
this._inlineChatSessionService.releaseSession(this._session);
|
|
620
|
-
}
|
|
621
|
-
}
|
|
622
|
-
this._resetWidget();
|
|
623
|
-
this._strategy?.dispose();
|
|
624
|
-
this._strategy = undefined;
|
|
625
|
-
this._session = undefined;
|
|
626
|
-
}
|
|
627
|
-
_showWidget(headless = false, initialRender = false, position) {
|
|
628
|
-
assertType(this._editor.hasModel());
|
|
629
|
-
this._ctxVisible.set(true);
|
|
630
|
-
let widgetPosition;
|
|
631
|
-
if (position) {
|
|
632
|
-
widgetPosition = position;
|
|
633
|
-
}
|
|
634
|
-
else if (this._ui.rawValue?.position) {
|
|
635
|
-
if (this._ui.rawValue?.position.lineNumber === 1) {
|
|
636
|
-
widgetPosition = this._ui.rawValue?.position.delta(-1);
|
|
637
|
-
}
|
|
638
|
-
else {
|
|
639
|
-
widgetPosition = this._ui.rawValue?.position;
|
|
640
|
-
}
|
|
641
|
-
}
|
|
642
|
-
else {
|
|
643
|
-
widgetPosition = this._editor.getSelection().getStartPosition().delta(-1);
|
|
644
|
-
}
|
|
645
|
-
if (this._session && !position && (this._session.hasChangedText || this._session.chatModel.hasRequests)) {
|
|
646
|
-
widgetPosition = this._session.wholeRange.trackedInitialRange.getStartPosition().delta(-1);
|
|
647
|
-
}
|
|
648
|
-
if (!headless) {
|
|
649
|
-
if (this._ui.rawValue?.position) {
|
|
650
|
-
this._ui.value.updatePositionAndHeight(widgetPosition);
|
|
651
|
-
}
|
|
652
|
-
else {
|
|
653
|
-
this._ui.value.show(widgetPosition);
|
|
654
|
-
}
|
|
655
|
-
}
|
|
656
|
-
return widgetPosition;
|
|
657
|
-
}
|
|
658
|
-
_resetWidget() {
|
|
659
|
-
this._sessionStore.clear();
|
|
660
|
-
this._ctxVisible.reset();
|
|
661
|
-
this._ctxUserDidEdit.reset();
|
|
662
|
-
this._ui.rawValue?.hide();
|
|
663
|
-
if (this._editor.hasWidgetFocus()) {
|
|
664
|
-
this._editor.focus();
|
|
665
|
-
}
|
|
666
|
-
}
|
|
667
|
-
_updateCtxResponseType() {
|
|
668
|
-
if (!this._session) {
|
|
669
|
-
this._ctxResponseType.set("none" );
|
|
670
|
-
return;
|
|
671
|
-
}
|
|
672
|
-
const hasLocalEdit = (response) => {
|
|
673
|
-
return (
|
|
674
|
-
(response.value.some(
|
|
675
|
-
part => part.kind === 'textEditGroup' && isEqual(part.uri, this._session?.textModelN.uri)
|
|
676
|
-
))
|
|
677
|
-
);
|
|
678
|
-
};
|
|
679
|
-
let responseType = "none" ;
|
|
680
|
-
for (const request of this._session.chatModel.getRequests()) {
|
|
681
|
-
if (!request.response) {
|
|
682
|
-
continue;
|
|
683
|
-
}
|
|
684
|
-
responseType = "messages" ;
|
|
685
|
-
if (hasLocalEdit(request.response.response)) {
|
|
686
|
-
responseType = "messagesAndEdits" ;
|
|
687
|
-
break;
|
|
688
|
-
}
|
|
689
|
-
}
|
|
690
|
-
this._ctxResponseType.set(responseType);
|
|
691
|
-
this._ctxResponse.set(responseType !== "none" );
|
|
692
|
-
}
|
|
693
|
-
_createChatTextEditGroupState() {
|
|
694
|
-
assertType(this._session);
|
|
695
|
-
const sha1 = ( (new DefaultModelSHA1Computer()));
|
|
696
|
-
const textModel0Sha1 = sha1.canComputeSHA1(this._session.textModel0)
|
|
697
|
-
? sha1.computeSHA1(this._session.textModel0)
|
|
698
|
-
: generateUuid();
|
|
699
|
-
return {
|
|
700
|
-
sha1: textModel0Sha1,
|
|
701
|
-
applied: 0
|
|
702
|
-
};
|
|
703
|
-
}
|
|
704
|
-
async _makeChanges(edits, opts, undoStopBefore) {
|
|
705
|
-
assertType(this._session);
|
|
706
|
-
assertType(this._strategy);
|
|
707
|
-
const moreMinimalEdits = await this._editorWorkerService.computeMoreMinimalEdits(this._session.textModelN.uri, edits);
|
|
708
|
-
this._log('edits from PROVIDER and after making them MORE MINIMAL', this._session.agent.extensionId, edits, moreMinimalEdits);
|
|
709
|
-
if (moreMinimalEdits?.length === 0) {
|
|
710
|
-
return;
|
|
711
|
-
}
|
|
712
|
-
const actualEdits = !opts && moreMinimalEdits ? moreMinimalEdits : edits;
|
|
713
|
-
const editOperations = ( (actualEdits.map(TextEdit.asEditOperation)));
|
|
714
|
-
const editsObserver = {
|
|
715
|
-
start: () => this._session.hunkData.ignoreTextModelNChanges = true,
|
|
716
|
-
stop: () => this._session.hunkData.ignoreTextModelNChanges = false,
|
|
717
|
-
};
|
|
718
|
-
this._inlineChatSavingService.markChanged(this._session);
|
|
719
|
-
if (opts) {
|
|
720
|
-
await this._strategy.makeProgressiveChanges(editOperations, editsObserver, opts, undoStopBefore);
|
|
721
|
-
}
|
|
722
|
-
else {
|
|
723
|
-
await this._strategy.makeChanges(editOperations, editsObserver, undoStopBefore);
|
|
724
|
-
}
|
|
725
|
-
}
|
|
726
|
-
_updatePlaceholder() {
|
|
727
|
-
this._ui.value.widget.placeholder = this._getPlaceholderText();
|
|
728
|
-
}
|
|
729
|
-
_getPlaceholderText() {
|
|
730
|
-
return this._forcedPlaceholder ?? this._session?.agent.description ?? '';
|
|
731
|
-
}
|
|
732
|
-
showSaveHint() {
|
|
733
|
-
if (!this._session) {
|
|
734
|
-
return;
|
|
735
|
-
}
|
|
736
|
-
const status = ( localize(5719, "Accept or discard changes to continue saving."));
|
|
737
|
-
this._ui.value.widget.updateStatus(status, { classes: ['warn'] });
|
|
738
|
-
if (this._ui.value.position) {
|
|
739
|
-
this._editor.revealLineInCenterIfOutsideViewport(this._ui.value.position.lineNumber);
|
|
740
|
-
}
|
|
741
|
-
else {
|
|
742
|
-
const hunk = this._session.hunkData.getInfo().find(info => info.getState() === 0 );
|
|
743
|
-
if (hunk) {
|
|
744
|
-
this._editor.revealLineInCenterIfOutsideViewport(hunk.getRangesN()[0].startLineNumber);
|
|
745
|
-
}
|
|
746
|
-
}
|
|
747
|
-
}
|
|
748
|
-
acceptInput() {
|
|
749
|
-
return this.chatWidget.acceptInput();
|
|
750
|
-
}
|
|
751
|
-
updateInput(text, selectAll = true) {
|
|
752
|
-
this._ui.value.widget.chatWidget.setInput(text);
|
|
753
|
-
if (selectAll) {
|
|
754
|
-
const newSelection = ( (new Selection(1, 1, Number.MAX_SAFE_INTEGER, 1)));
|
|
755
|
-
this._ui.value.widget.chatWidget.inputEditor.setSelection(newSelection);
|
|
756
|
-
}
|
|
757
|
-
}
|
|
758
|
-
cancelCurrentRequest() {
|
|
759
|
-
this._messages.fire(16 | 8 );
|
|
760
|
-
}
|
|
761
|
-
arrowOut(up) {
|
|
762
|
-
if (this._ui.value.position && this._editor.hasModel()) {
|
|
763
|
-
const { column } = this._editor.getPosition();
|
|
764
|
-
const { lineNumber } = this._ui.value.position;
|
|
765
|
-
const newLine = up ? lineNumber : lineNumber + 1;
|
|
766
|
-
this._editor.setPosition({ lineNumber: newLine, column });
|
|
767
|
-
this._editor.focus();
|
|
768
|
-
}
|
|
769
|
-
}
|
|
770
|
-
focus() {
|
|
771
|
-
this._ui.value.widget.focus();
|
|
772
|
-
}
|
|
773
|
-
hasFocus() {
|
|
774
|
-
return this._ui.value.widget.hasFocus();
|
|
775
|
-
}
|
|
776
|
-
async viewInChat() {
|
|
777
|
-
if (!this._strategy || !this._session) {
|
|
778
|
-
return;
|
|
779
|
-
}
|
|
780
|
-
let someApplied = false;
|
|
781
|
-
let lastEdit;
|
|
782
|
-
const uri = this._editor.getModel()?.uri;
|
|
783
|
-
const requests = this._session.chatModel.getRequests();
|
|
784
|
-
for (const request of requests) {
|
|
785
|
-
if (!request.response) {
|
|
786
|
-
continue;
|
|
787
|
-
}
|
|
788
|
-
for (const part of request.response.response.value) {
|
|
789
|
-
if (part.kind === 'textEditGroup' && isEqual(part.uri, uri)) {
|
|
790
|
-
someApplied = someApplied || Boolean(part.state?.applied);
|
|
791
|
-
lastEdit = part;
|
|
792
|
-
}
|
|
793
|
-
}
|
|
794
|
-
}
|
|
795
|
-
const doEdits = this._strategy.cancel();
|
|
796
|
-
if (someApplied) {
|
|
797
|
-
assertType(lastEdit);
|
|
798
|
-
lastEdit.edits = [doEdits];
|
|
799
|
-
lastEdit.state.applied = 0;
|
|
800
|
-
}
|
|
801
|
-
await this._instaService.invokeFunction(moveToPanelChat, this._session?.chatModel);
|
|
802
|
-
this.cancelSession();
|
|
803
|
-
}
|
|
804
|
-
acceptSession() {
|
|
805
|
-
const response = this._session?.chatModel.getRequests().at(-1)?.response;
|
|
806
|
-
if (response) {
|
|
807
|
-
this._chatService.notifyUserAction({
|
|
808
|
-
sessionId: response.session.sessionId,
|
|
809
|
-
requestId: response.requestId,
|
|
810
|
-
agentId: response.agent?.id,
|
|
811
|
-
command: response.slashCommand?.name,
|
|
812
|
-
result: response.result,
|
|
813
|
-
action: {
|
|
814
|
-
kind: 'inlineChat',
|
|
815
|
-
action: 'accepted'
|
|
816
|
-
}
|
|
817
|
-
});
|
|
818
|
-
}
|
|
819
|
-
this._messages.fire(1 );
|
|
820
|
-
}
|
|
821
|
-
acceptHunk(hunkInfo) {
|
|
822
|
-
return this._strategy?.performHunkAction(hunkInfo, 0 );
|
|
823
|
-
}
|
|
824
|
-
discardHunk(hunkInfo) {
|
|
825
|
-
return this._strategy?.performHunkAction(hunkInfo, 1 );
|
|
826
|
-
}
|
|
827
|
-
toggleDiff(hunkInfo) {
|
|
828
|
-
return this._strategy?.performHunkAction(hunkInfo, 4 );
|
|
829
|
-
}
|
|
830
|
-
moveHunk(next) {
|
|
831
|
-
this.focus();
|
|
832
|
-
this._strategy?.performHunkAction(undefined, next ? 2 : 3 );
|
|
833
|
-
}
|
|
834
|
-
async cancelSession() {
|
|
835
|
-
const response = this._session?.chatModel.lastRequest?.response;
|
|
836
|
-
if (response) {
|
|
837
|
-
this._chatService.notifyUserAction({
|
|
838
|
-
sessionId: response.session.sessionId,
|
|
839
|
-
requestId: response.requestId,
|
|
840
|
-
agentId: response.agent?.id,
|
|
841
|
-
command: response.slashCommand?.name,
|
|
842
|
-
result: response.result,
|
|
843
|
-
action: {
|
|
844
|
-
kind: 'inlineChat',
|
|
845
|
-
action: 'discarded'
|
|
846
|
-
}
|
|
847
|
-
});
|
|
848
|
-
}
|
|
849
|
-
this._messages.fire(2 );
|
|
850
|
-
}
|
|
851
|
-
finishExistingSession() {
|
|
852
|
-
if (this._session) {
|
|
853
|
-
if (this._session.editMode === "preview" ) {
|
|
854
|
-
this._log('finishing existing session, using CANCEL', this._session.editMode);
|
|
855
|
-
this.cancelSession();
|
|
856
|
-
}
|
|
857
|
-
else {
|
|
858
|
-
this._log('finishing existing session, using APPLY', this._session.editMode);
|
|
859
|
-
this.acceptSession();
|
|
860
|
-
}
|
|
861
|
-
}
|
|
862
|
-
}
|
|
863
|
-
reportIssue() {
|
|
864
|
-
const response = this._session?.chatModel.lastRequest?.response;
|
|
865
|
-
if (response) {
|
|
866
|
-
this._chatService.notifyUserAction({
|
|
867
|
-
sessionId: response.session.sessionId,
|
|
868
|
-
requestId: response.requestId,
|
|
869
|
-
agentId: response.agent?.id,
|
|
870
|
-
command: response.slashCommand?.name,
|
|
871
|
-
result: response.result,
|
|
872
|
-
action: { kind: 'bug' }
|
|
873
|
-
});
|
|
874
|
-
}
|
|
875
|
-
}
|
|
876
|
-
unstashLastSession() {
|
|
877
|
-
const result = this._stashedSession.value?.unstash();
|
|
878
|
-
if (result) {
|
|
879
|
-
this._inlineChatSavingService.markChanged(result);
|
|
880
|
-
}
|
|
881
|
-
return result;
|
|
882
|
-
}
|
|
883
|
-
joinCurrentRun() {
|
|
884
|
-
return this._currentRun;
|
|
885
|
-
}
|
|
886
|
-
async reviewEdits(anchor, stream, token) {
|
|
887
|
-
if (!this._editor.hasModel()) {
|
|
888
|
-
return false;
|
|
889
|
-
}
|
|
890
|
-
const session = await this._inlineChatSessionService.createSession(this._editor, { editMode: "live" , wholeRange: anchor, headless: true }, token);
|
|
891
|
-
if (!session) {
|
|
892
|
-
return false;
|
|
893
|
-
}
|
|
894
|
-
const request = session.chatModel.addRequest({ text: 'DUMMY', parts: [] }, { variables: [] }, 0);
|
|
895
|
-
const run = this.run({
|
|
896
|
-
existingSession: session,
|
|
897
|
-
headless: true
|
|
898
|
-
});
|
|
899
|
-
await Event.toPromise(Event.filter(this._onDidEnterState.event, candidate => candidate === "SHOW_REQUEST" ));
|
|
900
|
-
for await (const chunk of stream) {
|
|
901
|
-
session.chatModel.acceptResponseProgress(request, { kind: 'textEdit', uri: this._editor.getModel().uri, edits: chunk });
|
|
902
|
-
}
|
|
903
|
-
if (token.isCancellationRequested) {
|
|
904
|
-
session.chatModel.cancelRequest(request);
|
|
905
|
-
}
|
|
906
|
-
else {
|
|
907
|
-
session.chatModel.completeResponse(request);
|
|
908
|
-
}
|
|
909
|
-
await Event.toPromise(Event.filter(this._onDidEnterState.event, candidate => candidate === "WAIT_FOR_INPUT" ));
|
|
910
|
-
if (session.hunkData.pending === 0) {
|
|
911
|
-
this.cancelSession();
|
|
912
|
-
}
|
|
913
|
-
await run;
|
|
914
|
-
return true;
|
|
915
|
-
}
|
|
916
|
-
};
|
|
917
|
-
InlineChatController = InlineChatController_1 = ( (__decorate([
|
|
918
|
-
( (__param(1, IInstantiationService))),
|
|
919
|
-
( (__param(2, IInlineChatSessionService))),
|
|
920
|
-
( (__param(3, IInlineChatSavingService))),
|
|
921
|
-
( (__param(4, IEditorWorkerService))),
|
|
922
|
-
( (__param(5, ILogService))),
|
|
923
|
-
( (__param(6, IConfigurationService))),
|
|
924
|
-
( (__param(7, IDialogService))),
|
|
925
|
-
( (__param(8, IContextKeyService))),
|
|
926
|
-
( (__param(9, IChatService))),
|
|
927
|
-
( (__param(10, IEditorService))),
|
|
928
|
-
( (__param(11, INotebookEditorService)))
|
|
929
|
-
], InlineChatController)));
|
|
930
|
-
async function moveToPanelChat(accessor, model) {
|
|
931
|
-
const viewsService = accessor.get(IViewsService);
|
|
932
|
-
const chatService = accessor.get(IChatService);
|
|
933
|
-
const widget = await showChatView(viewsService);
|
|
934
|
-
if (widget && widget.viewModel && model) {
|
|
935
|
-
for (const request of model.getRequests().slice()) {
|
|
936
|
-
await chatService.adoptRequest(widget.viewModel.model.sessionId, request);
|
|
937
|
-
}
|
|
938
|
-
widget.focusLastMessage();
|
|
939
|
-
}
|
|
940
|
-
}
|
|
941
|
-
|
|
942
|
-
export { InlineChatController, InlineChatRunOptions };
|