@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
|
@@ -1,761 +0,0 @@
|
|
|
1
|
-
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
-
import { RunOnceScheduler } from '../../../../base/common/async.js';
|
|
3
|
-
import { debounce } from '../../../../base/common/decorators.js';
|
|
4
|
-
import { Emitter } from '../../../../base/common/event.js';
|
|
5
|
-
import { Disposable, MandatoryMutableDisposable, MutableDisposable } from '../../../../base/common/lifecycle.js';
|
|
6
|
-
import { ILogService } from '../../../log/common/log.service.js';
|
|
7
|
-
import { PartialTerminalCommand, TerminalCommand } from './commandDetection/terminalCommand.js';
|
|
8
|
-
import { PromptInputModel } from './commandDetection/promptInputModel.js';
|
|
9
|
-
let CommandDetectionCapability = class CommandDetectionCapability extends Disposable {
|
|
10
|
-
get promptInputModel() { return this._promptInputModel; }
|
|
11
|
-
get commands() { return this._commands; }
|
|
12
|
-
get executingCommand() { return this._currentCommand.command; }
|
|
13
|
-
get executingCommandObject() {
|
|
14
|
-
if (this._currentCommand.commandStartMarker) {
|
|
15
|
-
return { marker: this._currentCommand.commandStartMarker };
|
|
16
|
-
}
|
|
17
|
-
return undefined;
|
|
18
|
-
}
|
|
19
|
-
get currentCommand() {
|
|
20
|
-
return this._currentCommand;
|
|
21
|
-
}
|
|
22
|
-
get cwd() { return this._cwd; }
|
|
23
|
-
get promptTerminator() { return this._promptTerminator; }
|
|
24
|
-
constructor(_terminal, _logService) {
|
|
25
|
-
super();
|
|
26
|
-
this._terminal = _terminal;
|
|
27
|
-
this._logService = _logService;
|
|
28
|
-
this.type = 2 ;
|
|
29
|
-
this._commands = [];
|
|
30
|
-
this._currentCommand = ( new PartialTerminalCommand(this._terminal));
|
|
31
|
-
this._commandMarkers = [];
|
|
32
|
-
this.__isCommandStorageDisabled = false;
|
|
33
|
-
this._onCommandStarted = this._register(( new Emitter()));
|
|
34
|
-
this.onCommandStarted = this._onCommandStarted.event;
|
|
35
|
-
this._onBeforeCommandFinished = this._register(( new Emitter()));
|
|
36
|
-
this.onBeforeCommandFinished = this._onBeforeCommandFinished.event;
|
|
37
|
-
this._onCommandFinished = this._register(( new Emitter()));
|
|
38
|
-
this.onCommandFinished = this._onCommandFinished.event;
|
|
39
|
-
this._onCommandExecuted = this._register(( new Emitter()));
|
|
40
|
-
this.onCommandExecuted = this._onCommandExecuted.event;
|
|
41
|
-
this._onCommandInvalidated = this._register(( new Emitter()));
|
|
42
|
-
this.onCommandInvalidated = this._onCommandInvalidated.event;
|
|
43
|
-
this._onCurrentCommandInvalidated = this._register(( new Emitter()));
|
|
44
|
-
this.onCurrentCommandInvalidated = this._onCurrentCommandInvalidated.event;
|
|
45
|
-
this._promptInputModel = this._register(( new PromptInputModel(
|
|
46
|
-
this._terminal,
|
|
47
|
-
this.onCommandStarted,
|
|
48
|
-
this.onCommandExecuted,
|
|
49
|
-
this._logService
|
|
50
|
-
)));
|
|
51
|
-
this._register(this.onCommandExecuted(command => {
|
|
52
|
-
if (command.commandLineConfidence !== 'high') {
|
|
53
|
-
const typedCommand = command;
|
|
54
|
-
command.command = typedCommand.extractCommandLine();
|
|
55
|
-
command.commandLineConfidence = 'low';
|
|
56
|
-
if ('getOutput' in typedCommand) {
|
|
57
|
-
if (
|
|
58
|
-
typedCommand.promptStartMarker && typedCommand.marker && typedCommand.executedMarker &&
|
|
59
|
-
command.command.indexOf('\n') === -1 &&
|
|
60
|
-
typedCommand.startX !== undefined && typedCommand.startX > 0) {
|
|
61
|
-
command.commandLineConfidence = 'medium';
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
else {
|
|
65
|
-
if (
|
|
66
|
-
typedCommand.promptStartMarker && typedCommand.commandStartMarker && typedCommand.commandExecutedMarker &&
|
|
67
|
-
command.command.indexOf('\n') === -1 &&
|
|
68
|
-
typedCommand.commandStartX !== undefined && typedCommand.commandStartX > 0) {
|
|
69
|
-
command.commandLineConfidence = 'medium';
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
}));
|
|
74
|
-
const that = this;
|
|
75
|
-
this._ptyHeuristicsHooks = new (class {
|
|
76
|
-
get onCurrentCommandInvalidatedEmitter() { return that._onCurrentCommandInvalidated; }
|
|
77
|
-
get onCommandStartedEmitter() { return that._onCommandStarted; }
|
|
78
|
-
get onCommandExecutedEmitter() { return that._onCommandExecuted; }
|
|
79
|
-
get dimensions() { return that._dimensions; }
|
|
80
|
-
get isCommandStorageDisabled() { return that.__isCommandStorageDisabled; }
|
|
81
|
-
get commandMarkers() { return that._commandMarkers; }
|
|
82
|
-
set commandMarkers(value) { that._commandMarkers = value; }
|
|
83
|
-
get clearCommandsInViewport() { return that._clearCommandsInViewport.bind(that); }
|
|
84
|
-
commitCommandFinished() {
|
|
85
|
-
that._commitCommandFinished?.flush();
|
|
86
|
-
that._commitCommandFinished = undefined;
|
|
87
|
-
}
|
|
88
|
-
});
|
|
89
|
-
this._ptyHeuristics = this._register(( new MandatoryMutableDisposable(( new UnixPtyHeuristics(this._terminal, this, this._ptyHeuristicsHooks, this._logService)))));
|
|
90
|
-
this._dimensions = {
|
|
91
|
-
cols: this._terminal.cols,
|
|
92
|
-
rows: this._terminal.rows
|
|
93
|
-
};
|
|
94
|
-
this._register(this._terminal.onResize(e => this._handleResize(e)));
|
|
95
|
-
this._register(this._terminal.onCursorMove(() => this._handleCursorMove()));
|
|
96
|
-
}
|
|
97
|
-
_handleResize(e) {
|
|
98
|
-
this._ptyHeuristics.value.preHandleResize?.(e);
|
|
99
|
-
this._dimensions.cols = e.cols;
|
|
100
|
-
this._dimensions.rows = e.rows;
|
|
101
|
-
}
|
|
102
|
-
_handleCursorMove() {
|
|
103
|
-
if (this._store.isDisposed) {
|
|
104
|
-
return;
|
|
105
|
-
}
|
|
106
|
-
if (this._terminal.buffer.active === this._terminal.buffer.normal && this._currentCommand.commandStartMarker) {
|
|
107
|
-
if (this._terminal.buffer.active.baseY + this._terminal.buffer.active.cursorY < this._currentCommand.commandStartMarker.line) {
|
|
108
|
-
this._clearCommandsInViewport();
|
|
109
|
-
this._currentCommand.isInvalid = true;
|
|
110
|
-
this._onCurrentCommandInvalidated.fire({ reason: "windows" });
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
_clearCommandsInViewport() {
|
|
115
|
-
let count = 0;
|
|
116
|
-
for (let i = this._commands.length - 1; i >= 0; i--) {
|
|
117
|
-
const line = this._commands[i].marker?.line;
|
|
118
|
-
if (line && line < this._terminal.buffer.active.baseY) {
|
|
119
|
-
break;
|
|
120
|
-
}
|
|
121
|
-
count++;
|
|
122
|
-
}
|
|
123
|
-
if (count > 0) {
|
|
124
|
-
this._onCommandInvalidated.fire(this._commands.splice(this._commands.length - count, count));
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
setContinuationPrompt(value) {
|
|
128
|
-
this._promptInputModel.setContinuationPrompt(value);
|
|
129
|
-
}
|
|
130
|
-
setPromptTerminator(promptTerminator, lastPromptLine) {
|
|
131
|
-
this._logService.debug('CommandDetectionCapability#setPromptTerminator', promptTerminator);
|
|
132
|
-
this._promptTerminator = promptTerminator;
|
|
133
|
-
this._promptInputModel.setLastPromptLine(lastPromptLine);
|
|
134
|
-
}
|
|
135
|
-
setCwd(value) {
|
|
136
|
-
this._cwd = value;
|
|
137
|
-
}
|
|
138
|
-
setIsWindowsPty(value) {
|
|
139
|
-
if (value && !(this._ptyHeuristics.value instanceof WindowsPtyHeuristics)) {
|
|
140
|
-
const that = this;
|
|
141
|
-
this._ptyHeuristics.value = ( new WindowsPtyHeuristics(this._terminal, this, new (class {
|
|
142
|
-
get onCurrentCommandInvalidatedEmitter() { return that._onCurrentCommandInvalidated; }
|
|
143
|
-
get onCommandStartedEmitter() { return that._onCommandStarted; }
|
|
144
|
-
get onCommandExecutedEmitter() { return that._onCommandExecuted; }
|
|
145
|
-
get dimensions() { return that._dimensions; }
|
|
146
|
-
get isCommandStorageDisabled() { return that.__isCommandStorageDisabled; }
|
|
147
|
-
get commandMarkers() { return that._commandMarkers; }
|
|
148
|
-
set commandMarkers(value) { that._commandMarkers = value; }
|
|
149
|
-
get clearCommandsInViewport() { return that._clearCommandsInViewport.bind(that); }
|
|
150
|
-
commitCommandFinished() {
|
|
151
|
-
that._commitCommandFinished?.flush();
|
|
152
|
-
that._commitCommandFinished = undefined;
|
|
153
|
-
}
|
|
154
|
-
}), this._logService));
|
|
155
|
-
}
|
|
156
|
-
else if (!value && !(this._ptyHeuristics.value instanceof UnixPtyHeuristics)) {
|
|
157
|
-
this._ptyHeuristics.value = ( new UnixPtyHeuristics(this._terminal, this, this._ptyHeuristicsHooks, this._logService));
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
setIsCommandStorageDisabled() {
|
|
161
|
-
this.__isCommandStorageDisabled = true;
|
|
162
|
-
}
|
|
163
|
-
getCommandForLine(line) {
|
|
164
|
-
if (this._currentCommand.promptStartMarker && line >= this._currentCommand.promptStartMarker?.line) {
|
|
165
|
-
return this._currentCommand;
|
|
166
|
-
}
|
|
167
|
-
if (this._commands.length === 0) {
|
|
168
|
-
return undefined;
|
|
169
|
-
}
|
|
170
|
-
if ((this._commands[0].promptStartMarker ?? this._commands[0].marker).line > line) {
|
|
171
|
-
return undefined;
|
|
172
|
-
}
|
|
173
|
-
for (let i = this.commands.length - 1; i >= 0; i--) {
|
|
174
|
-
if ((this.commands[i].promptStartMarker ?? this.commands[i].marker).line <= line) {
|
|
175
|
-
return this.commands[i];
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
return undefined;
|
|
179
|
-
}
|
|
180
|
-
getCwdForLine(line) {
|
|
181
|
-
if (this._currentCommand.promptStartMarker && line >= this._currentCommand.promptStartMarker?.line) {
|
|
182
|
-
return this._cwd;
|
|
183
|
-
}
|
|
184
|
-
const command = this.getCommandForLine(line);
|
|
185
|
-
if (command && 'cwd' in command) {
|
|
186
|
-
return command.cwd;
|
|
187
|
-
}
|
|
188
|
-
return undefined;
|
|
189
|
-
}
|
|
190
|
-
handlePromptStart(options) {
|
|
191
|
-
const lastCommand = this.commands.at(-1);
|
|
192
|
-
if (lastCommand?.endMarker && lastCommand?.executedMarker && lastCommand.endMarker.line === lastCommand.executedMarker.line) {
|
|
193
|
-
this._logService.debug('CommandDetectionCapability#handlePromptStart adjusted commandFinished', `${lastCommand.endMarker.line} -> ${lastCommand.executedMarker.line + 1}`);
|
|
194
|
-
lastCommand.endMarker = cloneMarker(this._terminal, lastCommand.executedMarker, 1);
|
|
195
|
-
}
|
|
196
|
-
this._currentCommand.promptStartMarker = options?.marker || (lastCommand?.endMarker ? cloneMarker(this._terminal, lastCommand.endMarker) : this._terminal.registerMarker(0));
|
|
197
|
-
this._logService.debug('CommandDetectionCapability#handlePromptStart', this._terminal.buffer.active.cursorX, this._currentCommand.promptStartMarker?.line);
|
|
198
|
-
}
|
|
199
|
-
handleContinuationStart() {
|
|
200
|
-
this._currentCommand.currentContinuationMarker = this._terminal.registerMarker(0);
|
|
201
|
-
this._logService.debug('CommandDetectionCapability#handleContinuationStart', this._currentCommand.currentContinuationMarker);
|
|
202
|
-
}
|
|
203
|
-
handleContinuationEnd() {
|
|
204
|
-
if (!this._currentCommand.currentContinuationMarker) {
|
|
205
|
-
this._logService.warn('CommandDetectionCapability#handleContinuationEnd Received continuation end without start');
|
|
206
|
-
return;
|
|
207
|
-
}
|
|
208
|
-
if (!this._currentCommand.continuations) {
|
|
209
|
-
this._currentCommand.continuations = [];
|
|
210
|
-
}
|
|
211
|
-
this._currentCommand.continuations.push({
|
|
212
|
-
marker: this._currentCommand.currentContinuationMarker,
|
|
213
|
-
end: this._terminal.buffer.active.cursorX
|
|
214
|
-
});
|
|
215
|
-
this._currentCommand.currentContinuationMarker = undefined;
|
|
216
|
-
this._logService.debug('CommandDetectionCapability#handleContinuationEnd', this._currentCommand.continuations[this._currentCommand.continuations.length - 1]);
|
|
217
|
-
}
|
|
218
|
-
handleRightPromptStart() {
|
|
219
|
-
this._currentCommand.commandRightPromptStartX = this._terminal.buffer.active.cursorX;
|
|
220
|
-
this._logService.debug('CommandDetectionCapability#handleRightPromptStart', this._currentCommand.commandRightPromptStartX);
|
|
221
|
-
}
|
|
222
|
-
handleRightPromptEnd() {
|
|
223
|
-
this._currentCommand.commandRightPromptEndX = this._terminal.buffer.active.cursorX;
|
|
224
|
-
this._logService.debug('CommandDetectionCapability#handleRightPromptEnd', this._currentCommand.commandRightPromptEndX);
|
|
225
|
-
}
|
|
226
|
-
handleCommandStart(options) {
|
|
227
|
-
this._handleCommandStartOptions = options;
|
|
228
|
-
this._currentCommand.cwd = this._cwd;
|
|
229
|
-
this._currentCommand.commandStartMarker = options?.marker || this._currentCommand.commandStartMarker;
|
|
230
|
-
if (this._currentCommand.commandStartMarker?.line === this._terminal.buffer.active.cursorY) {
|
|
231
|
-
this._currentCommand.commandStartX = this._terminal.buffer.active.cursorX;
|
|
232
|
-
this._logService.debug('CommandDetectionCapability#handleCommandStart', this._currentCommand.commandStartX, this._currentCommand.commandStartMarker?.line);
|
|
233
|
-
return;
|
|
234
|
-
}
|
|
235
|
-
this._ptyHeuristics.value.handleCommandStart(options);
|
|
236
|
-
}
|
|
237
|
-
handleGenericCommand(options) {
|
|
238
|
-
if (options?.markProperties?.disableCommandStorage) {
|
|
239
|
-
this.setIsCommandStorageDisabled();
|
|
240
|
-
}
|
|
241
|
-
this.handlePromptStart(options);
|
|
242
|
-
this.handleCommandStart(options);
|
|
243
|
-
this.handleCommandExecuted(options);
|
|
244
|
-
this.handleCommandFinished(undefined, options);
|
|
245
|
-
}
|
|
246
|
-
handleCommandExecuted(options) {
|
|
247
|
-
this._ptyHeuristics.value.handleCommandExecuted(options);
|
|
248
|
-
this._currentCommand.markExecutedTime();
|
|
249
|
-
}
|
|
250
|
-
handleCommandFinished(exitCode, options) {
|
|
251
|
-
this._currentCommand.markFinishedTime();
|
|
252
|
-
this._ptyHeuristics.value.preHandleCommandFinished?.();
|
|
253
|
-
this._logService.debug('CommandDetectionCapability#handleCommandFinished', this._terminal.buffer.active.cursorX, options?.marker?.line, this._currentCommand.command, this._currentCommand);
|
|
254
|
-
if (exitCode === undefined) {
|
|
255
|
-
const lastCommand = this.commands.length > 0 ? this.commands[this.commands.length - 1] : undefined;
|
|
256
|
-
if (this._currentCommand.command && this._currentCommand.command.length > 0 && lastCommand?.command === this._currentCommand.command) {
|
|
257
|
-
exitCode = lastCommand.exitCode;
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
if (this._currentCommand.commandStartMarker === undefined || !this._terminal.buffer.active) {
|
|
261
|
-
return;
|
|
262
|
-
}
|
|
263
|
-
this._currentCommand.commandFinishedMarker = options?.marker || this._terminal.registerMarker(0);
|
|
264
|
-
this._ptyHeuristics.value.postHandleCommandFinished?.();
|
|
265
|
-
const newCommand = this._currentCommand.promoteToFullCommand(this._cwd, exitCode, this._handleCommandStartOptions?.ignoreCommandLine ?? false, options?.markProperties);
|
|
266
|
-
if (newCommand) {
|
|
267
|
-
this._commands.push(newCommand);
|
|
268
|
-
this._commitCommandFinished = ( new RunOnceScheduler(() => {
|
|
269
|
-
this._onBeforeCommandFinished.fire(newCommand);
|
|
270
|
-
if (!this._currentCommand.isInvalid) {
|
|
271
|
-
this._logService.debug('CommandDetectionCapability#onCommandFinished', newCommand);
|
|
272
|
-
this._onCommandFinished.fire(newCommand);
|
|
273
|
-
}
|
|
274
|
-
}, 50));
|
|
275
|
-
this._commitCommandFinished.schedule();
|
|
276
|
-
}
|
|
277
|
-
this._currentCommand = ( new PartialTerminalCommand(this._terminal));
|
|
278
|
-
this._handleCommandStartOptions = undefined;
|
|
279
|
-
}
|
|
280
|
-
setCommandLine(commandLine, isTrusted) {
|
|
281
|
-
this._logService.debug('CommandDetectionCapability#setCommandLine', commandLine, isTrusted);
|
|
282
|
-
this._currentCommand.command = commandLine;
|
|
283
|
-
this._currentCommand.commandLineConfidence = 'high';
|
|
284
|
-
this._currentCommand.isTrusted = isTrusted;
|
|
285
|
-
if (isTrusted) {
|
|
286
|
-
this._promptInputModel.setConfidentCommandLine(commandLine);
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
|
-
serialize() {
|
|
290
|
-
const commands = ( this.commands.map(e => e.serialize(this.__isCommandStorageDisabled)));
|
|
291
|
-
const partialCommand = this._currentCommand.serialize(this._cwd);
|
|
292
|
-
if (partialCommand) {
|
|
293
|
-
commands.push(partialCommand);
|
|
294
|
-
}
|
|
295
|
-
return {
|
|
296
|
-
isWindowsPty: this._ptyHeuristics.value instanceof WindowsPtyHeuristics,
|
|
297
|
-
commands,
|
|
298
|
-
promptInputModel: this._promptInputModel.serialize(),
|
|
299
|
-
};
|
|
300
|
-
}
|
|
301
|
-
deserialize(serialized) {
|
|
302
|
-
if (serialized.isWindowsPty) {
|
|
303
|
-
this.setIsWindowsPty(serialized.isWindowsPty);
|
|
304
|
-
}
|
|
305
|
-
const buffer = this._terminal.buffer.normal;
|
|
306
|
-
for (const e of serialized.commands) {
|
|
307
|
-
if (!e.endLine) {
|
|
308
|
-
const marker = e.startLine !== undefined ? this._terminal.registerMarker(e.startLine - (buffer.baseY + buffer.cursorY)) : undefined;
|
|
309
|
-
if (!marker) {
|
|
310
|
-
continue;
|
|
311
|
-
}
|
|
312
|
-
this._currentCommand.commandStartMarker = e.startLine !== undefined ? this._terminal.registerMarker(e.startLine - (buffer.baseY + buffer.cursorY)) : undefined;
|
|
313
|
-
this._currentCommand.commandStartX = e.startX;
|
|
314
|
-
this._currentCommand.promptStartMarker = e.promptStartLine !== undefined ? this._terminal.registerMarker(e.promptStartLine - (buffer.baseY + buffer.cursorY)) : undefined;
|
|
315
|
-
this._cwd = e.cwd;
|
|
316
|
-
this._onCommandStarted.fire({ marker });
|
|
317
|
-
continue;
|
|
318
|
-
}
|
|
319
|
-
const newCommand = TerminalCommand.deserialize(this._terminal, e, this.__isCommandStorageDisabled);
|
|
320
|
-
if (!newCommand) {
|
|
321
|
-
continue;
|
|
322
|
-
}
|
|
323
|
-
this._commands.push(newCommand);
|
|
324
|
-
this._logService.debug('CommandDetectionCapability#onCommandFinished', newCommand);
|
|
325
|
-
this._onCommandFinished.fire(newCommand);
|
|
326
|
-
}
|
|
327
|
-
if (serialized.promptInputModel) {
|
|
328
|
-
this._promptInputModel.deserialize(serialized.promptInputModel);
|
|
329
|
-
}
|
|
330
|
-
}
|
|
331
|
-
};
|
|
332
|
-
CommandDetectionCapability.__decorator = ( __decorate([
|
|
333
|
-
debounce(500)
|
|
334
|
-
], CommandDetectionCapability.prototype, "_handleCursorMove", null));
|
|
335
|
-
CommandDetectionCapability = ( __decorate([
|
|
336
|
-
( __param(1, ILogService))
|
|
337
|
-
], CommandDetectionCapability));
|
|
338
|
-
class UnixPtyHeuristics extends Disposable {
|
|
339
|
-
constructor(_terminal, _capability, _hooks, _logService) {
|
|
340
|
-
super();
|
|
341
|
-
this._terminal = _terminal;
|
|
342
|
-
this._capability = _capability;
|
|
343
|
-
this._hooks = _hooks;
|
|
344
|
-
this._logService = _logService;
|
|
345
|
-
this._register(_terminal.parser.registerCsiHandler({ final: 'J' }, params => {
|
|
346
|
-
if (params.length >= 1 && (params[0] === 2 || params[0] === 3)) {
|
|
347
|
-
_hooks.clearCommandsInViewport();
|
|
348
|
-
}
|
|
349
|
-
return false;
|
|
350
|
-
}));
|
|
351
|
-
}
|
|
352
|
-
handleCommandStart(options) {
|
|
353
|
-
this._hooks.commitCommandFinished();
|
|
354
|
-
const currentCommand = this._capability.currentCommand;
|
|
355
|
-
currentCommand.commandStartX = this._terminal.buffer.active.cursorX;
|
|
356
|
-
currentCommand.commandStartMarker = options?.marker || this._terminal.registerMarker(0);
|
|
357
|
-
currentCommand.commandExecutedMarker?.dispose();
|
|
358
|
-
currentCommand.commandExecutedMarker = undefined;
|
|
359
|
-
currentCommand.commandExecutedX = undefined;
|
|
360
|
-
for (const m of this._hooks.commandMarkers) {
|
|
361
|
-
m.dispose();
|
|
362
|
-
}
|
|
363
|
-
this._hooks.commandMarkers.length = 0;
|
|
364
|
-
this._hooks.onCommandStartedEmitter.fire({ marker: options?.marker || currentCommand.commandStartMarker, markProperties: options?.markProperties });
|
|
365
|
-
this._logService.debug('CommandDetectionCapability#handleCommandStart', currentCommand.commandStartX, currentCommand.commandStartMarker?.line);
|
|
366
|
-
}
|
|
367
|
-
handleCommandExecuted(options) {
|
|
368
|
-
const currentCommand = this._capability.currentCommand;
|
|
369
|
-
currentCommand.commandExecutedMarker = options?.marker || this._terminal.registerMarker(0);
|
|
370
|
-
currentCommand.commandExecutedX = this._terminal.buffer.active.cursorX;
|
|
371
|
-
this._logService.debug('CommandDetectionCapability#handleCommandExecuted', currentCommand.commandExecutedX, currentCommand.commandExecutedMarker?.line);
|
|
372
|
-
if (!currentCommand.commandStartMarker || !currentCommand.commandExecutedMarker || currentCommand.commandStartX === undefined) {
|
|
373
|
-
return;
|
|
374
|
-
}
|
|
375
|
-
currentCommand.command = this._hooks.isCommandStorageDisabled ? '' : this._terminal.buffer.active.getLine(currentCommand.commandStartMarker.line)?.translateToString(true, currentCommand.commandStartX, currentCommand.commandRightPromptStartX).trim();
|
|
376
|
-
let y = currentCommand.commandStartMarker.line + 1;
|
|
377
|
-
const commandExecutedLine = currentCommand.commandExecutedMarker.line;
|
|
378
|
-
for (; y < commandExecutedLine; y++) {
|
|
379
|
-
const line = this._terminal.buffer.active.getLine(y);
|
|
380
|
-
if (line) {
|
|
381
|
-
const continuation = currentCommand.continuations?.find(e => e.marker.line === y);
|
|
382
|
-
if (continuation) {
|
|
383
|
-
currentCommand.command += '\n';
|
|
384
|
-
}
|
|
385
|
-
const startColumn = continuation?.end ?? 0;
|
|
386
|
-
currentCommand.command += line.translateToString(true, startColumn);
|
|
387
|
-
}
|
|
388
|
-
}
|
|
389
|
-
if (y === commandExecutedLine) {
|
|
390
|
-
currentCommand.command += this._terminal.buffer.active.getLine(commandExecutedLine)?.translateToString(true, undefined, currentCommand.commandExecutedX) || '';
|
|
391
|
-
}
|
|
392
|
-
this._hooks.onCommandExecutedEmitter.fire(currentCommand);
|
|
393
|
-
}
|
|
394
|
-
}
|
|
395
|
-
let WindowsPtyHeuristics = class WindowsPtyHeuristics extends Disposable {
|
|
396
|
-
constructor(_terminal, _capability, _hooks, _logService) {
|
|
397
|
-
super();
|
|
398
|
-
this._terminal = _terminal;
|
|
399
|
-
this._capability = _capability;
|
|
400
|
-
this._hooks = _hooks;
|
|
401
|
-
this._logService = _logService;
|
|
402
|
-
this._onCursorMoveListener = this._register(( new MutableDisposable()));
|
|
403
|
-
this._tryAdjustCommandStartMarkerScannedLineCount = 0;
|
|
404
|
-
this._tryAdjustCommandStartMarkerPollCount = 0;
|
|
405
|
-
this._register(_terminal.parser.registerCsiHandler({ final: 'J' }, params => {
|
|
406
|
-
if (params.length >= 1 && (params[0] === 2 || params[0] === 3)) {
|
|
407
|
-
this._hooks.clearCommandsInViewport();
|
|
408
|
-
}
|
|
409
|
-
return false;
|
|
410
|
-
}));
|
|
411
|
-
this._register(this._capability.onBeforeCommandFinished(command => {
|
|
412
|
-
if (command.command.trim().toLowerCase() === 'clear' || command.command.trim().toLowerCase() === 'cls') {
|
|
413
|
-
this._tryAdjustCommandStartMarkerScheduler?.cancel();
|
|
414
|
-
this._tryAdjustCommandStartMarkerScheduler = undefined;
|
|
415
|
-
this._hooks.clearCommandsInViewport();
|
|
416
|
-
this._capability.currentCommand.isInvalid = true;
|
|
417
|
-
this._hooks.onCurrentCommandInvalidatedEmitter.fire({ reason: "windows" });
|
|
418
|
-
}
|
|
419
|
-
}));
|
|
420
|
-
}
|
|
421
|
-
preHandleResize(e) {
|
|
422
|
-
const baseY = this._terminal.buffer.active.baseY;
|
|
423
|
-
const rowsDifference = e.rows - this._hooks.dimensions.rows;
|
|
424
|
-
if (rowsDifference > 0) {
|
|
425
|
-
this._waitForCursorMove().then(() => {
|
|
426
|
-
const potentialShiftedLineCount = Math.min(rowsDifference, baseY);
|
|
427
|
-
for (let i = this._capability.commands.length - 1; i >= 0; i--) {
|
|
428
|
-
const command = this._capability.commands[i];
|
|
429
|
-
if (!command.marker || command.marker.line < baseY || command.commandStartLineContent === undefined) {
|
|
430
|
-
break;
|
|
431
|
-
}
|
|
432
|
-
const line = this._terminal.buffer.active.getLine(command.marker.line);
|
|
433
|
-
if (!line || line.translateToString(true) === command.commandStartLineContent) {
|
|
434
|
-
continue;
|
|
435
|
-
}
|
|
436
|
-
const shiftedY = command.marker.line - potentialShiftedLineCount;
|
|
437
|
-
const shiftedLine = this._terminal.buffer.active.getLine(shiftedY);
|
|
438
|
-
if (shiftedLine?.translateToString(true) !== command.commandStartLineContent) {
|
|
439
|
-
continue;
|
|
440
|
-
}
|
|
441
|
-
this._terminal._core._bufferService.buffer.lines.onDeleteEmitter.fire({
|
|
442
|
-
index: this._terminal.buffer.active.baseY,
|
|
443
|
-
amount: potentialShiftedLineCount
|
|
444
|
-
});
|
|
445
|
-
}
|
|
446
|
-
});
|
|
447
|
-
}
|
|
448
|
-
}
|
|
449
|
-
handleCommandStart() {
|
|
450
|
-
this._capability.currentCommand.commandStartX = this._terminal.buffer.active.cursorX;
|
|
451
|
-
this._hooks.commandMarkers.length = 0;
|
|
452
|
-
const initialCommandStartMarker = this._capability.currentCommand.commandStartMarker = (this._capability.currentCommand.promptStartMarker
|
|
453
|
-
? cloneMarker(this._terminal, this._capability.currentCommand.promptStartMarker)
|
|
454
|
-
: this._terminal.registerMarker(0));
|
|
455
|
-
this._capability.currentCommand.commandStartX = 0;
|
|
456
|
-
this._tryAdjustCommandStartMarkerScannedLineCount = 0;
|
|
457
|
-
this._tryAdjustCommandStartMarkerPollCount = 0;
|
|
458
|
-
this._tryAdjustCommandStartMarkerScheduler = ( new RunOnceScheduler(
|
|
459
|
-
() => this._tryAdjustCommandStartMarker(initialCommandStartMarker),
|
|
460
|
-
20
|
|
461
|
-
));
|
|
462
|
-
this._tryAdjustCommandStartMarkerScheduler.schedule();
|
|
463
|
-
}
|
|
464
|
-
_tryAdjustCommandStartMarker(start) {
|
|
465
|
-
if (this._store.isDisposed) {
|
|
466
|
-
return;
|
|
467
|
-
}
|
|
468
|
-
const buffer = this._terminal.buffer.active;
|
|
469
|
-
let scannedLineCount = this._tryAdjustCommandStartMarkerScannedLineCount;
|
|
470
|
-
while (scannedLineCount < 10 && start.line + scannedLineCount < buffer.baseY + this._terminal.rows) {
|
|
471
|
-
if (this._cursorOnNextLine()) {
|
|
472
|
-
const prompt = this._getWindowsPrompt(start.line + scannedLineCount);
|
|
473
|
-
if (prompt) {
|
|
474
|
-
const adjustedPrompt = typeof prompt === 'string' ? prompt : prompt.prompt;
|
|
475
|
-
this._capability.currentCommand.commandStartMarker = this._terminal.registerMarker(0);
|
|
476
|
-
if (typeof prompt === 'object' && prompt.likelySingleLine) {
|
|
477
|
-
this._logService.debug('CommandDetectionCapability#_tryAdjustCommandStartMarker adjusted promptStart', `${this._capability.currentCommand.promptStartMarker?.line} -> ${this._capability.currentCommand.commandStartMarker.line}`);
|
|
478
|
-
this._capability.currentCommand.promptStartMarker?.dispose();
|
|
479
|
-
this._capability.currentCommand.promptStartMarker = cloneMarker(this._terminal, this._capability.currentCommand.commandStartMarker);
|
|
480
|
-
const lastCommand = this._capability.commands.at(-1);
|
|
481
|
-
if (lastCommand && this._capability.currentCommand.commandStartMarker.line !== lastCommand.endMarker?.line) {
|
|
482
|
-
lastCommand.endMarker?.dispose();
|
|
483
|
-
lastCommand.endMarker = cloneMarker(this._terminal, this._capability.currentCommand.commandStartMarker);
|
|
484
|
-
}
|
|
485
|
-
}
|
|
486
|
-
this._capability.currentCommand.commandStartX = adjustedPrompt.length;
|
|
487
|
-
this._logService.debug('CommandDetectionCapability#_tryAdjustCommandStartMarker adjusted commandStart', `${start.line} -> ${this._capability.currentCommand.commandStartMarker.line}:${this._capability.currentCommand.commandStartX}`);
|
|
488
|
-
this._flushPendingHandleCommandStartTask();
|
|
489
|
-
return;
|
|
490
|
-
}
|
|
491
|
-
}
|
|
492
|
-
scannedLineCount++;
|
|
493
|
-
}
|
|
494
|
-
if (scannedLineCount < 10 ) {
|
|
495
|
-
this._tryAdjustCommandStartMarkerScannedLineCount = scannedLineCount;
|
|
496
|
-
if (++this._tryAdjustCommandStartMarkerPollCount < 10 ) {
|
|
497
|
-
this._tryAdjustCommandStartMarkerScheduler?.schedule();
|
|
498
|
-
}
|
|
499
|
-
else {
|
|
500
|
-
this._flushPendingHandleCommandStartTask();
|
|
501
|
-
}
|
|
502
|
-
}
|
|
503
|
-
else {
|
|
504
|
-
this._flushPendingHandleCommandStartTask();
|
|
505
|
-
}
|
|
506
|
-
}
|
|
507
|
-
_flushPendingHandleCommandStartTask() {
|
|
508
|
-
if (this._tryAdjustCommandStartMarkerScheduler) {
|
|
509
|
-
this._tryAdjustCommandStartMarkerPollCount = 10 ;
|
|
510
|
-
this._tryAdjustCommandStartMarkerScheduler.flush();
|
|
511
|
-
this._tryAdjustCommandStartMarkerScheduler = undefined;
|
|
512
|
-
}
|
|
513
|
-
this._hooks.commitCommandFinished();
|
|
514
|
-
if (!this._capability.currentCommand.commandExecutedMarker) {
|
|
515
|
-
this._onCursorMoveListener.value = this._terminal.onCursorMove(() => {
|
|
516
|
-
if (this._hooks.commandMarkers.length === 0 || this._hooks.commandMarkers[this._hooks.commandMarkers.length - 1].line !== this._terminal.buffer.active.cursorY) {
|
|
517
|
-
const marker = this._terminal.registerMarker(0);
|
|
518
|
-
if (marker) {
|
|
519
|
-
this._hooks.commandMarkers.push(marker);
|
|
520
|
-
}
|
|
521
|
-
}
|
|
522
|
-
});
|
|
523
|
-
}
|
|
524
|
-
if (this._capability.currentCommand.commandStartMarker) {
|
|
525
|
-
const line = this._terminal.buffer.active.getLine(this._capability.currentCommand.commandStartMarker.line);
|
|
526
|
-
if (line) {
|
|
527
|
-
this._capability.currentCommand.commandStartLineContent = line.translateToString(true);
|
|
528
|
-
}
|
|
529
|
-
}
|
|
530
|
-
this._hooks.onCommandStartedEmitter.fire({ marker: this._capability.currentCommand.commandStartMarker });
|
|
531
|
-
this._logService.debug('CommandDetectionCapability#_handleCommandStartWindows', this._capability.currentCommand.commandStartX, this._capability.currentCommand.commandStartMarker?.line);
|
|
532
|
-
}
|
|
533
|
-
handleCommandExecuted(options) {
|
|
534
|
-
if (this._tryAdjustCommandStartMarkerScheduler) {
|
|
535
|
-
this._flushPendingHandleCommandStartTask();
|
|
536
|
-
}
|
|
537
|
-
this._onCursorMoveListener.clear();
|
|
538
|
-
this._evaluateCommandMarkers();
|
|
539
|
-
this._capability.currentCommand.commandExecutedX = this._terminal.buffer.active.cursorX;
|
|
540
|
-
this._hooks.onCommandExecutedEmitter.fire(this._capability.currentCommand);
|
|
541
|
-
this._logService.debug('CommandDetectionCapability#handleCommandExecuted', this._capability.currentCommand.commandExecutedX, this._capability.currentCommand.commandExecutedMarker?.line);
|
|
542
|
-
}
|
|
543
|
-
preHandleCommandFinished() {
|
|
544
|
-
if (this._capability.currentCommand.commandExecutedMarker) {
|
|
545
|
-
return;
|
|
546
|
-
}
|
|
547
|
-
if (this._hooks.commandMarkers.length === 0) {
|
|
548
|
-
if (!this._capability.currentCommand.commandStartMarker) {
|
|
549
|
-
this._capability.currentCommand.commandStartMarker = this._terminal.registerMarker(0);
|
|
550
|
-
}
|
|
551
|
-
if (this._capability.currentCommand.commandStartMarker) {
|
|
552
|
-
this._hooks.commandMarkers.push(this._capability.currentCommand.commandStartMarker);
|
|
553
|
-
}
|
|
554
|
-
}
|
|
555
|
-
this._evaluateCommandMarkers();
|
|
556
|
-
}
|
|
557
|
-
postHandleCommandFinished() {
|
|
558
|
-
const currentCommand = this._capability.currentCommand;
|
|
559
|
-
const commandText = currentCommand.command;
|
|
560
|
-
const commandLine = currentCommand.commandStartMarker?.line;
|
|
561
|
-
const executedLine = currentCommand.commandExecutedMarker?.line;
|
|
562
|
-
if (!commandText || commandText.length === 0 ||
|
|
563
|
-
commandLine === undefined || commandLine === -1 ||
|
|
564
|
-
executedLine === undefined || executedLine === -1) {
|
|
565
|
-
return;
|
|
566
|
-
}
|
|
567
|
-
let current = 0;
|
|
568
|
-
let found = false;
|
|
569
|
-
for (let i = commandLine; i <= executedLine; i++) {
|
|
570
|
-
const line = this._terminal.buffer.active.getLine(i);
|
|
571
|
-
if (!line) {
|
|
572
|
-
break;
|
|
573
|
-
}
|
|
574
|
-
const text = line.translateToString(true);
|
|
575
|
-
for (let j = 0; j < text.length; j++) {
|
|
576
|
-
while (commandText.length < current && commandText[current] === ' ') {
|
|
577
|
-
current++;
|
|
578
|
-
}
|
|
579
|
-
if (text[j] === commandText[current]) {
|
|
580
|
-
current++;
|
|
581
|
-
}
|
|
582
|
-
if (current === commandText.length) {
|
|
583
|
-
const wrapsToNextLine = j >= this._terminal.cols - 1;
|
|
584
|
-
currentCommand.commandExecutedMarker = this._terminal.registerMarker(i - (this._terminal.buffer.active.baseY + this._terminal.buffer.active.cursorY) + (wrapsToNextLine ? 1 : 0));
|
|
585
|
-
currentCommand.commandExecutedX = wrapsToNextLine ? 0 : j + 1;
|
|
586
|
-
found = true;
|
|
587
|
-
break;
|
|
588
|
-
}
|
|
589
|
-
}
|
|
590
|
-
if (found) {
|
|
591
|
-
break;
|
|
592
|
-
}
|
|
593
|
-
}
|
|
594
|
-
}
|
|
595
|
-
_evaluateCommandMarkers() {
|
|
596
|
-
if (this._hooks.commandMarkers.length === 0) {
|
|
597
|
-
return;
|
|
598
|
-
}
|
|
599
|
-
this._hooks.commandMarkers = this._hooks.commandMarkers.sort((a, b) => a.line - b.line);
|
|
600
|
-
this._capability.currentCommand.commandStartMarker = this._hooks.commandMarkers[0];
|
|
601
|
-
if (this._capability.currentCommand.commandStartMarker) {
|
|
602
|
-
const line = this._terminal.buffer.active.getLine(this._capability.currentCommand.commandStartMarker.line);
|
|
603
|
-
if (line) {
|
|
604
|
-
this._capability.currentCommand.commandStartLineContent = line.translateToString(true);
|
|
605
|
-
}
|
|
606
|
-
}
|
|
607
|
-
this._capability.currentCommand.commandExecutedMarker = this._hooks.commandMarkers[this._hooks.commandMarkers.length - 1];
|
|
608
|
-
this._hooks.onCommandExecutedEmitter.fire(this._capability.currentCommand);
|
|
609
|
-
}
|
|
610
|
-
_cursorOnNextLine() {
|
|
611
|
-
const lastCommand = this._capability.commands.at(-1);
|
|
612
|
-
if (!lastCommand) {
|
|
613
|
-
return true;
|
|
614
|
-
}
|
|
615
|
-
const cursorYAbsolute = this._terminal.buffer.active.baseY + this._terminal.buffer.active.cursorY;
|
|
616
|
-
const lastCommandYAbsolute = (lastCommand.endMarker ? lastCommand.endMarker.line : lastCommand.marker?.line) ?? -1;
|
|
617
|
-
return cursorYAbsolute > lastCommandYAbsolute;
|
|
618
|
-
}
|
|
619
|
-
_waitForCursorMove() {
|
|
620
|
-
const cursorX = this._terminal.buffer.active.cursorX;
|
|
621
|
-
const cursorY = this._terminal.buffer.active.cursorY;
|
|
622
|
-
let totalDelay = 0;
|
|
623
|
-
return ( new Promise((resolve, reject) => {
|
|
624
|
-
const interval = setInterval(() => {
|
|
625
|
-
if (cursorX !== this._terminal.buffer.active.cursorX || cursorY !== this._terminal.buffer.active.cursorY) {
|
|
626
|
-
resolve();
|
|
627
|
-
clearInterval(interval);
|
|
628
|
-
return;
|
|
629
|
-
}
|
|
630
|
-
totalDelay += 10;
|
|
631
|
-
if (totalDelay > 1000) {
|
|
632
|
-
clearInterval(interval);
|
|
633
|
-
resolve();
|
|
634
|
-
}
|
|
635
|
-
}, 10);
|
|
636
|
-
}));
|
|
637
|
-
}
|
|
638
|
-
_getWindowsPrompt(y = this._terminal.buffer.active.baseY + this._terminal.buffer.active.cursorY) {
|
|
639
|
-
const line = this._terminal.buffer.active.getLine(y);
|
|
640
|
-
if (!line) {
|
|
641
|
-
return;
|
|
642
|
-
}
|
|
643
|
-
const lineText = line.translateToString(true);
|
|
644
|
-
if (!lineText) {
|
|
645
|
-
return;
|
|
646
|
-
}
|
|
647
|
-
const pwshPrompt = lineText.match(/(?<prompt>(\(.+\)\s)?(?:PS.+>\s?))/)?.groups?.prompt;
|
|
648
|
-
if (pwshPrompt) {
|
|
649
|
-
const adjustedPrompt = this._adjustPrompt(pwshPrompt, lineText, '>');
|
|
650
|
-
if (adjustedPrompt) {
|
|
651
|
-
return {
|
|
652
|
-
prompt: adjustedPrompt,
|
|
653
|
-
likelySingleLine: true
|
|
654
|
-
};
|
|
655
|
-
}
|
|
656
|
-
}
|
|
657
|
-
const customPrompt = lineText.match(/.*\u276f(?=[^\u276f]*$)/g)?.[0];
|
|
658
|
-
if (customPrompt) {
|
|
659
|
-
const adjustedPrompt = this._adjustPrompt(customPrompt, lineText, '\u276f');
|
|
660
|
-
if (adjustedPrompt) {
|
|
661
|
-
return adjustedPrompt;
|
|
662
|
-
}
|
|
663
|
-
}
|
|
664
|
-
const bashPrompt = lineText.match(/^(?<prompt>\$)/)?.groups?.prompt;
|
|
665
|
-
if (bashPrompt) {
|
|
666
|
-
const adjustedPrompt = this._adjustPrompt(bashPrompt, lineText, '$');
|
|
667
|
-
if (adjustedPrompt) {
|
|
668
|
-
return adjustedPrompt;
|
|
669
|
-
}
|
|
670
|
-
}
|
|
671
|
-
const pythonPrompt = lineText.match(/^(?<prompt>>>> )/g)?.groups?.prompt;
|
|
672
|
-
if (pythonPrompt) {
|
|
673
|
-
return {
|
|
674
|
-
prompt: pythonPrompt,
|
|
675
|
-
likelySingleLine: true
|
|
676
|
-
};
|
|
677
|
-
}
|
|
678
|
-
if (this._capability.promptTerminator && lineText.trim().endsWith(this._capability.promptTerminator)) {
|
|
679
|
-
const adjustedPrompt = this._adjustPrompt(lineText, lineText, this._capability.promptTerminator);
|
|
680
|
-
if (adjustedPrompt) {
|
|
681
|
-
return adjustedPrompt;
|
|
682
|
-
}
|
|
683
|
-
}
|
|
684
|
-
const cmdMatch = lineText.match(/^(?<prompt>(\(.+\)\s)?(?:[A-Z]:\\.*>))/);
|
|
685
|
-
return cmdMatch?.groups?.prompt ? {
|
|
686
|
-
prompt: cmdMatch.groups.prompt,
|
|
687
|
-
likelySingleLine: true
|
|
688
|
-
} : undefined;
|
|
689
|
-
}
|
|
690
|
-
_adjustPrompt(prompt, lineText, char) {
|
|
691
|
-
if (!prompt) {
|
|
692
|
-
return;
|
|
693
|
-
}
|
|
694
|
-
if (lineText === prompt && prompt.endsWith(char)) {
|
|
695
|
-
prompt += ' ';
|
|
696
|
-
}
|
|
697
|
-
return prompt;
|
|
698
|
-
}
|
|
699
|
-
};
|
|
700
|
-
WindowsPtyHeuristics = ( __decorate([
|
|
701
|
-
( __param(3, ILogService))
|
|
702
|
-
], WindowsPtyHeuristics));
|
|
703
|
-
function getLinesForCommand(buffer, command, cols, outputMatcher) {
|
|
704
|
-
if (!outputMatcher) {
|
|
705
|
-
return undefined;
|
|
706
|
-
}
|
|
707
|
-
const executedMarker = command.executedMarker;
|
|
708
|
-
const endMarker = command.endMarker;
|
|
709
|
-
if (!executedMarker || !endMarker) {
|
|
710
|
-
return undefined;
|
|
711
|
-
}
|
|
712
|
-
const startLine = executedMarker.line;
|
|
713
|
-
const endLine = endMarker.line;
|
|
714
|
-
const linesToCheck = outputMatcher.length;
|
|
715
|
-
const lines = [];
|
|
716
|
-
if (outputMatcher.anchor === 'bottom') {
|
|
717
|
-
for (let i = endLine - (outputMatcher.offset || 0); i >= startLine; i--) {
|
|
718
|
-
let wrappedLineStart = i;
|
|
719
|
-
const wrappedLineEnd = i;
|
|
720
|
-
while (wrappedLineStart >= startLine && buffer.getLine(wrappedLineStart)?.isWrapped) {
|
|
721
|
-
wrappedLineStart--;
|
|
722
|
-
}
|
|
723
|
-
i = wrappedLineStart;
|
|
724
|
-
lines.unshift(getXtermLineContent(buffer, wrappedLineStart, wrappedLineEnd, cols));
|
|
725
|
-
if (lines.length > linesToCheck) {
|
|
726
|
-
lines.pop();
|
|
727
|
-
}
|
|
728
|
-
}
|
|
729
|
-
}
|
|
730
|
-
else {
|
|
731
|
-
for (let i = startLine + (outputMatcher.offset || 0); i < endLine; i++) {
|
|
732
|
-
const wrappedLineStart = i;
|
|
733
|
-
let wrappedLineEnd = i;
|
|
734
|
-
while (wrappedLineEnd + 1 < endLine && buffer.getLine(wrappedLineEnd + 1)?.isWrapped) {
|
|
735
|
-
wrappedLineEnd++;
|
|
736
|
-
}
|
|
737
|
-
i = wrappedLineEnd;
|
|
738
|
-
lines.push(getXtermLineContent(buffer, wrappedLineStart, wrappedLineEnd, cols));
|
|
739
|
-
if (lines.length === linesToCheck) {
|
|
740
|
-
lines.shift();
|
|
741
|
-
}
|
|
742
|
-
}
|
|
743
|
-
}
|
|
744
|
-
return lines;
|
|
745
|
-
}
|
|
746
|
-
function getXtermLineContent(buffer, lineStart, lineEnd, cols) {
|
|
747
|
-
const maxLineLength = Math.max(2048 / cols * 2);
|
|
748
|
-
lineEnd = Math.min(lineEnd, lineStart + maxLineLength);
|
|
749
|
-
let content = '';
|
|
750
|
-
for (let i = lineStart; i <= lineEnd; i++) {
|
|
751
|
-
const line = buffer.getLine(i);
|
|
752
|
-
if (line) {
|
|
753
|
-
content += line.translateToString(true, 0, cols);
|
|
754
|
-
}
|
|
755
|
-
}
|
|
756
|
-
return content;
|
|
757
|
-
}
|
|
758
|
-
function cloneMarker(xterm, marker, offset = 0) {
|
|
759
|
-
return xterm.registerMarker(marker.line - (xterm.buffer.active.baseY + xterm.buffer.active.cursorY) + offset);
|
|
760
|
-
}
|
|
761
|
-
export { CommandDetectionCapability, getLinesForCommand };
|