@codingame/monaco-vscode-api 10.1.0 → 10.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +137 -305
- package/package.json +8 -15
- package/vscode/src/vs/base/browser/ui/actionbar/actionViewItems.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/tree/abstractTree.js +9 -9
- package/vscode/src/vs/base/browser/ui/tree/treeDefaults.js +1 -1
- package/vscode/src/vs/base/common/actions.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/base/common/worker/simpleWorkerBootstrap.js +23 -0
- package/vscode/src/vs/editor/browser/controller/editContext/textArea/textAreaEditContext.js +1 -1
- package/vscode/src/vs/editor/browser/coreCommands.js +3 -3
- 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/codeEditor/codeEditorWidget.js +2 -2
- 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/diffEditor.contribution.js +5 -5
- 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 +368 -368
- package/vscode/src/vs/editor/common/core/editorColorRegistry.js +71 -71
- package/vscode/src/vs/editor/common/languages/modesRegistry.js +1 -1
- package/vscode/src/vs/editor/common/model/editStack.js +1 -1
- package/vscode/src/vs/editor/common/services/editorWorkerBootstrap.js +3 -8
- 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/anchorSelect/browser/anchorSelect.js +6 -6
- package/vscode/src/vs/editor/contrib/bracketMatching/browser/bracketMatching.js +6 -6
- package/vscode/src/vs/editor/contrib/caretOperations/browser/caretOperations.js +2 -2
- package/vscode/src/vs/editor/contrib/caretOperations/browser/transpose.js +1 -1
- package/vscode/src/vs/editor/contrib/clipboard/browser/clipboard.js +17 -17
- 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/comment/browser/comment.js +6 -6
- 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/copyPasteContribution.js +3 -3
- 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/dropIntoEditorContribution.js +1 -1
- 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/findController.js +16 -16
- package/vscode/src/vs/editor/contrib/find/browser/findWidget.js +27 -27
- package/vscode/src/vs/editor/contrib/fontZoom/browser/fontZoom.js +3 -3
- package/vscode/src/vs/editor/contrib/format/browser/formatActions.js +2 -2
- package/vscode/src/vs/editor/contrib/gotoError/browser/gotoError.js +8 -8
- package/vscode/src/vs/editor/contrib/gotoError/browser/gotoErrorWidget.js +14 -14
- package/vscode/src/vs/editor/contrib/gotoSymbol/browser/goToCommands.js +39 -39
- package/vscode/src/vs/editor/contrib/gotoSymbol/browser/link/goToDefinitionAtPosition.js +1 -1
- 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/gpu/browser/gpuActions.js +4 -4
- 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/inPlaceReplace/browser/inPlaceReplace.js +2 -2
- package/vscode/src/vs/editor/contrib/indentation/browser/indentation.js +20 -20
- package/vscode/src/vs/editor/contrib/inlayHints/browser/inlayHintsHover.js +8 -8
- package/vscode/src/vs/editor/contrib/inlineCompletions/browser/controller/commands.js +14 -14
- 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/linkedEditing/browser/linkedEditing.js +2 -2
- package/vscode/src/vs/editor/contrib/links/browser/links.js +10 -10
- package/vscode/src/vs/editor/contrib/message/browser/messageController.js +1 -1
- package/vscode/src/vs/editor/contrib/multicursor/browser/multicursor.js +22 -22
- package/vscode/src/vs/editor/contrib/parameterHints/browser/parameterHints.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/placeholderText/browser/placeholderText.contribution.js +1 -1
- 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/readOnlyMessage/browser/contribution.js +2 -2
- package/vscode/src/vs/editor/contrib/rename/browser/rename.js +11 -11
- package/vscode/src/vs/editor/contrib/rename/browser/renameWidget.js +6 -6
- package/vscode/src/vs/editor/contrib/smartSelect/browser/smartSelect.js +4 -4
- package/vscode/src/vs/editor/contrib/snippet/browser/snippetController2.js +4 -4
- 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/suggestController.js +10 -10
- 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/toggleTabFocusMode/browser/toggleTabFocusMode.js +4 -4
- 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/editor/contrib/wordHighlighter/browser/wordHighlighter.js +3 -3
- package/vscode/src/vs/editor/contrib/wordOperations/browser/wordOperations.js +1 -1
- 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/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 +11 -7
- package/vscode/src/vs/platform/extensions/common/extensionValidator.js +20 -20
- 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/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/quickInputController.js +6 -6
- package/vscode/src/vs/platform/request/common/request.js +14 -14
- 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/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/userDataSync/common/userDataSync.js +5 -5
- 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/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/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/breadcrumbs.js +41 -41
- package/vscode/src/vs/workbench/browser/parts/editor/diffEditorCommands.js +6 -6
- package/vscode/src/vs/workbench/browser/parts/editor/editorActions.js +131 -131
- package/vscode/src/vs/workbench/browser/parts/editor/editorCommands.js +16 -16
- 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/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/notifications/notificationsActions.js +17 -17
- package/vscode/src/vs/workbench/browser/parts/notifications/notificationsAlerts.js +3 -3
- package/vscode/src/vs/workbench/browser/parts/notifications/notificationsCenter.js +6 -6
- package/vscode/src/vs/workbench/browser/parts/notifications/notificationsCommands.js +9 -9
- package/vscode/src/vs/workbench/browser/parts/notifications/notificationsList.js +6 -6
- package/vscode/src/vs/workbench/browser/parts/notifications/notificationsStatus.js +13 -13
- package/vscode/src/vs/workbench/browser/parts/notifications/notificationsToasts.js +2 -2
- package/vscode/src/vs/workbench/browser/parts/notifications/notificationsViewer.js +4 -4
- package/vscode/src/vs/workbench/browser/parts/titlebar/menubarControl.js +18 -18
- 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/workbench.contribution.js +217 -220
- package/vscode/src/vs/workbench/common/configuration.js +10 -10
- 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/views.js +4 -4
- package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibilityConfiguration.js +131 -131
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatActions.js +17 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatConstants.js +5 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatExecuteActions.js +7 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatTitleActions.js +8 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/chat.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatAccessibilityProvider.js +9 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/chatAgentHover.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatAttachmentsContentPart.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatCodeCitationContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatCommandContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatConfirmationContentPart.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatReferencesContentPart.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatTextEditContentPart.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatToolInvocationPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatContentParts/chatTreeContentPart.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDragAndDrop.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditingService.js +13 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditorInput.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatFollowups.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatImagePaste.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatInlineAnchorWidget.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/chatInputPart.js +12 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/chatListRenderer.js +12 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/chatWidget.js +3 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/codeBlockPart.js +15 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatDynamicVariables.js +4 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatDynamicVariablesConstant.js +2 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputCompletions.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatColors.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/common/chatContextKeys.js +21 -21
- package/vscode/src/vs/workbench/contrib/chat/common/chatModel.js +3 -3
- 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/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/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/browser/commentsController.js +5 -5
- 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 +13 -13
- 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/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 +65 -65
- 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/debugCommands.js +34 -34
- 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/common/debug.js +63 -63
- 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/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/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/fileConstants.js +6 -6
- 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/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/inlineChat/browser/inlineChatActions.js +19 -19
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.js +6 -6
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatZoneWidget.js +1 -1
- package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.js +41 -41
- 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/mergeEditor/browser/mergeEditorInput.js +1 -1
- 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/find/notebookFindWidget.js +3 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/cellOperations.js +2 -2
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebookChatContext.js +5 -5
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/coreActions.js +4 -4
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookAccessibilityProvider.js +4 -4
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookEditorWidget.js +24 -24
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookIcons.js +28 -28
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCell.js +2 -2
- 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 +2 -2
- 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/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/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 +5 -1
- package/vscode/src/vs/workbench/contrib/search/browser/searchActionsFind.js +10 -10
- 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/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/terminalContrib/chat/browser/terminalChatControllerHolder.js +5 -0
- 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/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/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/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/views/browser/viewsService.js +7 -7
- package/vscode/src/vs/workbench/services/workingCopy/common/storedFileWorkingCopy.js +17 -17
- package/workers/editor.worker.js +1 -1
- package/vscode/src/vs/base/common/processes.js +0 -25
- package/vscode/src/vs/platform/terminal/common/capabilities/bufferMarkCapability.js +0 -41
- package/vscode/src/vs/platform/terminal/common/capabilities/commandDetection/promptInputModel.js +0 -345
- package/vscode/src/vs/platform/terminal/common/capabilities/commandDetection/terminalCommand.js +0 -296
- package/vscode/src/vs/platform/terminal/common/capabilities/commandDetectionCapability.js +0 -761
- package/vscode/src/vs/platform/terminal/common/capabilities/cwdDetectionCapability.js +0 -29
- package/vscode/src/vs/platform/terminal/common/capabilities/naiveCwdDetectionCapability.js +0 -22
- package/vscode/src/vs/platform/terminal/common/capabilities/partialCommandDetectionCapability.js +0 -48
- package/vscode/src/vs/platform/terminal/common/capabilities/terminalCapabilityStore.js +0 -94
- package/vscode/src/vs/platform/terminal/common/environmentVariable.js +0 -7
- package/vscode/src/vs/platform/terminal/common/environmentVariableCollection.js +0 -196
- package/vscode/src/vs/platform/terminal/common/terminalEnvironment.js +0 -40
- package/vscode/src/vs/platform/terminal/common/terminalProfiles.js +0 -107
- package/vscode/src/vs/platform/terminal/common/terminalRecorder.js +0 -67
- package/vscode/src/vs/platform/terminal/common/xterm/shellIntegrationAddon.js +0 -346
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.js +0 -167
- package/vscode/src/vs/workbench/contrib/terminal/browser/environmentVariableInfo.js +0 -119
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalActions.js +0 -1770
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalContextMenu.js +0 -40
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalExtensions.js +0 -25
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalIconPicker.js +0 -72
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalIcons.js +0 -16
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalInstance.js +0 -2218
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalProcessManager.js +0 -628
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalQuickAccess.js +0 -143
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalResizeDebouncer.js +0 -61
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalRunRecentQuickPick.js +0 -315
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalStatusList.js +0 -121
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalUri.js +0 -39
- package/vscode/src/vs/workbench/contrib/terminal/browser/widgets/widgetManager.js +0 -36
- package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/decorationAddon.js +0 -498
- package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/decorationStyles.js +0 -123
- package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/lineDataEventAddon.js +0 -55
- package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/markNavigationAddon.js +0 -571
- package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/xtermTerminal.js +0 -732
- package/vscode/src/vs/workbench/contrib/terminal/common/history.js +0 -378
- package/vscode/src/vs/workbench/contrib/terminal/common/terminalClipboard.js +0 -80
- package/vscode/src/vs/workbench/contrib/terminal/common/terminalEnvironment.js +0 -282
- package/vscode/src/vs/workbench/contrib/terminal/common/terminalStrings.js +0 -36
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/media/terminalChatWidget.css.js +0 -4
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChat.js +0 -46
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatController.js +0 -303
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatWidget.js +0 -203
- package/vscode/src/vs/workbench/contrib/terminalContrib/stickyScroll/browser/media/stickyScroll.css.js +0 -4
- package/vscode/src/vs/workbench/contrib/terminalContrib/stickyScroll/browser/terminalStickyScrollColorRegistry.js +0 -22
- package/vscode/src/vs/workbench/contrib/terminalContrib/stickyScroll/browser/terminalStickyScrollContribution.js +0 -97
- package/vscode/src/vs/workbench/contrib/terminalContrib/stickyScroll/browser/terminalStickyScrollOverlay.js +0 -372
package/vscode/src/vs/platform/terminal/common/capabilities/commandDetection/promptInputModel.js
DELETED
|
@@ -1,345 +0,0 @@
|
|
|
1
|
-
import { __decorate, __param } from '../../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
-
import { Emitter, Event } from '../../../../../base/common/event.js';
|
|
3
|
-
import { Disposable } from '../../../../../base/common/lifecycle.js';
|
|
4
|
-
import { LogLevel } from '../../../../log/common/log.js';
|
|
5
|
-
import { ILogService } from '../../../../log/common/log.service.js';
|
|
6
|
-
import { throttle } from '../../../../../base/common/decorators.js';
|
|
7
|
-
let PromptInputModel = class PromptInputModel extends Disposable {
|
|
8
|
-
get value() { return this._value; }
|
|
9
|
-
get prefix() { return this._value.substring(0, this._cursorIndex); }
|
|
10
|
-
get suffix() { return this._value.substring(this._cursorIndex, this._ghostTextIndex === -1 ? undefined : this._ghostTextIndex); }
|
|
11
|
-
get cursorIndex() { return this._cursorIndex; }
|
|
12
|
-
get ghostTextIndex() { return this._ghostTextIndex; }
|
|
13
|
-
constructor(_xterm, onCommandStart, onCommandExecuted, _logService) {
|
|
14
|
-
super();
|
|
15
|
-
this._xterm = _xterm;
|
|
16
|
-
this._logService = _logService;
|
|
17
|
-
this._state = 0 ;
|
|
18
|
-
this._commandStartX = 0;
|
|
19
|
-
this._lastUserInput = '';
|
|
20
|
-
this._value = '';
|
|
21
|
-
this._cursorIndex = 0;
|
|
22
|
-
this._ghostTextIndex = -1;
|
|
23
|
-
this._onDidStartInput = this._register(( new Emitter()));
|
|
24
|
-
this.onDidStartInput = this._onDidStartInput.event;
|
|
25
|
-
this._onDidChangeInput = this._register(( new Emitter()));
|
|
26
|
-
this.onDidChangeInput = this._onDidChangeInput.event;
|
|
27
|
-
this._onDidFinishInput = this._register(( new Emitter()));
|
|
28
|
-
this.onDidFinishInput = this._onDidFinishInput.event;
|
|
29
|
-
this._onDidInterrupt = this._register(( new Emitter()));
|
|
30
|
-
this.onDidInterrupt = this._onDidInterrupt.event;
|
|
31
|
-
this._register(Event.any(this._xterm.onCursorMove, this._xterm.onData, this._xterm.onWriteParsed)(() => this._sync()));
|
|
32
|
-
this._register(this._xterm.onData(e => this._handleUserInput(e)));
|
|
33
|
-
this._register(onCommandStart(e => this._handleCommandStart(e)));
|
|
34
|
-
this._register(onCommandExecuted(() => this._handleCommandExecuted()));
|
|
35
|
-
this._register(this.onDidStartInput(() => this._logCombinedStringIfTrace('PromptInputModel#onDidStartInput')));
|
|
36
|
-
this._register(this.onDidChangeInput(() => this._logCombinedStringIfTrace('PromptInputModel#onDidChangeInput')));
|
|
37
|
-
this._register(this.onDidFinishInput(() => this._logCombinedStringIfTrace('PromptInputModel#onDidFinishInput')));
|
|
38
|
-
this._register(this.onDidInterrupt(() => this._logCombinedStringIfTrace('PromptInputModel#onDidInterrupt')));
|
|
39
|
-
}
|
|
40
|
-
_logCombinedStringIfTrace(message) {
|
|
41
|
-
if (this._logService.getLevel() === LogLevel.Trace) {
|
|
42
|
-
this._logService.trace(message, this.getCombinedString());
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
setContinuationPrompt(value) {
|
|
46
|
-
this._continuationPrompt = value;
|
|
47
|
-
this._sync();
|
|
48
|
-
}
|
|
49
|
-
setLastPromptLine(value) {
|
|
50
|
-
this._lastPromptLine = value;
|
|
51
|
-
this._sync();
|
|
52
|
-
}
|
|
53
|
-
setConfidentCommandLine(value) {
|
|
54
|
-
if (this._value !== value) {
|
|
55
|
-
this._value = value;
|
|
56
|
-
this._cursorIndex = -1;
|
|
57
|
-
this._ghostTextIndex = -1;
|
|
58
|
-
this._onDidChangeInput.fire(this._createStateObject());
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
getCombinedString() {
|
|
62
|
-
const value = this._value.replaceAll('\n', '\u23CE');
|
|
63
|
-
if (this._cursorIndex === -1) {
|
|
64
|
-
return value;
|
|
65
|
-
}
|
|
66
|
-
let result = `${value.substring(0, this.cursorIndex)}|`;
|
|
67
|
-
if (this.ghostTextIndex !== -1) {
|
|
68
|
-
result += `${value.substring(this.cursorIndex, this.ghostTextIndex)}[`;
|
|
69
|
-
result += `${value.substring(this.ghostTextIndex)}]`;
|
|
70
|
-
}
|
|
71
|
-
else {
|
|
72
|
-
result += value.substring(this.cursorIndex);
|
|
73
|
-
}
|
|
74
|
-
return result;
|
|
75
|
-
}
|
|
76
|
-
serialize() {
|
|
77
|
-
return {
|
|
78
|
-
modelState: this._createStateObject(),
|
|
79
|
-
commandStartX: this._commandStartX,
|
|
80
|
-
lastPromptLine: this._lastPromptLine,
|
|
81
|
-
continuationPrompt: this._continuationPrompt,
|
|
82
|
-
lastUserInput: this._lastUserInput
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
deserialize(serialized) {
|
|
86
|
-
this._value = serialized.modelState.value;
|
|
87
|
-
this._cursorIndex = serialized.modelState.cursorIndex;
|
|
88
|
-
this._ghostTextIndex = serialized.modelState.ghostTextIndex;
|
|
89
|
-
this._commandStartX = serialized.commandStartX;
|
|
90
|
-
this._lastPromptLine = serialized.lastPromptLine;
|
|
91
|
-
this._continuationPrompt = serialized.continuationPrompt;
|
|
92
|
-
this._lastUserInput = serialized.lastUserInput;
|
|
93
|
-
}
|
|
94
|
-
_handleCommandStart(command) {
|
|
95
|
-
if (this._state === 1 ) {
|
|
96
|
-
return;
|
|
97
|
-
}
|
|
98
|
-
this._state = 1 ;
|
|
99
|
-
this._commandStartMarker = command.marker;
|
|
100
|
-
this._commandStartX = this._xterm.buffer.active.cursorX;
|
|
101
|
-
this._value = '';
|
|
102
|
-
this._cursorIndex = 0;
|
|
103
|
-
this._onDidStartInput.fire(this._createStateObject());
|
|
104
|
-
this._onDidChangeInput.fire(this._createStateObject());
|
|
105
|
-
if (this._lastPromptLine) {
|
|
106
|
-
if (this._commandStartX !== this._lastPromptLine.length) {
|
|
107
|
-
const line = this._xterm.buffer.active.getLine(this._commandStartMarker.line);
|
|
108
|
-
if (line?.translateToString(true).startsWith(this._lastPromptLine)) {
|
|
109
|
-
this._commandStartX = this._lastPromptLine.length;
|
|
110
|
-
this._sync();
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
_handleCommandExecuted() {
|
|
116
|
-
if (this._state === 2 ) {
|
|
117
|
-
return;
|
|
118
|
-
}
|
|
119
|
-
this._cursorIndex = -1;
|
|
120
|
-
if (this._ghostTextIndex !== -1) {
|
|
121
|
-
this._value = this._value.substring(0, this._ghostTextIndex);
|
|
122
|
-
this._ghostTextIndex = -1;
|
|
123
|
-
}
|
|
124
|
-
const event = this._createStateObject();
|
|
125
|
-
if (this._lastUserInput === '\u0003') {
|
|
126
|
-
this._lastUserInput = '';
|
|
127
|
-
this._onDidInterrupt.fire(event);
|
|
128
|
-
}
|
|
129
|
-
this._state = 2 ;
|
|
130
|
-
this._onDidFinishInput.fire(event);
|
|
131
|
-
this._onDidChangeInput.fire(event);
|
|
132
|
-
}
|
|
133
|
-
_sync() {
|
|
134
|
-
try {
|
|
135
|
-
this._doSync();
|
|
136
|
-
}
|
|
137
|
-
catch (e) {
|
|
138
|
-
this._logService.error('Error while syncing prompt input model', e);
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
_doSync() {
|
|
142
|
-
if (this._state !== 1 ) {
|
|
143
|
-
return;
|
|
144
|
-
}
|
|
145
|
-
const commandStartY = this._commandStartMarker?.line;
|
|
146
|
-
if (commandStartY === undefined) {
|
|
147
|
-
return;
|
|
148
|
-
}
|
|
149
|
-
const buffer = this._xterm.buffer.active;
|
|
150
|
-
let line = buffer.getLine(commandStartY);
|
|
151
|
-
const commandLine = line?.translateToString(true, this._commandStartX);
|
|
152
|
-
if (!line || commandLine === undefined) {
|
|
153
|
-
this._logService.trace(`PromptInputModel#_sync: no line`);
|
|
154
|
-
return;
|
|
155
|
-
}
|
|
156
|
-
const absoluteCursorY = buffer.baseY + buffer.cursorY;
|
|
157
|
-
let value = commandLine;
|
|
158
|
-
let ghostTextIndex = -1;
|
|
159
|
-
let cursorIndex;
|
|
160
|
-
if (absoluteCursorY === commandStartY) {
|
|
161
|
-
cursorIndex = this._getRelativeCursorIndex(this._commandStartX, buffer, line);
|
|
162
|
-
}
|
|
163
|
-
else {
|
|
164
|
-
cursorIndex = commandLine.trimEnd().length;
|
|
165
|
-
}
|
|
166
|
-
if (absoluteCursorY === commandStartY && buffer.cursorX > 1) {
|
|
167
|
-
ghostTextIndex = this._scanForGhostText(buffer, line, cursorIndex);
|
|
168
|
-
}
|
|
169
|
-
for (let y = commandStartY + 1; y <= absoluteCursorY; y++) {
|
|
170
|
-
line = buffer.getLine(y);
|
|
171
|
-
const lineText = line?.translateToString(true);
|
|
172
|
-
if (lineText && line) {
|
|
173
|
-
if (line.isWrapped) {
|
|
174
|
-
value += lineText;
|
|
175
|
-
const relativeCursorIndex = this._getRelativeCursorIndex(0, buffer, line);
|
|
176
|
-
if (absoluteCursorY === y) {
|
|
177
|
-
cursorIndex += relativeCursorIndex;
|
|
178
|
-
}
|
|
179
|
-
else {
|
|
180
|
-
cursorIndex += lineText.length;
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
else if (this._continuationPrompt === undefined || this._lineContainsContinuationPrompt(lineText)) {
|
|
184
|
-
const trimmedLineText = this._trimContinuationPrompt(lineText);
|
|
185
|
-
value += `\n${trimmedLineText}`;
|
|
186
|
-
if (absoluteCursorY === y) {
|
|
187
|
-
const continuationCellWidth = this._getContinuationPromptCellWidth(line, lineText);
|
|
188
|
-
const relativeCursorIndex = this._getRelativeCursorIndex(continuationCellWidth, buffer, line);
|
|
189
|
-
cursorIndex += relativeCursorIndex + 1;
|
|
190
|
-
}
|
|
191
|
-
else {
|
|
192
|
-
cursorIndex += trimmedLineText.length + 1;
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
else {
|
|
196
|
-
break;
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
for (let y = absoluteCursorY + 1; y < buffer.baseY + this._xterm.rows; y++) {
|
|
201
|
-
line = buffer.getLine(y);
|
|
202
|
-
const lineText = line?.translateToString(true);
|
|
203
|
-
if (lineText && line) {
|
|
204
|
-
if (this._continuationPrompt === undefined || this._lineContainsContinuationPrompt(lineText)) {
|
|
205
|
-
value += `\n${this._trimContinuationPrompt(lineText)}`;
|
|
206
|
-
}
|
|
207
|
-
else {
|
|
208
|
-
break;
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
else {
|
|
212
|
-
break;
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
if (this._logService.getLevel() === LogLevel.Trace) {
|
|
216
|
-
this._logService.trace(`PromptInputModel#_sync: ${this.getCombinedString()}`);
|
|
217
|
-
}
|
|
218
|
-
{
|
|
219
|
-
let trailingWhitespace = this._value.length - this._value.trimEnd().length;
|
|
220
|
-
if (this._lastUserInput === '\x7F') {
|
|
221
|
-
this._lastUserInput = '';
|
|
222
|
-
if (cursorIndex === this._cursorIndex - 1) {
|
|
223
|
-
if (this._value.trimEnd().length > value.trimEnd().length && value.trimEnd().length <= cursorIndex) {
|
|
224
|
-
trailingWhitespace = Math.max((this._value.length - 1) - value.trimEnd().length, 0);
|
|
225
|
-
}
|
|
226
|
-
else {
|
|
227
|
-
trailingWhitespace = Math.max(trailingWhitespace - 1, 0);
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
if (this._lastUserInput === '\x1b[3~') {
|
|
232
|
-
this._lastUserInput = '';
|
|
233
|
-
if (cursorIndex === this._cursorIndex) {
|
|
234
|
-
trailingWhitespace = Math.max(trailingWhitespace - 1, 0);
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
const valueLines = value.split('\n');
|
|
238
|
-
const isMultiLine = valueLines.length > 1;
|
|
239
|
-
const valueEndTrimmed = value.trimEnd();
|
|
240
|
-
if (!isMultiLine) {
|
|
241
|
-
if (valueEndTrimmed.length < value.length) {
|
|
242
|
-
if (this._lastUserInput === ' ') {
|
|
243
|
-
this._lastUserInput = '';
|
|
244
|
-
if (cursorIndex > valueEndTrimmed.length && cursorIndex > this._cursorIndex) {
|
|
245
|
-
trailingWhitespace++;
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
trailingWhitespace = Math.max(cursorIndex - valueEndTrimmed.length, trailingWhitespace, 0);
|
|
249
|
-
}
|
|
250
|
-
const charBeforeCursor = cursorIndex === 0 ? '' : value[cursorIndex - 1];
|
|
251
|
-
if (trailingWhitespace > 0 && cursorIndex === this._cursorIndex + 1 && this._lastUserInput !== '' && charBeforeCursor !== ' ') {
|
|
252
|
-
trailingWhitespace = this._value.length - this._cursorIndex;
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
if (isMultiLine) {
|
|
256
|
-
valueLines[valueLines.length - 1] = valueLines.at(-1)?.trimEnd() ?? '';
|
|
257
|
-
const continuationOffset = (valueLines.length - 1) * (this._continuationPrompt?.length ?? 0);
|
|
258
|
-
trailingWhitespace = Math.max(0, cursorIndex - value.length - continuationOffset);
|
|
259
|
-
}
|
|
260
|
-
value = ( valueLines.map(e => e.trimEnd())).join('\n') + ' '.repeat(trailingWhitespace);
|
|
261
|
-
}
|
|
262
|
-
if (this._value !== value || this._cursorIndex !== cursorIndex || this._ghostTextIndex !== ghostTextIndex) {
|
|
263
|
-
this._value = value;
|
|
264
|
-
this._cursorIndex = cursorIndex;
|
|
265
|
-
this._ghostTextIndex = ghostTextIndex;
|
|
266
|
-
this._onDidChangeInput.fire(this._createStateObject());
|
|
267
|
-
}
|
|
268
|
-
}
|
|
269
|
-
_handleUserInput(e) {
|
|
270
|
-
this._lastUserInput = e;
|
|
271
|
-
}
|
|
272
|
-
_scanForGhostText(buffer, line, cursorIndex) {
|
|
273
|
-
let ghostTextIndex = -1;
|
|
274
|
-
let proceedWithGhostTextCheck = false;
|
|
275
|
-
let x = buffer.cursorX;
|
|
276
|
-
while (x > 0) {
|
|
277
|
-
const cell = line.getCell(--x);
|
|
278
|
-
if (!cell) {
|
|
279
|
-
break;
|
|
280
|
-
}
|
|
281
|
-
if (cell.getChars().trim().length > 0) {
|
|
282
|
-
proceedWithGhostTextCheck = !this._isCellStyledLikeGhostText(cell);
|
|
283
|
-
break;
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
if (proceedWithGhostTextCheck) {
|
|
287
|
-
let potentialGhostIndexOffset = 0;
|
|
288
|
-
let x = buffer.cursorX;
|
|
289
|
-
while (x < line.length) {
|
|
290
|
-
const cell = line.getCell(x++);
|
|
291
|
-
if (!cell || cell.getCode() === 0) {
|
|
292
|
-
break;
|
|
293
|
-
}
|
|
294
|
-
if (this._isCellStyledLikeGhostText(cell)) {
|
|
295
|
-
ghostTextIndex = cursorIndex + potentialGhostIndexOffset;
|
|
296
|
-
break;
|
|
297
|
-
}
|
|
298
|
-
potentialGhostIndexOffset += cell.getChars().length;
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
return ghostTextIndex;
|
|
302
|
-
}
|
|
303
|
-
_trimContinuationPrompt(lineText) {
|
|
304
|
-
if (this._lineContainsContinuationPrompt(lineText)) {
|
|
305
|
-
lineText = lineText.substring(this._continuationPrompt.length);
|
|
306
|
-
}
|
|
307
|
-
return lineText;
|
|
308
|
-
}
|
|
309
|
-
_lineContainsContinuationPrompt(lineText) {
|
|
310
|
-
return !!(this._continuationPrompt && lineText.startsWith(this._continuationPrompt));
|
|
311
|
-
}
|
|
312
|
-
_getContinuationPromptCellWidth(line, lineText) {
|
|
313
|
-
if (!this._continuationPrompt || !lineText.startsWith(this._continuationPrompt)) {
|
|
314
|
-
return 0;
|
|
315
|
-
}
|
|
316
|
-
let buffer = '';
|
|
317
|
-
let x = 0;
|
|
318
|
-
while (buffer !== this._continuationPrompt) {
|
|
319
|
-
buffer += line.getCell(x++).getChars();
|
|
320
|
-
}
|
|
321
|
-
return x;
|
|
322
|
-
}
|
|
323
|
-
_getRelativeCursorIndex(startCellX, buffer, line) {
|
|
324
|
-
return line?.translateToString(true, startCellX, buffer.cursorX).length ?? 0;
|
|
325
|
-
}
|
|
326
|
-
_isCellStyledLikeGhostText(cell) {
|
|
327
|
-
return !!(cell.isItalic() || cell.isDim());
|
|
328
|
-
}
|
|
329
|
-
_createStateObject() {
|
|
330
|
-
return ( Object.freeze({
|
|
331
|
-
value: this._value,
|
|
332
|
-
prefix: this.prefix,
|
|
333
|
-
suffix: this.suffix,
|
|
334
|
-
cursorIndex: this._cursorIndex,
|
|
335
|
-
ghostTextIndex: this._ghostTextIndex
|
|
336
|
-
}));
|
|
337
|
-
}
|
|
338
|
-
};
|
|
339
|
-
PromptInputModel.__decorator = ( __decorate([
|
|
340
|
-
throttle(0)
|
|
341
|
-
], PromptInputModel.prototype, "_sync", null));
|
|
342
|
-
PromptInputModel = ( __decorate([
|
|
343
|
-
( __param(3, ILogService))
|
|
344
|
-
], PromptInputModel));
|
|
345
|
-
export { PromptInputModel };
|
package/vscode/src/vs/platform/terminal/common/capabilities/commandDetection/terminalCommand.js
DELETED
|
@@ -1,296 +0,0 @@
|
|
|
1
|
-
class TerminalCommand {
|
|
2
|
-
get command() { return this._properties.command; }
|
|
3
|
-
get commandLineConfidence() { return this._properties.commandLineConfidence; }
|
|
4
|
-
get isTrusted() { return this._properties.isTrusted; }
|
|
5
|
-
get timestamp() { return this._properties.timestamp; }
|
|
6
|
-
get duration() { return this._properties.duration; }
|
|
7
|
-
get promptStartMarker() { return this._properties.promptStartMarker; }
|
|
8
|
-
get marker() { return this._properties.marker; }
|
|
9
|
-
get endMarker() { return this._properties.endMarker; }
|
|
10
|
-
set endMarker(value) { this._properties.endMarker = value; }
|
|
11
|
-
get executedMarker() { return this._properties.executedMarker; }
|
|
12
|
-
get aliases() { return this._properties.aliases; }
|
|
13
|
-
get wasReplayed() { return this._properties.wasReplayed; }
|
|
14
|
-
get cwd() { return this._properties.cwd; }
|
|
15
|
-
get exitCode() { return this._properties.exitCode; }
|
|
16
|
-
get commandStartLineContent() { return this._properties.commandStartLineContent; }
|
|
17
|
-
get markProperties() { return this._properties.markProperties; }
|
|
18
|
-
get executedX() { return this._properties.executedX; }
|
|
19
|
-
get startX() { return this._properties.startX; }
|
|
20
|
-
constructor(_xterm, _properties) {
|
|
21
|
-
this._xterm = _xterm;
|
|
22
|
-
this._properties = _properties;
|
|
23
|
-
}
|
|
24
|
-
static deserialize(xterm, serialized, isCommandStorageDisabled) {
|
|
25
|
-
const buffer = xterm.buffer.normal;
|
|
26
|
-
const marker = serialized.startLine !== undefined ? xterm.registerMarker(serialized.startLine - (buffer.baseY + buffer.cursorY)) : undefined;
|
|
27
|
-
if (!marker) {
|
|
28
|
-
return undefined;
|
|
29
|
-
}
|
|
30
|
-
const promptStartMarker = serialized.promptStartLine !== undefined ? xterm.registerMarker(serialized.promptStartLine - (buffer.baseY + buffer.cursorY)) : undefined;
|
|
31
|
-
const endMarker = serialized.endLine !== undefined ? xterm.registerMarker(serialized.endLine - (buffer.baseY + buffer.cursorY)) : undefined;
|
|
32
|
-
const executedMarker = serialized.executedLine !== undefined ? xterm.registerMarker(serialized.executedLine - (buffer.baseY + buffer.cursorY)) : undefined;
|
|
33
|
-
const newCommand = ( new TerminalCommand(xterm, {
|
|
34
|
-
command: isCommandStorageDisabled ? '' : serialized.command,
|
|
35
|
-
commandLineConfidence: serialized.commandLineConfidence ?? 'low',
|
|
36
|
-
isTrusted: serialized.isTrusted,
|
|
37
|
-
promptStartMarker,
|
|
38
|
-
marker,
|
|
39
|
-
startX: serialized.startX,
|
|
40
|
-
endMarker,
|
|
41
|
-
executedMarker,
|
|
42
|
-
executedX: serialized.executedX,
|
|
43
|
-
timestamp: serialized.timestamp,
|
|
44
|
-
duration: serialized.duration,
|
|
45
|
-
cwd: serialized.cwd,
|
|
46
|
-
commandStartLineContent: serialized.commandStartLineContent,
|
|
47
|
-
exitCode: serialized.exitCode,
|
|
48
|
-
markProperties: serialized.markProperties,
|
|
49
|
-
aliases: undefined,
|
|
50
|
-
wasReplayed: true
|
|
51
|
-
}));
|
|
52
|
-
return newCommand;
|
|
53
|
-
}
|
|
54
|
-
serialize(isCommandStorageDisabled) {
|
|
55
|
-
return {
|
|
56
|
-
promptStartLine: this.promptStartMarker?.line,
|
|
57
|
-
startLine: this.marker?.line,
|
|
58
|
-
startX: undefined,
|
|
59
|
-
endLine: this.endMarker?.line,
|
|
60
|
-
executedLine: this.executedMarker?.line,
|
|
61
|
-
executedX: this.executedX,
|
|
62
|
-
command: isCommandStorageDisabled ? '' : this.command,
|
|
63
|
-
commandLineConfidence: isCommandStorageDisabled ? 'low' : this.commandLineConfidence,
|
|
64
|
-
isTrusted: this.isTrusted,
|
|
65
|
-
cwd: this.cwd,
|
|
66
|
-
exitCode: this.exitCode,
|
|
67
|
-
commandStartLineContent: this.commandStartLineContent,
|
|
68
|
-
timestamp: this.timestamp,
|
|
69
|
-
duration: this.duration,
|
|
70
|
-
markProperties: this.markProperties,
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
extractCommandLine() {
|
|
74
|
-
return extractCommandLine(this._xterm.buffer.active, this._xterm.cols, this.marker, this.startX, this.executedMarker, this.executedX);
|
|
75
|
-
}
|
|
76
|
-
getOutput() {
|
|
77
|
-
if (!this.executedMarker || !this.endMarker) {
|
|
78
|
-
return undefined;
|
|
79
|
-
}
|
|
80
|
-
const startLine = this.executedMarker.line;
|
|
81
|
-
const endLine = this.endMarker.line;
|
|
82
|
-
if (startLine === endLine) {
|
|
83
|
-
return undefined;
|
|
84
|
-
}
|
|
85
|
-
let output = '';
|
|
86
|
-
let line;
|
|
87
|
-
for (let i = startLine; i < endLine; i++) {
|
|
88
|
-
line = this._xterm.buffer.active.getLine(i);
|
|
89
|
-
if (!line) {
|
|
90
|
-
continue;
|
|
91
|
-
}
|
|
92
|
-
output += line.translateToString(!line.isWrapped) + (line.isWrapped ? '' : '\n');
|
|
93
|
-
}
|
|
94
|
-
return output === '' ? undefined : output;
|
|
95
|
-
}
|
|
96
|
-
getOutputMatch(outputMatcher) {
|
|
97
|
-
if (!this.executedMarker || !this.endMarker) {
|
|
98
|
-
return undefined;
|
|
99
|
-
}
|
|
100
|
-
const endLine = this.endMarker.line;
|
|
101
|
-
if (endLine === -1) {
|
|
102
|
-
return undefined;
|
|
103
|
-
}
|
|
104
|
-
const buffer = this._xterm.buffer.active;
|
|
105
|
-
const startLine = Math.max(this.executedMarker.line, 0);
|
|
106
|
-
const matcher = outputMatcher.lineMatcher;
|
|
107
|
-
const linesToCheck = typeof matcher === 'string' ? 1 : outputMatcher.length || countNewLines(matcher);
|
|
108
|
-
const lines = [];
|
|
109
|
-
let match;
|
|
110
|
-
if (outputMatcher.anchor === 'bottom') {
|
|
111
|
-
for (let i = endLine - (outputMatcher.offset || 0); i >= startLine; i--) {
|
|
112
|
-
let wrappedLineStart = i;
|
|
113
|
-
const wrappedLineEnd = i;
|
|
114
|
-
while (wrappedLineStart >= startLine && buffer.getLine(wrappedLineStart)?.isWrapped) {
|
|
115
|
-
wrappedLineStart--;
|
|
116
|
-
}
|
|
117
|
-
i = wrappedLineStart;
|
|
118
|
-
lines.unshift(getXtermLineContent(buffer, wrappedLineStart, wrappedLineEnd, this._xterm.cols));
|
|
119
|
-
if (!match) {
|
|
120
|
-
match = lines[0].match(matcher);
|
|
121
|
-
}
|
|
122
|
-
if (lines.length >= linesToCheck) {
|
|
123
|
-
break;
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
else {
|
|
128
|
-
for (let i = startLine + (outputMatcher.offset || 0); i < endLine; i++) {
|
|
129
|
-
const wrappedLineStart = i;
|
|
130
|
-
let wrappedLineEnd = i;
|
|
131
|
-
while (wrappedLineEnd + 1 < endLine && buffer.getLine(wrappedLineEnd + 1)?.isWrapped) {
|
|
132
|
-
wrappedLineEnd++;
|
|
133
|
-
}
|
|
134
|
-
i = wrappedLineEnd;
|
|
135
|
-
lines.push(getXtermLineContent(buffer, wrappedLineStart, wrappedLineEnd, this._xterm.cols));
|
|
136
|
-
if (!match) {
|
|
137
|
-
match = lines[lines.length - 1].match(matcher);
|
|
138
|
-
}
|
|
139
|
-
if (lines.length >= linesToCheck) {
|
|
140
|
-
break;
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
return match ? { regexMatch: match, outputLines: lines } : undefined;
|
|
145
|
-
}
|
|
146
|
-
hasOutput() {
|
|
147
|
-
return (!this.executedMarker?.isDisposed &&
|
|
148
|
-
!this.endMarker?.isDisposed &&
|
|
149
|
-
!!(this.executedMarker &&
|
|
150
|
-
this.endMarker &&
|
|
151
|
-
this.executedMarker.line < this.endMarker.line));
|
|
152
|
-
}
|
|
153
|
-
getPromptRowCount() {
|
|
154
|
-
return getPromptRowCount(this, this._xterm.buffer.active);
|
|
155
|
-
}
|
|
156
|
-
getCommandRowCount() {
|
|
157
|
-
return getCommandRowCount(this);
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
class PartialTerminalCommand {
|
|
161
|
-
constructor(_xterm) {
|
|
162
|
-
this._xterm = _xterm;
|
|
163
|
-
}
|
|
164
|
-
serialize(cwd) {
|
|
165
|
-
if (!this.commandStartMarker) {
|
|
166
|
-
return undefined;
|
|
167
|
-
}
|
|
168
|
-
return {
|
|
169
|
-
promptStartLine: this.promptStartMarker?.line,
|
|
170
|
-
startLine: this.commandStartMarker.line,
|
|
171
|
-
startX: this.commandStartX,
|
|
172
|
-
endLine: undefined,
|
|
173
|
-
executedLine: undefined,
|
|
174
|
-
executedX: undefined,
|
|
175
|
-
command: '',
|
|
176
|
-
commandLineConfidence: 'low',
|
|
177
|
-
isTrusted: true,
|
|
178
|
-
cwd,
|
|
179
|
-
exitCode: undefined,
|
|
180
|
-
commandStartLineContent: undefined,
|
|
181
|
-
timestamp: 0,
|
|
182
|
-
duration: 0,
|
|
183
|
-
markProperties: undefined
|
|
184
|
-
};
|
|
185
|
-
}
|
|
186
|
-
promoteToFullCommand(cwd, exitCode, ignoreCommandLine, markProperties) {
|
|
187
|
-
if (exitCode === undefined && this.command === undefined) {
|
|
188
|
-
this.command = '';
|
|
189
|
-
}
|
|
190
|
-
if ((this.command !== undefined && !this.command.startsWith('\\')) || ignoreCommandLine) {
|
|
191
|
-
return ( new TerminalCommand(this._xterm, {
|
|
192
|
-
command: ignoreCommandLine ? '' : (this.command || ''),
|
|
193
|
-
commandLineConfidence: ignoreCommandLine ? 'low' : (this.commandLineConfidence || 'low'),
|
|
194
|
-
isTrusted: !!this.isTrusted,
|
|
195
|
-
promptStartMarker: this.promptStartMarker,
|
|
196
|
-
marker: this.commandStartMarker,
|
|
197
|
-
startX: this.commandStartX,
|
|
198
|
-
endMarker: this.commandFinishedMarker,
|
|
199
|
-
executedMarker: this.commandExecutedMarker,
|
|
200
|
-
executedX: this.commandExecutedX,
|
|
201
|
-
timestamp: Date.now(),
|
|
202
|
-
duration: this.commandDuration || 0,
|
|
203
|
-
cwd,
|
|
204
|
-
exitCode,
|
|
205
|
-
commandStartLineContent: this.commandStartLineContent,
|
|
206
|
-
markProperties
|
|
207
|
-
}));
|
|
208
|
-
}
|
|
209
|
-
return undefined;
|
|
210
|
-
}
|
|
211
|
-
markExecutedTime() {
|
|
212
|
-
if (this.commandExecutedTimestamp === undefined) {
|
|
213
|
-
this.commandExecutedTimestamp = Date.now();
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
markFinishedTime() {
|
|
217
|
-
if (this.commandDuration === undefined && this.commandExecutedTimestamp !== undefined) {
|
|
218
|
-
this.commandDuration = Date.now() - this.commandExecutedTimestamp;
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
extractCommandLine() {
|
|
222
|
-
return extractCommandLine(this._xterm.buffer.active, this._xterm.cols, this.commandStartMarker, this.commandStartX, this.commandExecutedMarker, this.commandExecutedX);
|
|
223
|
-
}
|
|
224
|
-
getPromptRowCount() {
|
|
225
|
-
return getPromptRowCount(this, this._xterm.buffer.active);
|
|
226
|
-
}
|
|
227
|
-
getCommandRowCount() {
|
|
228
|
-
return getCommandRowCount(this);
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
function extractCommandLine(buffer, cols, commandStartMarker, commandStartX, commandExecutedMarker, commandExecutedX) {
|
|
232
|
-
if (!commandStartMarker || !commandExecutedMarker || commandStartX === undefined || commandExecutedX === undefined) {
|
|
233
|
-
return '';
|
|
234
|
-
}
|
|
235
|
-
let content = '';
|
|
236
|
-
for (let i = commandStartMarker.line; i <= commandExecutedMarker.line; i++) {
|
|
237
|
-
const line = buffer.getLine(i);
|
|
238
|
-
if (line) {
|
|
239
|
-
content += line.translateToString(true, i === commandStartMarker.line ? commandStartX : 0, i === commandExecutedMarker.line ? commandExecutedX : cols);
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
return content;
|
|
243
|
-
}
|
|
244
|
-
function getXtermLineContent(buffer, lineStart, lineEnd, cols) {
|
|
245
|
-
const maxLineLength = Math.max(2048 / cols * 2);
|
|
246
|
-
lineEnd = Math.min(lineEnd, lineStart + maxLineLength);
|
|
247
|
-
let content = '';
|
|
248
|
-
for (let i = lineStart; i <= lineEnd; i++) {
|
|
249
|
-
const line = buffer.getLine(i);
|
|
250
|
-
if (line) {
|
|
251
|
-
content += line.translateToString(true, 0, cols);
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
return content;
|
|
255
|
-
}
|
|
256
|
-
function countNewLines(regex) {
|
|
257
|
-
if (!regex.multiline) {
|
|
258
|
-
return 1;
|
|
259
|
-
}
|
|
260
|
-
const source = regex.source;
|
|
261
|
-
let count = 1;
|
|
262
|
-
let i = source.indexOf('\\n');
|
|
263
|
-
while (i !== -1) {
|
|
264
|
-
count++;
|
|
265
|
-
i = source.indexOf('\\n', i + 1);
|
|
266
|
-
}
|
|
267
|
-
return count;
|
|
268
|
-
}
|
|
269
|
-
function getPromptRowCount(command, buffer) {
|
|
270
|
-
const marker = 'hasOutput' in command ? command.marker : command.commandStartMarker;
|
|
271
|
-
if (!marker || !command.promptStartMarker) {
|
|
272
|
-
return 1;
|
|
273
|
-
}
|
|
274
|
-
let promptRowCount = 1;
|
|
275
|
-
let promptStartLine = command.promptStartMarker.line;
|
|
276
|
-
while (promptStartLine < marker.line && (buffer.getLine(promptStartLine)?.translateToString(true) ?? '').length === 0) {
|
|
277
|
-
promptStartLine++;
|
|
278
|
-
}
|
|
279
|
-
promptRowCount = marker.line - promptStartLine + 1;
|
|
280
|
-
return promptRowCount;
|
|
281
|
-
}
|
|
282
|
-
function getCommandRowCount(command) {
|
|
283
|
-
const marker = 'hasOutput' in command ? command.marker : command.commandStartMarker;
|
|
284
|
-
const executedMarker = 'hasOutput' in command ? command.executedMarker : command.commandExecutedMarker;
|
|
285
|
-
if (!marker || !executedMarker) {
|
|
286
|
-
return 1;
|
|
287
|
-
}
|
|
288
|
-
const commandExecutedLine = Math.max(executedMarker.line, marker.line);
|
|
289
|
-
let commandRowCount = commandExecutedLine - marker.line + 1;
|
|
290
|
-
const executedX = 'hasOutput' in command ? command.executedX : command.commandExecutedX;
|
|
291
|
-
if (executedX === 0) {
|
|
292
|
-
commandRowCount--;
|
|
293
|
-
}
|
|
294
|
-
return commandRowCount;
|
|
295
|
-
}
|
|
296
|
-
export { PartialTerminalCommand, TerminalCommand };
|