@codingame/monaco-vscode-api 1.83.15 → 1.85.0-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +430 -0
- package/api.js +13 -7
- package/assets/clear.mp3 +0 -0
- package/assets/format.mp3 +0 -0
- package/assets/save.mp3 +0 -0
- package/contributions.js +3 -0
- package/extensions.d.ts +13 -3
- package/external/{xterm-addon-image/typings/xterm-addon-image.d.ts → @xterm/addon-image/typings/addon-image.d.ts} +1 -1
- package/external/{xterm → @xterm/xterm}/typings/xterm.d.ts +13 -1
- package/lifecycle.js +2 -2
- package/localExtensionHost.js +6 -3
- package/missing-services.js +170 -22
- package/monaco-editor-treemending.patch +6884 -18018
- package/monaco-treemending.js +2 -2
- package/package.json +7 -7
- package/service-override/tools/editor.d.ts +8 -8
- package/service-override/tools/editor.js +44 -19
- package/services.d.ts +2 -2
- package/services.js +3 -3
- package/vscode/src/vs/base/browser/broadcast.js +6 -5
- package/vscode/src/vs/base/browser/dnd.d.ts +6 -0
- package/vscode/src/vs/base/browser/mouseEvent.d.ts +1 -1
- package/vscode/src/vs/base/browser/touch.d.ts +10 -0
- package/vscode/src/vs/base/browser/ui/actionbar/actionbar.d.ts +1 -0
- package/vscode/src/vs/base/browser/ui/iconLabel/iconHoverDelegate.d.ts +22 -15
- package/vscode/src/vs/base/browser/ui/menu/menubar.js +4 -3
- package/vscode/src/vs/base/browser/ui/splitview/paneview.css.js +1 -1
- package/vscode/src/vs/base/browser/ui/splitview/paneview.d.ts +3 -0
- package/vscode/src/vs/base/browser/ui/splitview/paneview.js +34 -11
- package/vscode/src/vs/base/common/actions.d.ts +1 -15
- package/vscode/src/vs/base/common/async.d.ts +1 -31
- package/vscode/src/vs/base/common/event.d.ts +2 -1
- package/vscode/src/vs/base/common/observableInternal/base.d.ts +23 -10
- package/vscode/src/vs/base/common/prefixTree.js +140 -0
- package/vscode/src/vs/base/common/product.d.ts +16 -2
- package/vscode/src/vs/base/common/resourceTree.js +135 -0
- package/vscode/src/vs/base/common/skipList.js +1 -0
- package/vscode/src/vs/base/common/tfIdf.js +137 -0
- package/vscode/src/vs/base/common/types.d.ts +13 -1
- package/vscode/src/vs/base/common/verifier.js +62 -0
- package/vscode/src/vs/editor/browser/editorBrowser.d.ts +4 -2
- package/vscode/src/vs/editor/common/config/editorOptions.d.ts +23 -4
- package/vscode/src/vs/editor/common/core/lineRange.d.ts +1 -0
- package/vscode/src/vs/editor/common/core/offsetRange.d.ts +3 -0
- package/vscode/src/vs/editor/common/core/position.d.ts +1 -0
- package/vscode/src/vs/editor/common/editorCommon.d.ts +2 -1
- package/vscode/src/vs/editor/common/languages.d.ts +23 -1
- package/vscode/src/vs/editor/common/services/languageFeatures.d.ts +2 -1
- package/vscode/src/vs/editor/common/services/resolverService.d.ts +11 -2
- package/vscode/src/vs/platform/accessibility/common/accessibility.d.ts +16 -1
- package/vscode/src/vs/platform/action/common/action.d.ts +8 -0
- package/vscode/src/vs/platform/actions/browser/dropdownWithPrimaryActionViewItem.js +4 -0
- package/vscode/src/vs/platform/actions/browser/floatingMenu.js +26 -2
- package/vscode/src/vs/platform/actions/common/actions.d.ts +8 -0
- package/vscode/src/vs/platform/audioCues/browser/audioCueService.d.ts +6 -0
- package/vscode/src/vs/platform/commands/common/commands.d.ts +13 -5
- package/vscode/src/vs/platform/dialogs/common/dialogs.d.ts +9 -3
- package/vscode/src/vs/platform/dialogs/common/dialogs.js +5 -2
- package/vscode/src/vs/platform/editor/common/editor.d.ts +3 -15
- package/vscode/src/vs/platform/extensionManagement/common/extensionManagement.d.ts +1 -0
- package/vscode/src/vs/platform/extensionManagement/common/extensionManagement.js +3 -15
- package/vscode/src/vs/platform/extensionManagement/common/implicitActivationEvents.js +5 -0
- package/vscode/src/vs/platform/extensions/common/extensions.d.ts +0 -1
- package/vscode/src/vs/platform/files/common/files.d.ts +72 -8
- package/vscode/src/vs/platform/files/common/watcher.js +77 -0
- package/vscode/src/vs/platform/keybinding/common/keybindingsRegistry.d.ts +2 -2
- package/vscode/src/vs/platform/layout/browser/layoutService.d.ts +52 -21
- package/vscode/src/vs/platform/request/browser/requestService.js +3 -0
- package/vscode/src/vs/platform/request/common/requestIpc.js +17 -0
- package/vscode/src/vs/platform/storage/common/storage.js +2 -2
- package/vscode/src/vs/platform/telemetry/common/telemetry.d.ts +1 -0
- package/vscode/src/vs/platform/terminal/common/capabilities/bufferMarkCapability.js +41 -0
- package/vscode/src/vs/platform/terminal/common/capabilities/capabilities.d.ts +12 -7
- package/vscode/src/vs/platform/terminal/common/capabilities/{commandDetectionCapability.d.ts → commandDetection/terminalCommand.d.ts} +3 -2
- package/vscode/src/vs/platform/terminal/common/capabilities/commandDetection/terminalCommand.js +257 -0
- package/vscode/src/vs/platform/terminal/common/capabilities/commandDetectionCapability.js +651 -0
- package/vscode/src/vs/platform/terminal/common/capabilities/cwdDetectionCapability.js +29 -0
- package/vscode/src/vs/platform/terminal/common/capabilities/partialCommandDetectionCapability.js +48 -0
- package/vscode/src/vs/platform/terminal/common/capabilities/terminalCapabilityStore.js +94 -0
- package/vscode/src/vs/platform/terminal/common/terminalEnvironment.js +37 -0
- package/vscode/src/vs/platform/terminal/common/terminalStrings.js +16 -0
- package/vscode/src/vs/platform/terminal/common/xterm/shellIntegrationAddon.js +319 -0
- package/vscode/src/vs/platform/window/common/window.d.ts +9 -2
- package/vscode/src/vs/platform/window/common/window.js +6 -1
- package/vscode/src/vs/platform/workspaces/common/workspaces.d.ts +2 -43
- package/vscode/src/vs/workbench/api/common/extHost.api.impl.js +113 -81
- package/vscode/src/vs/workbench/api/common/extHost.protocol.js +5 -4
- package/vscode/src/vs/workbench/api/common/extHostApiCommands.js +25 -3
- package/vscode/src/vs/workbench/api/common/extHostChat.js +13 -163
- package/vscode/src/vs/workbench/api/common/extHostChatAgents2.js +412 -0
- package/vscode/src/vs/workbench/api/common/extHostChatProvider.js +79 -11
- package/vscode/src/vs/workbench/api/common/extHostCommands.js +13 -12
- package/vscode/src/vs/workbench/api/common/extHostComments.js +1 -1
- package/vscode/src/vs/workbench/api/common/extHostEditorTabs.js +8 -6
- package/vscode/src/vs/workbench/api/common/extHostExtensionService.js +1 -1
- package/vscode/src/vs/workbench/api/common/extHostFileSystemEventService.js +36 -19
- package/vscode/src/vs/workbench/api/common/extHostInlineChat.js +52 -31
- package/vscode/src/vs/workbench/api/common/extHostIssueReporter.js +38 -0
- package/vscode/src/vs/workbench/api/common/extHostLanguageFeatures.js +28 -3
- package/vscode/src/vs/workbench/api/common/extHostLanguages.js +10 -0
- package/vscode/src/vs/workbench/api/common/extHostNotebook.js +117 -2
- package/vscode/src/vs/workbench/api/common/extHostNotebookKernels.js +32 -4
- package/vscode/src/vs/workbench/api/common/extHostSCM.js +85 -23
- package/vscode/src/vs/workbench/api/common/extHostSearch.js +3 -0
- package/vscode/src/vs/workbench/api/common/extHostSpeech.js +42 -0
- package/vscode/src/vs/workbench/api/common/extHostTask.js +2 -1
- package/vscode/src/vs/workbench/api/common/extHostTelemetry.js +1 -0
- package/vscode/src/vs/workbench/api/common/extHostTerminalService.js +3 -3
- package/vscode/src/vs/workbench/api/common/extHostTesting.js +97 -47
- package/vscode/src/vs/workbench/api/common/extHostTypeConverters.js +115 -16
- package/vscode/src/vs/workbench/api/common/extHostTypes.js +66 -36
- package/vscode/src/vs/workbench/api/common/extHostWorkspace.js +6 -1
- package/vscode/src/vs/workbench/browser/actions/layoutActions.js +182 -75
- package/vscode/src/vs/workbench/browser/actions/windowActions.js +176 -4
- package/vscode/src/vs/workbench/browser/actions/workspaceActions.js +143 -2
- package/vscode/src/vs/workbench/browser/actions/workspaceCommands.js +237 -0
- package/vscode/src/vs/workbench/browser/composite.d.ts +0 -4
- package/vscode/src/vs/workbench/browser/composite.js +5 -4
- package/vscode/src/vs/workbench/browser/dnd.js +72 -23
- package/vscode/src/vs/workbench/browser/labels.js +7 -3
- package/vscode/src/vs/workbench/browser/media/part.css.js +1 -1
- package/vscode/src/vs/workbench/browser/panecomposite.d.ts +2 -2
- package/vscode/src/vs/workbench/browser/panecomposite.js +2 -0
- package/vscode/src/vs/workbench/browser/part.js +33 -2
- package/vscode/src/vs/workbench/browser/parts/compositeBarActions.js +99 -117
- package/vscode/src/vs/workbench/browser/parts/editor/editor.contribution.js +173 -33
- package/vscode/src/vs/workbench/browser/parts/editor/editor.js +102 -6
- package/vscode/src/vs/workbench/browser/parts/editor/editorActions.js +256 -17
- package/vscode/src/vs/workbench/browser/parts/editor/editorAutoSave.js +4 -0
- package/vscode/src/vs/workbench/browser/parts/editor/editorCommands.js +68 -35
- package/vscode/src/vs/workbench/browser/parts/editor/editorPlaceholder.js +5 -5
- package/vscode/src/vs/workbench/browser/parts/editor/editorStatus.js +35 -16
- package/vscode/src/vs/workbench/browser/parts/editor/editorTabsControl.js +348 -0
- package/vscode/src/vs/workbench/browser/parts/editor/editorsObserver.js +43 -31
- package/vscode/src/vs/workbench/browser/parts/editor/media/editortabscontrol.css.js +4 -0
- package/vscode/src/vs/workbench/browser/parts/editor/sideBySideEditor.js +1 -0
- package/vscode/src/vs/workbench/browser/parts/editor/textCodeEditor.js +1 -0
- package/vscode/src/vs/workbench/browser/parts/editor/textDiffEditor.js +14 -2
- package/vscode/src/vs/workbench/browser/parts/editor/textEditor.js +4 -4
- package/vscode/src/vs/workbench/browser/parts/globalCompositeBar.js +277 -0
- package/vscode/src/vs/workbench/browser/parts/notifications/notificationsCommands.js +5 -2
- package/vscode/src/vs/workbench/browser/parts/panel/media/panelpart.css.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/panel/panelActions.js +3 -38
- package/vscode/src/vs/workbench/browser/parts/statusbar/statusbarPart.d.ts +54 -52
- package/vscode/src/vs/workbench/browser/parts/titlebar/menubarControl.js +2 -1
- package/vscode/src/vs/workbench/browser/parts/titlebar/titlebarPart.d.ts +25 -0
- package/vscode/src/vs/workbench/browser/parts/titlebar/windowTitle.js +258 -0
- package/vscode/src/vs/workbench/browser/parts/views/media/paneviewlet.css.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/views/viewPane.d.ts +2 -5
- package/vscode/src/vs/workbench/browser/parts/views/viewPane.js +157 -117
- package/vscode/src/vs/workbench/browser/parts/views/viewPaneContainer.js +50 -23
- package/vscode/src/vs/workbench/browser/parts/views/viewsService.js +26 -11
- package/vscode/src/vs/workbench/browser/parts/views/viewsViewlet.js +10 -6
- package/vscode/src/vs/workbench/browser/style.js +2 -1
- package/vscode/src/vs/workbench/browser/web.api.d.ts +39 -2
- package/vscode/src/vs/workbench/browser/window.js +55 -0
- package/vscode/src/vs/workbench/browser/workbench.contribution.js +220 -40
- package/vscode/src/vs/workbench/common/activity.js +3 -0
- package/vscode/src/vs/workbench/common/contextkeys.js +35 -5
- package/vscode/src/vs/workbench/common/contributions.js +4 -3
- package/vscode/src/vs/workbench/common/editor/diffEditorInput.js +14 -4
- package/vscode/src/vs/workbench/common/editor/diffEditorModel.js +1 -1
- package/vscode/src/vs/workbench/common/editor/editorGroupModel.js +22 -19
- package/vscode/src/vs/workbench/common/editor/editorInput.d.ts +4 -3
- package/vscode/src/vs/workbench/common/editor/editorModel.d.ts +1 -2
- package/vscode/src/vs/workbench/common/editor/sideBySideEditorInput.js +22 -4
- package/vscode/src/vs/workbench/common/editor/textResourceEditorInput.js +3 -3
- package/vscode/src/vs/workbench/common/editor.d.ts +60 -30
- package/vscode/src/vs/workbench/common/editor.js +11 -3
- package/vscode/src/vs/workbench/common/theme.js +2 -2
- package/vscode/src/vs/workbench/common/views.d.ts +4 -4
- package/vscode/src/vs/workbench/common/views.js +3 -1
- package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibilityConfiguration.js +97 -8
- package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibilityContributions.js +17 -99
- package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibleView.js +103 -37
- package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibleViewActions.js +2 -3
- package/vscode/src/vs/workbench/contrib/accessibility/browser/editorAccessibilityHelp.js +127 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatActions.js +71 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chat.js +2 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatAgents.js +33 -110
- package/vscode/src/vs/workbench/contrib/chat/common/chatContextKeys.js +64 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatParserTypes.js +94 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatService.js +6 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatSlashCommands.js +1 -88
- package/vscode/src/vs/workbench/contrib/codeActions/browser/codeActionsContribution.js +4 -4
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/diffEditorHelper.js +3 -2
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/quickaccess/gotoSymbolQuickAccess.js +3 -1
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/saveParticipants.js +15 -16
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/suggestEnabledInput/suggestEnabledInput.js +91 -1
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/toggleWordWrap.js +9 -3
- package/vscode/src/vs/workbench/contrib/comments/browser/comments.contribution.js +3 -1
- package/vscode/src/vs/workbench/contrib/comments/browser/simpleCommentEditor.js +2 -3
- package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditorInput.js +1 -0
- package/vscode/src/vs/workbench/contrib/debug/common/debug.d.ts +9 -1
- package/vscode/src/vs/workbench/contrib/debug/common/debug.js +10 -1
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsActions.js +114 -22
- package/vscode/src/vs/workbench/contrib/extensions/browser/media/extensionActions.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/extensions/common/extensions.js +4 -1
- package/vscode/src/vs/workbench/contrib/files/browser/explorerFileContrib.js +19 -0
- package/vscode/src/vs/workbench/contrib/files/browser/explorerViewlet.js +10 -8
- package/vscode/src/vs/workbench/contrib/files/browser/fileActions.js +62 -10
- package/vscode/src/vs/workbench/contrib/files/browser/fileConstants.js +2 -1
- package/vscode/src/vs/workbench/contrib/files/browser/fileImportExport.js +9 -8
- package/vscode/src/vs/workbench/contrib/files/browser/files.contribution.js +10 -1
- package/vscode/src/vs/workbench/contrib/files/browser/files.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/files/browser/files.js +7 -3
- package/vscode/src/vs/workbench/contrib/files/browser/views/emptyView.js +4 -4
- package/vscode/src/vs/workbench/contrib/files/browser/views/explorerView.js +64 -36
- package/vscode/src/vs/workbench/contrib/files/browser/views/explorerViewer.js +42 -17
- package/vscode/src/vs/workbench/contrib/files/browser/views/openEditorsView.js +145 -25
- package/vscode/src/vs/workbench/contrib/format/browser/formatActionsMultiple.js +423 -0
- package/vscode/src/vs/workbench/contrib/format/browser/formatActionsNone.js +82 -0
- package/vscode/src/vs/workbench/contrib/format/browser/formatModified.js +1 -1
- package/vscode/src/vs/workbench/contrib/inlineChat/common/inlineChat.js +36 -0
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookCommon.js +3 -1
- package/vscode/src/vs/workbench/contrib/preferences/common/preferences.js +24 -3
- package/vscode/src/vs/workbench/contrib/scm/browser/dirtydiffDecorator.js +11 -6
- package/vscode/src/vs/workbench/contrib/scm/common/scm.js +1 -2
- package/vscode/src/vs/workbench/contrib/search/browser/notebookSearch/searchNotebookHelpers.js +31 -0
- package/vscode/src/vs/workbench/contrib/search/browser/searchModel.js +61 -41
- package/vscode/src/vs/workbench/contrib/search/{browser/searchNotebookHelpers.js → common/cellSearchModel.js} +4 -63
- package/vscode/src/vs/workbench/contrib/search/common/searchNotebookHelpers.js +40 -0
- package/vscode/src/vs/workbench/contrib/snippets/browser/snippetsFile.js +2 -2
- package/vscode/src/vs/workbench/contrib/speech/common/speechService.js +3 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/detachedTerminal.js +92 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminal.d.ts +100 -79
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalConfigHelper.d.ts +3 -3
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalEditorInput.js +1 -1
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalExtensions.js +25 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalIcon.js +7 -4
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalIcons.js +64 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/widgets/widgetManager.js +36 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/decorationAddon.js +540 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/decorationStyles.js +104 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/markNavigationAddon.js +518 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/suggestAddon.js +390 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/xtermTerminal.d.ts +17 -11
- package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/xtermTerminal.js +814 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/xterm-private.d.ts +5 -2
- package/vscode/src/vs/workbench/contrib/terminal/common/terminal.d.ts +2 -8
- package/vscode/src/vs/workbench/contrib/terminal/common/terminal.js +2 -0
- package/vscode/src/vs/workbench/contrib/testing/common/getComputedState.js +101 -0
- package/vscode/src/vs/workbench/contrib/testing/common/observableValue.js +30 -0
- package/vscode/src/vs/workbench/contrib/testing/common/storedValue.js +36 -0
- package/vscode/src/vs/workbench/contrib/testing/common/testCoverage.js +115 -0
- package/vscode/src/vs/workbench/contrib/testing/common/testCoverageService.js +74 -0
- package/vscode/src/vs/workbench/contrib/testing/common/testExplorerFilterState.js +116 -0
- package/vscode/src/vs/workbench/contrib/testing/common/testProfileService.js +172 -1
- package/vscode/src/vs/workbench/contrib/testing/common/testResult.js +384 -0
- package/vscode/src/vs/workbench/contrib/testing/common/testResultService.js +156 -1
- package/vscode/src/vs/workbench/contrib/testing/common/testResultStorage.js +156 -0
- package/vscode/src/vs/workbench/contrib/testing/common/testService.js +75 -1
- package/vscode/src/vs/workbench/contrib/testing/common/testTypes.js +72 -1
- package/vscode/src/vs/workbench/contrib/testing/common/testingContextKeys.js +188 -0
- package/vscode/src/vs/workbench/contrib/testing/common/testingContinuousRunService.js +102 -0
- package/vscode/src/vs/workbench/contrib/testing/common/testingDecorations.js +29 -0
- package/vscode/src/vs/workbench/{services/editor/browser/editorDropService.js → contrib/testing/common/testingPeekOpener.js} +2 -2
- package/vscode/src/vs/workbench/contrib/testing/common/testingStates.js +47 -0
- package/vscode/src/vs/workbench/contrib/webview/browser/webviewWindowDragMonitor.js +4 -3
- package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewEditor.js +8 -9
- package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewEditorInput.js +1 -1
- package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewIconManager.js +5 -2
- package/vscode/src/vs/workbench/services/activity/browser/activityService.d.ts +16 -10
- package/vscode/src/vs/workbench/services/activity/common/activity.d.ts +14 -1
- package/vscode/src/vs/workbench/services/activity/common/activity.js +1 -7
- package/vscode/src/vs/workbench/services/authentication/browser/authenticationService.js +9 -28
- package/vscode/src/vs/workbench/services/auxiliaryWindow/browser/auxiliaryWindowService.js +273 -0
- package/vscode/src/vs/workbench/services/configurationResolver/common/configurationResolver.js +1 -0
- package/vscode/src/vs/workbench/services/configurationResolver/common/variableResolver.js +2 -0
- package/vscode/src/vs/workbench/services/decorations/browser/decorationsService.js +2 -3
- package/vscode/src/vs/workbench/services/editor/browser/editorService.d.ts +7 -5
- package/vscode/src/vs/workbench/services/editor/browser/editorService.js +59 -37
- package/vscode/src/vs/workbench/services/editor/common/editorGroupsService.d.ts +193 -94
- package/vscode/src/vs/workbench/services/editor/common/editorGroupsService.js +2 -2
- package/vscode/src/vs/workbench/services/editor/common/editorResolverService.d.ts +8 -2
- package/vscode/src/vs/workbench/services/editor/common/editorService.d.ts +8 -1
- package/vscode/src/vs/workbench/services/extensionRecommendations/common/workspaceExtensionsConfig.js +62 -16
- package/vscode/src/vs/workbench/services/extensions/browser/extensionUrlHandler.js +5 -3
- package/vscode/src/vs/workbench/services/extensions/common/abstractExtensionService.d.ts +3 -2
- package/vscode/src/vs/workbench/services/extensions/common/extensionDescriptionRegistry.js +4 -9
- package/vscode/src/vs/workbench/services/extensions/common/{extensionHostManager.d.ts → extensionHostManagers.d.ts} +2 -0
- package/vscode/src/vs/workbench/services/extensions/common/extensionRunningLocationTracker.d.ts +1 -1
- package/vscode/src/vs/workbench/services/extensions/common/extensions.d.ts +9 -0
- package/vscode/src/vs/workbench/services/extensions/common/extensions.js +22 -0
- package/vscode/src/vs/workbench/services/extensions/common/extensionsApiProposals.js +14 -3
- package/vscode/src/vs/workbench/services/extensions/common/extensionsRegistry.js +9 -0
- package/vscode/src/vs/workbench/services/filesConfiguration/common/filesConfigurationService.js +3 -3
- package/vscode/src/vs/workbench/services/history/common/history.d.ts +2 -2
- package/vscode/src/vs/workbench/services/host/browser/browserHostService.js +49 -18
- package/vscode/src/vs/workbench/services/host/browser/host.d.ts +29 -7
- package/vscode/src/vs/workbench/services/hover/browser/hover.d.ts +51 -28
- package/vscode/src/vs/workbench/services/hover/browser/hoverService.d.ts +5 -2
- package/vscode/src/vs/workbench/services/keybinding/browser/unboundCommands.js +2 -2
- package/vscode/src/vs/workbench/services/languageStatus/common/languageStatusService.d.ts +4 -1
- package/vscode/src/vs/workbench/services/layout/browser/layoutService.d.ts +40 -36
- package/vscode/src/vs/workbench/services/panecomposite/browser/panecomposite.d.ts +0 -6
- package/vscode/src/vs/workbench/services/preferences/common/preferences.d.ts +3 -0
- package/vscode/src/vs/workbench/services/progress/browser/progressIndicator.js +2 -2
- package/vscode/src/vs/workbench/services/remote/common/remoteExplorerService.d.ts +16 -1
- package/vscode/src/vs/workbench/services/request/browser/requestService.js +48 -0
- package/vscode/src/vs/workbench/services/search/common/searchHelpers.js +4 -4
- package/vscode/src/vs/workbench/services/statusbar/browser/statusbar.d.ts +10 -51
- package/vscode/src/vs/workbench/services/suggest/browser/media/suggest.css.js +4 -0
- package/vscode/src/vs/workbench/services/suggest/browser/simpleCompletionItem.js +10 -0
- package/vscode/src/vs/workbench/services/suggest/browser/simpleCompletionModel.js +98 -0
- package/vscode/src/vs/workbench/services/suggest/browser/simpleSuggestWidget.js +428 -0
- package/vscode/src/vs/workbench/services/suggest/browser/simpleSuggestWidgetRenderer.js +83 -0
- package/vscode/src/vs/workbench/services/textfile/browser/textFileService.js +32 -1
- package/vscode/src/vs/workbench/services/textfile/common/textEditorService.js +1 -5
- package/vscode/src/vs/workbench/services/themes/browser/browserHostColorSchemeService.js +4 -3
- package/vscode/src/vs/workbench/services/themes/common/iconExtensionPoint.js +9 -3
- package/vscode/src/vs/workbench/services/title/browser/titleService.d.ts +18 -0
- package/vscode/src/vs/workbench/services/untitled/common/untitledTextEditorInput.js +18 -3
- package/vscode/src/vs/workbench/services/untitled/common/untitledTextEditorModel.js +16 -7
- package/vscode/src/vs/workbench/services/untitled/common/untitledTextEditorService.d.ts +6 -0
- package/vscode/src/vs/workbench/services/untitled/common/untitledTextEditorService.js +13 -0
- package/vscode/src/vs/workbench/services/url/browser/urlService.js +2 -1
- package/vscode/src/vs/workbench/services/userActivity/common/userActivityService.js +2 -2
- package/vscode/src/vs/workbench/services/userDataProfile/common/userDataProfileIcons.js +9 -0
- package/vscode-dts/vscode.proposed.chatAgents2.d.ts +375 -0
- package/vscode-dts/vscode.proposed.chatAgents2Additions.d.ts +80 -0
- package/vscode-dts/vscode.proposed.chatProvider.d.ts +5 -1
- package/vscode-dts/vscode.proposed.chatRequestAccess.d.ts +68 -10
- package/vscode-dts/vscode.proposed.chatTab.d.ts +21 -0
- package/vscode-dts/vscode.proposed.chatVariables.d.ts +5 -1
- package/vscode-dts/vscode.proposed.codeActionAI.d.ts +16 -0
- package/vscode-dts/vscode.proposed.contribSourceControlInputBoxMenu.d.ts +7 -0
- package/vscode-dts/vscode.proposed.createFileSystemWatcher.d.ts +51 -0
- package/vscode-dts/vscode.proposed.defaultChatAgent.d.ts +30 -0
- package/vscode-dts/vscode.proposed.handleIssueUri.d.ts +26 -0
- package/vscode-dts/vscode.proposed.interactive.d.ts +26 -100
- package/vscode-dts/vscode.proposed.interactiveUserActions.d.ts +14 -7
- package/vscode-dts/vscode.proposed.languageStatusText.d.ts +12 -0
- package/vscode-dts/vscode.proposed.multiDocumentHighlightProvider.d.ts +63 -0
- package/vscode-dts/vscode.proposed.notebookVariableProvider.d.ts +43 -0
- package/vscode-dts/vscode.proposed.resolvers.d.ts +100 -1
- package/vscode-dts/vscode.proposed.scmHistoryProvider.d.ts +9 -1
- package/vscode-dts/vscode.proposed.scmInputBoxActionButton.d.ts +19 -0
- package/vscode-dts/vscode.proposed.scmInputBoxValueProvider.d.ts +25 -0
- package/vscode-dts/vscode.proposed.speech.d.ts +35 -0
- package/vscode-dts/vscode.proposed.terminalQuickFixProvider.d.ts +11 -7
- package/vscode-dts/vscode.proposed.testCoverage.d.ts +6 -1
- package/vscode-dts/vscode.proposed.testingActiveProfile.d.ts +21 -0
- package/external/xterm-headless/typings/xterm-headless.d.ts +0 -49
- package/vscode/src/vs/platform/backup/common/backup.d.ts +0 -14
- package/vscode/src/vs/platform/update/common/update.d.ts +0 -112
- package/vscode/src/vs/workbench/api/common/extHostChatAgents.js +0 -62
- package/vscode/src/vs/workbench/api/common/extHostChatSlashCommand.js +0 -62
- package/vscode/src/vs/workbench/browser/parts/paneCompositePart.d.ts +0 -56
- package/vscode/src/vs/workbench/services/files/common/files.js +0 -4
- package/vscode/src/vs/workbench/services/host/browser/browserHostService.d.ts +0 -41
- package/vscode/src/vs/workbench/services/title/common/titleService.d.ts +0 -31
- package/vscode-dts/vscode.proposed.chatAgents.d.ts +0 -39
- package/vscode-dts/vscode.proposed.chatSlashCommands.d.ts +0 -47
- package/vscode-dts/vscode.proposed.testMessageContextValue.d.ts +0 -45
- /package/external/{xterm-addon-canvas/typings/xterm-addon-canvas.d.ts → @xterm/addon-canvas/typings/addon-canvas.d.ts} +0 -0
- /package/external/{xterm-addon-search/typings/xterm-addon-search.d.ts → @xterm/addon-search/typings/addon-search.d.ts} +0 -0
- /package/external/{xterm-addon-serialize/typings/xterm-addon-serialize.d.ts → @xterm/addon-serialize/typings/addon-serialize.d.ts} +0 -0
- /package/external/{xterm-addon-unicode11/typings/xterm-addon-unicode11.d.ts → @xterm/addon-unicode11/typings/addon-unicode11.d.ts} +0 -0
- /package/external/{xterm-addon-webgl/typings/xterm-addon-webgl.d.ts → @xterm/addon-webgl/typings/addon-webgl.d.ts} +0 -0
- /package/vscode/src/vs/workbench/services/title/{common → browser}/titleService.js +0 -0
|
@@ -0,0 +1,651 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import { RunOnceScheduler } from 'monaco-editor/esm/vs/base/common/async.js';
|
|
3
|
+
import { debounce } from 'monaco-editor/esm/vs/base/common/decorators.js';
|
|
4
|
+
import { Emitter } from 'monaco-editor/esm/vs/base/common/event.js';
|
|
5
|
+
import { Disposable, MandatoryMutableDisposable, MutableDisposable } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
6
|
+
import { ILogService } from 'monaco-editor/esm/vs/platform/log/common/log.js';
|
|
7
|
+
import { PartialTerminalCommand, TerminalCommand } from './commandDetection/terminalCommand.js';
|
|
8
|
+
class CommandDetectionCapability extends Disposable {
|
|
9
|
+
get commands() { return this._commands; }
|
|
10
|
+
get executingCommand() { return this._currentCommand.command; }
|
|
11
|
+
get executingCommandObject() {
|
|
12
|
+
if (this._currentCommand.commandStartMarker) {
|
|
13
|
+
return { marker: this._currentCommand.commandStartMarker };
|
|
14
|
+
}
|
|
15
|
+
return undefined;
|
|
16
|
+
}
|
|
17
|
+
get currentCommand() {
|
|
18
|
+
return this._currentCommand;
|
|
19
|
+
}
|
|
20
|
+
get cwd() { return this._cwd; }
|
|
21
|
+
get _isInputting() {
|
|
22
|
+
return !!(this._currentCommand.commandStartMarker && !this._currentCommand.commandExecutedMarker);
|
|
23
|
+
}
|
|
24
|
+
get hasInput() {
|
|
25
|
+
if (!this._isInputting || !this._currentCommand?.commandStartMarker) {
|
|
26
|
+
return undefined;
|
|
27
|
+
}
|
|
28
|
+
if (this._terminal.buffer.active.baseY + this._terminal.buffer.active.cursorY === this._currentCommand.commandStartMarker?.line) {
|
|
29
|
+
const line = this._terminal.buffer.active.getLine(this._terminal.buffer.active.cursorY)?.translateToString(true, this._currentCommand.commandStartX);
|
|
30
|
+
if (line === undefined) {
|
|
31
|
+
return undefined;
|
|
32
|
+
}
|
|
33
|
+
return line.length > 0;
|
|
34
|
+
}
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
constructor(_terminal, _logService) {
|
|
38
|
+
super();
|
|
39
|
+
this._terminal = _terminal;
|
|
40
|
+
this._logService = _logService;
|
|
41
|
+
this.type = 2 ;
|
|
42
|
+
this._commands = [];
|
|
43
|
+
this._currentCommand = ( new PartialTerminalCommand(this._terminal));
|
|
44
|
+
this._commandMarkers = [];
|
|
45
|
+
this.__isCommandStorageDisabled = false;
|
|
46
|
+
this._onCommandStarted = this._register(( new Emitter()));
|
|
47
|
+
this.onCommandStarted = this._onCommandStarted.event;
|
|
48
|
+
this._onBeforeCommandFinished = this._register(( new Emitter()));
|
|
49
|
+
this.onBeforeCommandFinished = this._onBeforeCommandFinished.event;
|
|
50
|
+
this._onCommandFinished = this._register(( new Emitter()));
|
|
51
|
+
this.onCommandFinished = this._onCommandFinished.event;
|
|
52
|
+
this._onCommandExecuted = this._register(( new Emitter()));
|
|
53
|
+
this.onCommandExecuted = this._onCommandExecuted.event;
|
|
54
|
+
this._onCommandInvalidated = this._register(( new Emitter()));
|
|
55
|
+
this.onCommandInvalidated = this._onCommandInvalidated.event;
|
|
56
|
+
this._onCurrentCommandInvalidated = this._register(( new Emitter()));
|
|
57
|
+
this.onCurrentCommandInvalidated = this._onCurrentCommandInvalidated.event;
|
|
58
|
+
const that = this;
|
|
59
|
+
this._ptyHeuristicsHooks = new (class {
|
|
60
|
+
get onCurrentCommandInvalidatedEmitter() { return that._onCurrentCommandInvalidated; }
|
|
61
|
+
get onCommandStartedEmitter() { return that._onCommandStarted; }
|
|
62
|
+
get onCommandExecutedEmitter() { return that._onCommandExecuted; }
|
|
63
|
+
get dimensions() { return that._dimensions; }
|
|
64
|
+
get isCommandStorageDisabled() { return that.__isCommandStorageDisabled; }
|
|
65
|
+
get commandMarkers() { return that._commandMarkers; }
|
|
66
|
+
set commandMarkers(value) { that._commandMarkers = value; }
|
|
67
|
+
get clearCommandsInViewport() { return that._clearCommandsInViewport.bind(that); }
|
|
68
|
+
commitCommandFinished() {
|
|
69
|
+
that._commitCommandFinished?.flush();
|
|
70
|
+
that._commitCommandFinished = undefined;
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
this._ptyHeuristics = this._register(( new MandatoryMutableDisposable(( new UnixPtyHeuristics(this._terminal, this, this._ptyHeuristicsHooks, this._logService)))));
|
|
74
|
+
this._dimensions = {
|
|
75
|
+
cols: this._terminal.cols,
|
|
76
|
+
rows: this._terminal.rows
|
|
77
|
+
};
|
|
78
|
+
this._register(this._terminal.onResize(e => this._handleResize(e)));
|
|
79
|
+
this._register(this._terminal.onCursorMove(() => this._handleCursorMove()));
|
|
80
|
+
}
|
|
81
|
+
_handleResize(e) {
|
|
82
|
+
this._ptyHeuristics.value.preHandleResize?.(e);
|
|
83
|
+
this._dimensions.cols = e.cols;
|
|
84
|
+
this._dimensions.rows = e.rows;
|
|
85
|
+
}
|
|
86
|
+
_handleCursorMove() {
|
|
87
|
+
if (this._terminal.buffer.active === this._terminal.buffer.normal && this._currentCommand.commandStartMarker) {
|
|
88
|
+
if (this._terminal.buffer.active.baseY + this._terminal.buffer.active.cursorY < this._currentCommand.commandStartMarker.line) {
|
|
89
|
+
this._clearCommandsInViewport();
|
|
90
|
+
this._currentCommand.isInvalid = true;
|
|
91
|
+
this._onCurrentCommandInvalidated.fire({ reason: "windows" });
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
_clearCommandsInViewport() {
|
|
96
|
+
let count = 0;
|
|
97
|
+
for (let i = this._commands.length - 1; i >= 0; i--) {
|
|
98
|
+
const line = this._commands[i].marker?.line;
|
|
99
|
+
if (line && line < this._terminal.buffer.active.baseY) {
|
|
100
|
+
break;
|
|
101
|
+
}
|
|
102
|
+
count++;
|
|
103
|
+
}
|
|
104
|
+
if (count > 0) {
|
|
105
|
+
this._onCommandInvalidated.fire(this._commands.splice(this._commands.length - count, count));
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
setCwd(value) {
|
|
109
|
+
this._cwd = value;
|
|
110
|
+
}
|
|
111
|
+
setIsWindowsPty(value) {
|
|
112
|
+
if (value && !(this._ptyHeuristics.value instanceof WindowsPtyHeuristics)) {
|
|
113
|
+
const that = this;
|
|
114
|
+
this._ptyHeuristics.value = ( new WindowsPtyHeuristics(this._terminal, this, new (class {
|
|
115
|
+
get onCurrentCommandInvalidatedEmitter() { return that._onCurrentCommandInvalidated; }
|
|
116
|
+
get onCommandStartedEmitter() { return that._onCommandStarted; }
|
|
117
|
+
get onCommandExecutedEmitter() { return that._onCommandExecuted; }
|
|
118
|
+
get dimensions() { return that._dimensions; }
|
|
119
|
+
get isCommandStorageDisabled() { return that.__isCommandStorageDisabled; }
|
|
120
|
+
get commandMarkers() { return that._commandMarkers; }
|
|
121
|
+
set commandMarkers(value) { that._commandMarkers = value; }
|
|
122
|
+
get clearCommandsInViewport() { return that._clearCommandsInViewport.bind(that); }
|
|
123
|
+
commitCommandFinished() {
|
|
124
|
+
that._commitCommandFinished?.flush();
|
|
125
|
+
that._commitCommandFinished = undefined;
|
|
126
|
+
}
|
|
127
|
+
}), this._logService));
|
|
128
|
+
}
|
|
129
|
+
else if (!value && !(this._ptyHeuristics.value instanceof UnixPtyHeuristics)) {
|
|
130
|
+
this._ptyHeuristics.value = ( new UnixPtyHeuristics(this._terminal, this, this._ptyHeuristicsHooks, this._logService));
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
setIsCommandStorageDisabled() {
|
|
134
|
+
this.__isCommandStorageDisabled = true;
|
|
135
|
+
}
|
|
136
|
+
getCommandForLine(line) {
|
|
137
|
+
if (this._currentCommand.promptStartMarker && line >= this._currentCommand.promptStartMarker?.line) {
|
|
138
|
+
return this._currentCommand;
|
|
139
|
+
}
|
|
140
|
+
if (this._commands.length === 0) {
|
|
141
|
+
return undefined;
|
|
142
|
+
}
|
|
143
|
+
if ((this._commands[0].promptStartMarker ?? this._commands[0].marker).line > line) {
|
|
144
|
+
return undefined;
|
|
145
|
+
}
|
|
146
|
+
for (let i = this.commands.length - 1; i >= 0; i--) {
|
|
147
|
+
if ((this.commands[i].promptStartMarker ?? this.commands[i].marker).line <= line) {
|
|
148
|
+
return this.commands[i];
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
return undefined;
|
|
152
|
+
}
|
|
153
|
+
getCwdForLine(line) {
|
|
154
|
+
if (this._currentCommand.promptStartMarker && line >= this._currentCommand.promptStartMarker?.line) {
|
|
155
|
+
return this._cwd;
|
|
156
|
+
}
|
|
157
|
+
const command = this.getCommandForLine(line);
|
|
158
|
+
if (command && 'cwd' in command) {
|
|
159
|
+
return command.cwd;
|
|
160
|
+
}
|
|
161
|
+
return undefined;
|
|
162
|
+
}
|
|
163
|
+
handlePromptStart(options) {
|
|
164
|
+
const lastCommand = this.commands.at(-1);
|
|
165
|
+
if (lastCommand?.endMarker && lastCommand?.executedMarker && lastCommand.endMarker.line === lastCommand.executedMarker.line) {
|
|
166
|
+
this._logService.debug('CommandDetectionCapability#handlePromptStart adjusted commandFinished', `${lastCommand.endMarker.line} -> ${lastCommand.executedMarker.line + 1}`);
|
|
167
|
+
lastCommand.endMarker = cloneMarker(this._terminal, lastCommand.executedMarker, 1);
|
|
168
|
+
}
|
|
169
|
+
this._currentCommand.promptStartMarker = options?.marker || (lastCommand?.endMarker ? cloneMarker(this._terminal, lastCommand.endMarker) : this._terminal.registerMarker(0));
|
|
170
|
+
this._logService.debug('CommandDetectionCapability#handlePromptStart', this._terminal.buffer.active.cursorX, this._currentCommand.promptStartMarker?.line);
|
|
171
|
+
}
|
|
172
|
+
handleContinuationStart() {
|
|
173
|
+
this._currentCommand.currentContinuationMarker = this._terminal.registerMarker(0);
|
|
174
|
+
this._logService.debug('CommandDetectionCapability#handleContinuationStart', this._currentCommand.currentContinuationMarker);
|
|
175
|
+
}
|
|
176
|
+
handleContinuationEnd() {
|
|
177
|
+
if (!this._currentCommand.currentContinuationMarker) {
|
|
178
|
+
this._logService.warn('CommandDetectionCapability#handleContinuationEnd Received continuation end without start');
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
if (!this._currentCommand.continuations) {
|
|
182
|
+
this._currentCommand.continuations = [];
|
|
183
|
+
}
|
|
184
|
+
this._currentCommand.continuations.push({
|
|
185
|
+
marker: this._currentCommand.currentContinuationMarker,
|
|
186
|
+
end: this._terminal.buffer.active.cursorX
|
|
187
|
+
});
|
|
188
|
+
this._currentCommand.currentContinuationMarker = undefined;
|
|
189
|
+
this._logService.debug('CommandDetectionCapability#handleContinuationEnd', this._currentCommand.continuations[this._currentCommand.continuations.length - 1]);
|
|
190
|
+
}
|
|
191
|
+
handleRightPromptStart() {
|
|
192
|
+
this._currentCommand.commandRightPromptStartX = this._terminal.buffer.active.cursorX;
|
|
193
|
+
this._logService.debug('CommandDetectionCapability#handleRightPromptStart', this._currentCommand.commandRightPromptStartX);
|
|
194
|
+
}
|
|
195
|
+
handleRightPromptEnd() {
|
|
196
|
+
this._currentCommand.commandRightPromptEndX = this._terminal.buffer.active.cursorX;
|
|
197
|
+
this._logService.debug('CommandDetectionCapability#handleRightPromptEnd', this._currentCommand.commandRightPromptEndX);
|
|
198
|
+
}
|
|
199
|
+
handleCommandStart(options) {
|
|
200
|
+
this._handleCommandStartOptions = options;
|
|
201
|
+
this._currentCommand.commandStartMarker = options?.marker || this._currentCommand.commandStartMarker;
|
|
202
|
+
if (this._currentCommand.commandStartMarker?.line === this._terminal.buffer.active.cursorY) {
|
|
203
|
+
this._currentCommand.commandStartX = this._terminal.buffer.active.cursorX;
|
|
204
|
+
this._logService.debug('CommandDetectionCapability#handleCommandStart', this._currentCommand.commandStartX, this._currentCommand.commandStartMarker?.line);
|
|
205
|
+
return;
|
|
206
|
+
}
|
|
207
|
+
this._ptyHeuristics.value.handleCommandStart(options);
|
|
208
|
+
}
|
|
209
|
+
handleGenericCommand(options) {
|
|
210
|
+
if (options?.markProperties?.disableCommandStorage) {
|
|
211
|
+
this.setIsCommandStorageDisabled();
|
|
212
|
+
}
|
|
213
|
+
this.handlePromptStart(options);
|
|
214
|
+
this.handleCommandStart(options);
|
|
215
|
+
this.handleCommandExecuted(options);
|
|
216
|
+
this.handleCommandFinished(undefined, options);
|
|
217
|
+
}
|
|
218
|
+
handleCommandExecuted(options) {
|
|
219
|
+
this._ptyHeuristics.value.handleCommandExecuted(options);
|
|
220
|
+
}
|
|
221
|
+
handleCommandFinished(exitCode, options) {
|
|
222
|
+
this._ptyHeuristics.value.preHandleCommandFinished?.();
|
|
223
|
+
this._logService.debug('CommandDetectionCapability#handleCommandFinished', this._terminal.buffer.active.cursorX, options?.marker?.line, this._currentCommand.command, this._currentCommand);
|
|
224
|
+
if (exitCode === undefined) {
|
|
225
|
+
const lastCommand = this.commands.length > 0 ? this.commands[this.commands.length - 1] : undefined;
|
|
226
|
+
if (this._currentCommand.command && this._currentCommand.command.length > 0 && lastCommand?.command === this._currentCommand.command) {
|
|
227
|
+
exitCode = lastCommand.exitCode;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
if (this._currentCommand.commandStartMarker === undefined || !this._terminal.buffer.active) {
|
|
231
|
+
return;
|
|
232
|
+
}
|
|
233
|
+
this._currentCommand.commandFinishedMarker = options?.marker || this._terminal.registerMarker(0);
|
|
234
|
+
this._ptyHeuristics.value.postHandleCommandFinished?.();
|
|
235
|
+
const newCommand = this._currentCommand.promoteToFullCommand(this._cwd, exitCode, this._handleCommandStartOptions?.ignoreCommandLine ?? false, options?.markProperties);
|
|
236
|
+
if (newCommand) {
|
|
237
|
+
this._commands.push(newCommand);
|
|
238
|
+
this._commitCommandFinished = ( new RunOnceScheduler(() => {
|
|
239
|
+
this._onBeforeCommandFinished.fire(newCommand);
|
|
240
|
+
if (!this._currentCommand.isInvalid) {
|
|
241
|
+
this._logService.debug('CommandDetectionCapability#onCommandFinished', newCommand);
|
|
242
|
+
this._onCommandFinished.fire(newCommand);
|
|
243
|
+
}
|
|
244
|
+
}, 50));
|
|
245
|
+
this._commitCommandFinished.schedule();
|
|
246
|
+
}
|
|
247
|
+
this._currentCommand = ( new PartialTerminalCommand(this._terminal));
|
|
248
|
+
this._handleCommandStartOptions = undefined;
|
|
249
|
+
}
|
|
250
|
+
setCommandLine(commandLine, isTrusted) {
|
|
251
|
+
this._logService.debug('CommandDetectionCapability#setCommandLine', commandLine, isTrusted);
|
|
252
|
+
this._currentCommand.command = commandLine;
|
|
253
|
+
this._currentCommand.isTrusted = isTrusted;
|
|
254
|
+
}
|
|
255
|
+
serialize() {
|
|
256
|
+
const commands = ( this.commands.map(e => e.serialize(this.__isCommandStorageDisabled)));
|
|
257
|
+
const partialCommand = this._currentCommand.serialize(this._cwd);
|
|
258
|
+
if (partialCommand) {
|
|
259
|
+
commands.push(partialCommand);
|
|
260
|
+
}
|
|
261
|
+
return {
|
|
262
|
+
isWindowsPty: this._ptyHeuristics.value instanceof WindowsPtyHeuristics,
|
|
263
|
+
commands
|
|
264
|
+
};
|
|
265
|
+
}
|
|
266
|
+
deserialize(serialized) {
|
|
267
|
+
if (serialized.isWindowsPty) {
|
|
268
|
+
this.setIsWindowsPty(serialized.isWindowsPty);
|
|
269
|
+
}
|
|
270
|
+
const buffer = this._terminal.buffer.normal;
|
|
271
|
+
for (const e of serialized.commands) {
|
|
272
|
+
if (!e.endLine) {
|
|
273
|
+
const marker = e.startLine !== undefined ? this._terminal.registerMarker(e.startLine - (buffer.baseY + buffer.cursorY)) : undefined;
|
|
274
|
+
if (!marker) {
|
|
275
|
+
continue;
|
|
276
|
+
}
|
|
277
|
+
this._currentCommand.commandStartMarker = e.startLine !== undefined ? this._terminal.registerMarker(e.startLine - (buffer.baseY + buffer.cursorY)) : undefined;
|
|
278
|
+
this._currentCommand.commandStartX = e.startX;
|
|
279
|
+
this._currentCommand.promptStartMarker = e.promptStartLine !== undefined ? this._terminal.registerMarker(e.promptStartLine - (buffer.baseY + buffer.cursorY)) : undefined;
|
|
280
|
+
this._cwd = e.cwd;
|
|
281
|
+
this._onCommandStarted.fire({ marker });
|
|
282
|
+
continue;
|
|
283
|
+
}
|
|
284
|
+
const newCommand = TerminalCommand.deserialize(this._terminal, e, this.__isCommandStorageDisabled);
|
|
285
|
+
if (!newCommand) {
|
|
286
|
+
continue;
|
|
287
|
+
}
|
|
288
|
+
this._commands.push(newCommand);
|
|
289
|
+
this._logService.debug('CommandDetectionCapability#onCommandFinished', newCommand);
|
|
290
|
+
this._onCommandFinished.fire(newCommand);
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
CommandDetectionCapability.__decorator = ( __decorate([
|
|
295
|
+
debounce(500)
|
|
296
|
+
], CommandDetectionCapability.prototype, "_handleCursorMove", null));
|
|
297
|
+
class UnixPtyHeuristics extends Disposable {
|
|
298
|
+
constructor(_terminal, _capability, _hooks, _logService) {
|
|
299
|
+
super();
|
|
300
|
+
this._terminal = _terminal;
|
|
301
|
+
this._capability = _capability;
|
|
302
|
+
this._hooks = _hooks;
|
|
303
|
+
this._logService = _logService;
|
|
304
|
+
this._register(_terminal.parser.registerCsiHandler({ final: 'J' }, params => {
|
|
305
|
+
if (params.length >= 1 && (params[0] === 2 || params[0] === 3)) {
|
|
306
|
+
_hooks.clearCommandsInViewport();
|
|
307
|
+
}
|
|
308
|
+
return false;
|
|
309
|
+
}));
|
|
310
|
+
}
|
|
311
|
+
async handleCommandStart(options) {
|
|
312
|
+
this._hooks.commitCommandFinished();
|
|
313
|
+
const currentCommand = this._capability.currentCommand;
|
|
314
|
+
currentCommand.commandStartX = this._terminal.buffer.active.cursorX;
|
|
315
|
+
currentCommand.commandStartMarker = options?.marker || this._terminal.registerMarker(0);
|
|
316
|
+
currentCommand.commandExecutedMarker?.dispose();
|
|
317
|
+
currentCommand.commandExecutedMarker = undefined;
|
|
318
|
+
currentCommand.commandExecutedX = undefined;
|
|
319
|
+
for (const m of this._hooks.commandMarkers) {
|
|
320
|
+
m.dispose();
|
|
321
|
+
}
|
|
322
|
+
this._hooks.commandMarkers.length = 0;
|
|
323
|
+
this._hooks.onCommandStartedEmitter.fire({ marker: options?.marker || currentCommand.commandStartMarker, markProperties: options?.markProperties });
|
|
324
|
+
this._logService.debug('CommandDetectionCapability#handleCommandStart', currentCommand.commandStartX, currentCommand.commandStartMarker?.line);
|
|
325
|
+
}
|
|
326
|
+
handleCommandExecuted(options) {
|
|
327
|
+
const currentCommand = this._capability.currentCommand;
|
|
328
|
+
currentCommand.commandExecutedMarker = options?.marker || this._terminal.registerMarker(0);
|
|
329
|
+
currentCommand.commandExecutedX = this._terminal.buffer.active.cursorX;
|
|
330
|
+
this._logService.debug('CommandDetectionCapability#handleCommandExecuted', currentCommand.commandExecutedX, currentCommand.commandExecutedMarker?.line);
|
|
331
|
+
if (!currentCommand.commandStartMarker || !currentCommand.commandExecutedMarker || currentCommand.commandStartX === undefined) {
|
|
332
|
+
return;
|
|
333
|
+
}
|
|
334
|
+
currentCommand.command = this._hooks.isCommandStorageDisabled ? '' : this._terminal.buffer.active.getLine(currentCommand.commandStartMarker.line)?.translateToString(true, currentCommand.commandStartX, currentCommand.commandRightPromptStartX).trim();
|
|
335
|
+
let y = currentCommand.commandStartMarker.line + 1;
|
|
336
|
+
const commandExecutedLine = currentCommand.commandExecutedMarker.line;
|
|
337
|
+
for (; y < commandExecutedLine; y++) {
|
|
338
|
+
const line = this._terminal.buffer.active.getLine(y);
|
|
339
|
+
if (line) {
|
|
340
|
+
const continuation = currentCommand.continuations?.find(e => e.marker.line === y);
|
|
341
|
+
if (continuation) {
|
|
342
|
+
currentCommand.command += '\n';
|
|
343
|
+
}
|
|
344
|
+
const startColumn = continuation?.end ?? 0;
|
|
345
|
+
currentCommand.command += line.translateToString(true, startColumn);
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
if (y === commandExecutedLine) {
|
|
349
|
+
currentCommand.command += this._terminal.buffer.active.getLine(commandExecutedLine)?.translateToString(true, undefined, currentCommand.commandExecutedX) || '';
|
|
350
|
+
}
|
|
351
|
+
this._hooks.onCommandExecutedEmitter.fire();
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
let WindowsPtyHeuristics = class WindowsPtyHeuristics extends Disposable {
|
|
355
|
+
constructor(_terminal, _capability, _hooks, _logService) {
|
|
356
|
+
super();
|
|
357
|
+
this._terminal = _terminal;
|
|
358
|
+
this._capability = _capability;
|
|
359
|
+
this._hooks = _hooks;
|
|
360
|
+
this._logService = _logService;
|
|
361
|
+
this._onCursorMoveListener = this._register(( new MutableDisposable()));
|
|
362
|
+
this._recentlyPerformedCsiJ = false;
|
|
363
|
+
this._tryAdjustCommandStartMarkerScannedLineCount = 0;
|
|
364
|
+
this._tryAdjustCommandStartMarkerPollCount = 0;
|
|
365
|
+
this._register(_terminal.parser.registerCsiHandler({ final: 'J' }, params => {
|
|
366
|
+
if (params.length >= 1 && (params[0] === 2 || params[0] === 3)) {
|
|
367
|
+
this._recentlyPerformedCsiJ = true;
|
|
368
|
+
this._hooks.clearCommandsInViewport();
|
|
369
|
+
}
|
|
370
|
+
return false;
|
|
371
|
+
}));
|
|
372
|
+
this._register(this._capability.onBeforeCommandFinished(command => {
|
|
373
|
+
if (this._recentlyPerformedCsiJ) {
|
|
374
|
+
this._recentlyPerformedCsiJ = false;
|
|
375
|
+
return;
|
|
376
|
+
}
|
|
377
|
+
if (command.command.trim().toLowerCase() === 'clear' || command.command.trim().toLowerCase() === 'cls') {
|
|
378
|
+
this._tryAdjustCommandStartMarkerScheduler?.cancel();
|
|
379
|
+
this._tryAdjustCommandStartMarkerScheduler = undefined;
|
|
380
|
+
this._hooks.clearCommandsInViewport();
|
|
381
|
+
this._capability.currentCommand.isInvalid = true;
|
|
382
|
+
this._hooks.onCurrentCommandInvalidatedEmitter.fire({ reason: "windows" });
|
|
383
|
+
}
|
|
384
|
+
}));
|
|
385
|
+
}
|
|
386
|
+
preHandleResize(e) {
|
|
387
|
+
const baseY = this._terminal.buffer.active.baseY;
|
|
388
|
+
const rowsDifference = e.rows - this._hooks.dimensions.rows;
|
|
389
|
+
if (rowsDifference > 0) {
|
|
390
|
+
this._waitForCursorMove().then(() => {
|
|
391
|
+
const potentialShiftedLineCount = Math.min(rowsDifference, baseY);
|
|
392
|
+
for (let i = this._capability.commands.length - 1; i >= 0; i--) {
|
|
393
|
+
const command = this._capability.commands[i];
|
|
394
|
+
if (!command.marker || command.marker.line < baseY || command.commandStartLineContent === undefined) {
|
|
395
|
+
break;
|
|
396
|
+
}
|
|
397
|
+
const line = this._terminal.buffer.active.getLine(command.marker.line);
|
|
398
|
+
if (!line || line.translateToString(true) === command.commandStartLineContent) {
|
|
399
|
+
continue;
|
|
400
|
+
}
|
|
401
|
+
const shiftedY = command.marker.line - potentialShiftedLineCount;
|
|
402
|
+
const shiftedLine = this._terminal.buffer.active.getLine(shiftedY);
|
|
403
|
+
if (shiftedLine?.translateToString(true) !== command.commandStartLineContent) {
|
|
404
|
+
continue;
|
|
405
|
+
}
|
|
406
|
+
this._terminal._core._bufferService.buffer.lines.onDeleteEmitter.fire({
|
|
407
|
+
index: this._terminal.buffer.active.baseY,
|
|
408
|
+
amount: potentialShiftedLineCount
|
|
409
|
+
});
|
|
410
|
+
}
|
|
411
|
+
});
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
async handleCommandStart() {
|
|
415
|
+
this._capability.currentCommand.commandStartX = this._terminal.buffer.active.cursorX;
|
|
416
|
+
this._hooks.commandMarkers.length = 0;
|
|
417
|
+
const initialCommandStartMarker = this._capability.currentCommand.commandStartMarker = (this._capability.currentCommand.promptStartMarker
|
|
418
|
+
? cloneMarker(this._terminal, this._capability.currentCommand.promptStartMarker)
|
|
419
|
+
: this._terminal.registerMarker(0));
|
|
420
|
+
this._capability.currentCommand.commandStartX = 0;
|
|
421
|
+
this._tryAdjustCommandStartMarkerScannedLineCount = 0;
|
|
422
|
+
this._tryAdjustCommandStartMarkerPollCount = 0;
|
|
423
|
+
this._tryAdjustCommandStartMarkerScheduler = ( new RunOnceScheduler(
|
|
424
|
+
() => this._tryAdjustCommandStartMarker(initialCommandStartMarker),
|
|
425
|
+
20
|
|
426
|
+
));
|
|
427
|
+
this._tryAdjustCommandStartMarkerScheduler.schedule();
|
|
428
|
+
}
|
|
429
|
+
_tryAdjustCommandStartMarker(start) {
|
|
430
|
+
if (this._store.isDisposed) {
|
|
431
|
+
return;
|
|
432
|
+
}
|
|
433
|
+
const buffer = this._terminal.buffer.active;
|
|
434
|
+
let scannedLineCount = this._tryAdjustCommandStartMarkerScannedLineCount;
|
|
435
|
+
while (scannedLineCount < 5 && start.line + scannedLineCount < buffer.baseY + this._terminal.rows) {
|
|
436
|
+
if (this._cursorOnNextLine()) {
|
|
437
|
+
const prompt = this._getWindowsPrompt(start.line + scannedLineCount);
|
|
438
|
+
if (prompt) {
|
|
439
|
+
const adjustedPrompt = typeof prompt === 'string' ? prompt : prompt.prompt;
|
|
440
|
+
this._capability.currentCommand.commandStartMarker = this._terminal.registerMarker(0);
|
|
441
|
+
if (typeof prompt === 'object' && prompt.likelySingleLine) {
|
|
442
|
+
this._logService.debug('CommandDetectionCapability#_tryAdjustCommandStartMarker adjusted promptStart', `${this._capability.currentCommand.promptStartMarker?.line} -> ${this._capability.currentCommand.commandStartMarker.line}`);
|
|
443
|
+
this._capability.currentCommand.promptStartMarker?.dispose();
|
|
444
|
+
this._capability.currentCommand.promptStartMarker = cloneMarker(this._terminal, this._capability.currentCommand.commandStartMarker);
|
|
445
|
+
const lastCommand = this._capability.commands.at(-1);
|
|
446
|
+
if (lastCommand && this._capability.currentCommand.commandStartMarker.line !== lastCommand.endMarker?.line) {
|
|
447
|
+
lastCommand.endMarker?.dispose();
|
|
448
|
+
lastCommand.endMarker = cloneMarker(this._terminal, this._capability.currentCommand.commandStartMarker);
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
this._capability.currentCommand.commandStartX = adjustedPrompt.length;
|
|
452
|
+
this._logService.debug('CommandDetectionCapability#_tryAdjustCommandStartMarker adjusted commandStart', `${start.line} -> ${this._capability.currentCommand.commandStartMarker.line}:${this._capability.currentCommand.commandStartX}`);
|
|
453
|
+
this._flushPendingHandleCommandStartTask();
|
|
454
|
+
return;
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
scannedLineCount++;
|
|
458
|
+
}
|
|
459
|
+
if (scannedLineCount < 5 ) {
|
|
460
|
+
this._tryAdjustCommandStartMarkerScannedLineCount = scannedLineCount;
|
|
461
|
+
if (this._tryAdjustCommandStartMarkerPollCount < 50 ) {
|
|
462
|
+
this._tryAdjustCommandStartMarkerScheduler?.schedule();
|
|
463
|
+
}
|
|
464
|
+
else {
|
|
465
|
+
this._flushPendingHandleCommandStartTask();
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
else {
|
|
469
|
+
this._flushPendingHandleCommandStartTask();
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
_flushPendingHandleCommandStartTask() {
|
|
473
|
+
if (this._tryAdjustCommandStartMarkerScheduler) {
|
|
474
|
+
this._tryAdjustCommandStartMarkerPollCount = 50 ;
|
|
475
|
+
this._tryAdjustCommandStartMarkerScheduler.flush();
|
|
476
|
+
this._tryAdjustCommandStartMarkerScheduler = undefined;
|
|
477
|
+
}
|
|
478
|
+
this._hooks.commitCommandFinished();
|
|
479
|
+
if (!this._capability.currentCommand.commandExecutedMarker) {
|
|
480
|
+
this._onCursorMoveListener.value = this._terminal.onCursorMove(() => {
|
|
481
|
+
if (this._hooks.commandMarkers.length === 0 || this._hooks.commandMarkers[this._hooks.commandMarkers.length - 1].line !== this._terminal.buffer.active.cursorY) {
|
|
482
|
+
const marker = this._terminal.registerMarker(0);
|
|
483
|
+
if (marker) {
|
|
484
|
+
this._hooks.commandMarkers.push(marker);
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
});
|
|
488
|
+
}
|
|
489
|
+
if (this._capability.currentCommand.commandStartMarker) {
|
|
490
|
+
const line = this._terminal.buffer.active.getLine(this._capability.currentCommand.commandStartMarker.line);
|
|
491
|
+
if (line) {
|
|
492
|
+
this._capability.currentCommand.commandStartLineContent = line.translateToString(true);
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
this._hooks.onCommandStartedEmitter.fire({ marker: this._capability.currentCommand.commandStartMarker });
|
|
496
|
+
this._logService.debug('CommandDetectionCapability#_handleCommandStartWindows', this._capability.currentCommand.commandStartX, this._capability.currentCommand.commandStartMarker?.line);
|
|
497
|
+
}
|
|
498
|
+
handleCommandExecuted(options) {
|
|
499
|
+
if (this._tryAdjustCommandStartMarkerScheduler) {
|
|
500
|
+
this._flushPendingHandleCommandStartTask();
|
|
501
|
+
}
|
|
502
|
+
this._onCursorMoveListener.clear();
|
|
503
|
+
this._evaluateCommandMarkers();
|
|
504
|
+
this._capability.currentCommand.commandExecutedX = this._terminal.buffer.active.cursorX;
|
|
505
|
+
this._hooks.onCommandExecutedEmitter.fire();
|
|
506
|
+
this._logService.debug('CommandDetectionCapability#handleCommandExecuted', this._capability.currentCommand.commandExecutedX, this._capability.currentCommand.commandExecutedMarker?.line);
|
|
507
|
+
}
|
|
508
|
+
preHandleCommandFinished() {
|
|
509
|
+
if (this._capability.currentCommand.commandExecutedMarker) {
|
|
510
|
+
return;
|
|
511
|
+
}
|
|
512
|
+
if (this._hooks.commandMarkers.length === 0) {
|
|
513
|
+
if (!this._capability.currentCommand.commandStartMarker) {
|
|
514
|
+
this._capability.currentCommand.commandStartMarker = this._terminal.registerMarker(0);
|
|
515
|
+
}
|
|
516
|
+
if (this._capability.currentCommand.commandStartMarker) {
|
|
517
|
+
this._hooks.commandMarkers.push(this._capability.currentCommand.commandStartMarker);
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
this._evaluateCommandMarkers();
|
|
521
|
+
}
|
|
522
|
+
postHandleCommandFinished() {
|
|
523
|
+
const currentCommand = this._capability.currentCommand;
|
|
524
|
+
const commandText = currentCommand.command;
|
|
525
|
+
const commandLine = currentCommand.commandStartMarker?.line;
|
|
526
|
+
const executedLine = currentCommand.commandExecutedMarker?.line;
|
|
527
|
+
if (!commandText || commandText.length === 0 ||
|
|
528
|
+
commandLine === undefined || commandLine === -1 ||
|
|
529
|
+
executedLine === undefined || executedLine === -1) {
|
|
530
|
+
return;
|
|
531
|
+
}
|
|
532
|
+
let current = 0;
|
|
533
|
+
let found = false;
|
|
534
|
+
for (let i = commandLine; i <= executedLine; i++) {
|
|
535
|
+
const line = this._terminal.buffer.active.getLine(i);
|
|
536
|
+
if (!line) {
|
|
537
|
+
break;
|
|
538
|
+
}
|
|
539
|
+
const text = line.translateToString(true);
|
|
540
|
+
for (let j = 0; j < text.length; j++) {
|
|
541
|
+
while (commandText.length < current && commandText[current] === ' ') {
|
|
542
|
+
current++;
|
|
543
|
+
}
|
|
544
|
+
if (text[j] === commandText[current]) {
|
|
545
|
+
current++;
|
|
546
|
+
}
|
|
547
|
+
if (current === commandText.length) {
|
|
548
|
+
const wrapsToNextLine = j >= this._terminal.cols - 1;
|
|
549
|
+
currentCommand.commandExecutedMarker = this._terminal.registerMarker(i - (this._terminal.buffer.active.baseY + this._terminal.buffer.active.cursorY) + (wrapsToNextLine ? 1 : 0));
|
|
550
|
+
currentCommand.commandExecutedX = wrapsToNextLine ? 0 : j + 1;
|
|
551
|
+
found = true;
|
|
552
|
+
break;
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
if (found) {
|
|
556
|
+
break;
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
_evaluateCommandMarkers() {
|
|
561
|
+
if (this._hooks.commandMarkers.length === 0) {
|
|
562
|
+
return;
|
|
563
|
+
}
|
|
564
|
+
this._hooks.commandMarkers = this._hooks.commandMarkers.sort((a, b) => a.line - b.line);
|
|
565
|
+
this._capability.currentCommand.commandStartMarker = this._hooks.commandMarkers[0];
|
|
566
|
+
if (this._capability.currentCommand.commandStartMarker) {
|
|
567
|
+
const line = this._terminal.buffer.active.getLine(this._capability.currentCommand.commandStartMarker.line);
|
|
568
|
+
if (line) {
|
|
569
|
+
this._capability.currentCommand.commandStartLineContent = line.translateToString(true);
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
this._capability.currentCommand.commandExecutedMarker = this._hooks.commandMarkers[this._hooks.commandMarkers.length - 1];
|
|
573
|
+
this._hooks.onCommandExecutedEmitter.fire();
|
|
574
|
+
}
|
|
575
|
+
_cursorOnNextLine() {
|
|
576
|
+
const lastCommand = this._capability.commands.at(-1);
|
|
577
|
+
if (!lastCommand) {
|
|
578
|
+
return true;
|
|
579
|
+
}
|
|
580
|
+
const cursorYAbsolute = this._terminal.buffer.active.baseY + this._terminal.buffer.active.cursorY;
|
|
581
|
+
const lastCommandYAbsolute = (lastCommand.endMarker ? lastCommand.endMarker.line : lastCommand.marker?.line) ?? -1;
|
|
582
|
+
return cursorYAbsolute > lastCommandYAbsolute;
|
|
583
|
+
}
|
|
584
|
+
_waitForCursorMove() {
|
|
585
|
+
const cursorX = this._terminal.buffer.active.cursorX;
|
|
586
|
+
const cursorY = this._terminal.buffer.active.cursorY;
|
|
587
|
+
let totalDelay = 0;
|
|
588
|
+
return ( new Promise((resolve, reject) => {
|
|
589
|
+
const interval = setInterval(() => {
|
|
590
|
+
if (cursorX !== this._terminal.buffer.active.cursorX || cursorY !== this._terminal.buffer.active.cursorY) {
|
|
591
|
+
resolve();
|
|
592
|
+
clearInterval(interval);
|
|
593
|
+
return;
|
|
594
|
+
}
|
|
595
|
+
totalDelay += 10;
|
|
596
|
+
if (totalDelay > 1000) {
|
|
597
|
+
clearInterval(interval);
|
|
598
|
+
resolve();
|
|
599
|
+
}
|
|
600
|
+
}, 10);
|
|
601
|
+
}));
|
|
602
|
+
}
|
|
603
|
+
_getWindowsPrompt(y = this._terminal.buffer.active.baseY + this._terminal.buffer.active.cursorY) {
|
|
604
|
+
const line = this._terminal.buffer.active.getLine(y);
|
|
605
|
+
if (!line) {
|
|
606
|
+
return;
|
|
607
|
+
}
|
|
608
|
+
const lineText = line.translateToString(true);
|
|
609
|
+
if (!lineText) {
|
|
610
|
+
return;
|
|
611
|
+
}
|
|
612
|
+
const pwshPrompt = lineText.match(/(?<prompt>(\(.+\)\s)?(?:PS.+>\s?))/)?.groups?.prompt;
|
|
613
|
+
if (pwshPrompt) {
|
|
614
|
+
const adjustedPrompt = this._adjustPrompt(pwshPrompt, lineText, '>');
|
|
615
|
+
if (adjustedPrompt) {
|
|
616
|
+
return {
|
|
617
|
+
prompt: adjustedPrompt,
|
|
618
|
+
likelySingleLine: true
|
|
619
|
+
};
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
const customPrompt = lineText.match(/.*\u276f(?=[^\u276f]*$)/g)?.[0];
|
|
623
|
+
if (customPrompt) {
|
|
624
|
+
const adjustedPrompt = this._adjustPrompt(customPrompt, lineText, '\u276f');
|
|
625
|
+
if (adjustedPrompt) {
|
|
626
|
+
return adjustedPrompt;
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
const cmdMatch = lineText.match(/^(?<prompt>(\(.+\)\s)?(?:[A-Z]:\\.*>))/);
|
|
630
|
+
return cmdMatch?.groups?.prompt ? {
|
|
631
|
+
prompt: cmdMatch.groups.prompt,
|
|
632
|
+
likelySingleLine: true
|
|
633
|
+
} : undefined;
|
|
634
|
+
}
|
|
635
|
+
_adjustPrompt(prompt, lineText, char) {
|
|
636
|
+
if (!prompt) {
|
|
637
|
+
return;
|
|
638
|
+
}
|
|
639
|
+
if (lineText === prompt && prompt.endsWith(char)) {
|
|
640
|
+
prompt += ' ';
|
|
641
|
+
}
|
|
642
|
+
return prompt;
|
|
643
|
+
}
|
|
644
|
+
};
|
|
645
|
+
WindowsPtyHeuristics = ( __decorate([
|
|
646
|
+
( __param(3, ILogService))
|
|
647
|
+
], WindowsPtyHeuristics));
|
|
648
|
+
function cloneMarker(xterm, marker, offset = 0) {
|
|
649
|
+
return xterm.registerMarker(marker.line - (xterm.buffer.active.baseY + xterm.buffer.active.cursorY) + offset);
|
|
650
|
+
}
|
|
651
|
+
export { CommandDetectionCapability };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Emitter } from 'monaco-editor/esm/vs/base/common/event.js';
|
|
2
|
+
import { Disposable } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
3
|
+
class CwdDetectionCapability extends Disposable {
|
|
4
|
+
constructor() {
|
|
5
|
+
super(...arguments);
|
|
6
|
+
this.type = 0 ;
|
|
7
|
+
this._cwd = '';
|
|
8
|
+
this._cwds = ( new Map());
|
|
9
|
+
this._onDidChangeCwd = this._register(( new Emitter()));
|
|
10
|
+
this.onDidChangeCwd = this._onDidChangeCwd.event;
|
|
11
|
+
}
|
|
12
|
+
get cwds() {
|
|
13
|
+
return Array.from(( this._cwds.keys()));
|
|
14
|
+
}
|
|
15
|
+
getCwd() {
|
|
16
|
+
return this._cwd;
|
|
17
|
+
}
|
|
18
|
+
updateCwd(cwd) {
|
|
19
|
+
const didChange = this._cwd !== cwd;
|
|
20
|
+
this._cwd = cwd;
|
|
21
|
+
const count = this._cwds.get(this._cwd) || 0;
|
|
22
|
+
this._cwds.delete(this._cwd);
|
|
23
|
+
this._cwds.set(this._cwd, count + 1);
|
|
24
|
+
if (didChange) {
|
|
25
|
+
this._onDidChangeCwd.fire(cwd);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
export { CwdDetectionCapability };
|