@codingame/monaco-vscode-api 1.81.8-next.2 → 1.82.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 +14 -0
- package/api.js +12 -8
- package/extensions.d.ts +1 -0
- package/extensions.js +3 -0
- package/missing-services.js +69 -20
- package/monaco-editor-treemending.patch +1407 -1026
- package/monaco-treemending.js +2 -2
- package/monaco.d.ts +1 -1
- package/monaco.js +3 -0
- package/package.json +3 -3
- package/service-override/extensions.d.ts +1 -1
- package/service-override/extensions.js +5 -1
- package/service-override/keybindings.d.ts +4 -1
- package/service-override/keybindings.js +35 -6
- package/service-override/quickaccess.d.ts +2 -1
- package/service-override/quickaccess.js +5 -2
- package/service-override/search.js +2 -2
- package/service-override/snippets.d.ts +1 -1
- package/service-override/storage.d.ts +1 -1
- package/service-override/theme.d.ts +1 -1
- package/service-override/tools/editor.d.ts +1 -1
- package/service-override/tools/editor.js +4 -3
- package/service-override/views.d.ts +1 -1
- package/service-override/views.js +4 -2
- package/vscode/src/vs/base/browser/contextmenu.d.ts +1 -1
- package/vscode/src/vs/base/browser/dom.d.ts +1 -1
- package/vscode/src/vs/base/browser/keyboardEvent.d.ts +1 -1
- package/vscode/src/vs/base/browser/mouseEvent.d.ts +1 -1
- package/vscode/src/vs/base/browser/ui/actionbar/actionViewItems.d.ts +1 -1
- package/vscode/src/vs/base/browser/ui/actionbar/actionbar.d.ts +7 -1
- package/vscode/src/vs/base/browser/ui/breadcrumbs/breadcrumbsWidget.d.ts +1 -1
- package/vscode/src/vs/base/browser/ui/contextview/contextview.d.ts +1 -1
- package/vscode/src/vs/base/browser/ui/dropdown/dropdownActionViewItem.d.ts +1 -1
- package/vscode/src/vs/base/browser/ui/grid/grid.d.ts +1 -1
- package/vscode/src/vs/base/browser/ui/grid/gridview.d.ts +1 -1
- package/vscode/src/vs/base/browser/ui/grid/gridview.js +1 -0
- package/vscode/src/vs/base/browser/ui/iconLabel/iconHoverDelegate.d.ts +1 -1
- package/vscode/src/vs/base/browser/ui/iconLabel/iconLabelHover.d.ts +1 -1
- package/vscode/src/vs/base/browser/ui/menu/menubar.js +1 -2
- package/vscode/src/vs/base/browser/ui/sash/sash.d.ts +1 -1
- package/vscode/src/vs/base/browser/ui/splitview/paneview.d.ts +1 -1
- package/vscode/src/vs/base/browser/ui/splitview/splitview.d.ts +1 -1
- package/vscode/src/vs/base/browser/ui/toggle/toggle.d.ts +1 -1
- package/vscode/src/vs/base/browser/ui/toolbar/toolbar.d.ts +5 -1
- package/vscode/src/vs/base/common/actions.d.ts +1 -1
- package/vscode/src/vs/base/common/async.d.ts +1 -1
- package/vscode/src/vs/base/common/buffer.d.ts +1 -1
- package/vscode/src/vs/base/common/codicons.d.ts +5 -0
- package/vscode/src/vs/base/common/collections.d.ts +1 -1
- package/vscode/src/vs/base/common/dataTransfer.d.ts +1 -1
- package/vscode/src/vs/base/common/errors.d.ts +1 -1
- package/vscode/src/vs/base/common/event.d.ts +10 -2
- package/vscode/src/vs/base/common/filters.d.ts +1 -1
- package/vscode/src/vs/base/common/glob.d.ts +1 -1
- package/vscode/src/vs/base/common/htmlContent.d.ts +1 -1
- package/vscode/src/vs/base/common/jsonSchema.d.ts +1 -1
- package/vscode/src/vs/base/common/keybindings.d.ts +1 -1
- package/vscode/src/vs/base/common/lifecycle.d.ts +1 -1
- package/vscode/src/vs/base/common/{observableImpl → observableInternal}/base.d.ts +1 -1
- package/vscode/src/vs/base/common/path.d.ts +1 -1
- package/vscode/src/vs/base/common/performance.d.ts +1 -1
- package/vscode/src/vs/base/common/platform.d.ts +1 -1
- package/vscode/src/vs/base/common/prefixTree.js +76 -13
- package/vscode/src/vs/base/common/processes.d.ts +1 -1
- package/vscode/src/vs/base/common/product.d.ts +10 -6
- package/vscode/src/vs/base/common/resources.d.ts +1 -1
- package/vscode/src/vs/base/common/stream.d.ts +1 -1
- package/vscode/src/vs/base/common/ternarySearchTree.d.ts +1 -1
- package/vscode/src/vs/base/common/themables.d.ts +1 -1
- package/vscode/src/vs/base/common/types.d.ts +1 -1
- package/vscode/src/vs/base/common/uri.d.ts +1 -1
- package/vscode/src/vs/base/common/uriIpc.d.ts +1 -1
- package/vscode/src/vs/base/parts/ipc/common/ipc.d.ts +1 -1
- package/vscode/src/vs/base/parts/ipc/common/ipc.net.d.ts +1 -1
- package/vscode/src/vs/base/parts/storage/common/storage.d.ts +1 -1
- package/vscode/src/vs/editor/browser/editorBrowser.d.ts +2 -2
- package/vscode/src/vs/editor/browser/services/bulkEditService.d.ts +1 -1
- package/vscode/src/vs/editor/browser/services/codeEditorService.d.ts +1 -1
- package/vscode/src/vs/editor/browser/widget/diffEditorWidget2/diffEditorWidget2.contribution.js +122 -26
- package/vscode/src/vs/editor/common/config/editorOptions.d.ts +25 -5
- package/vscode/src/vs/editor/common/core/dimension.d.ts +1 -1
- package/vscode/src/vs/editor/common/core/editOperation.d.ts +1 -1
- package/vscode/src/vs/editor/common/core/lineRange.d.ts +8 -1
- package/vscode/src/vs/editor/common/core/offsetRange.d.ts +47 -0
- package/vscode/src/vs/editor/common/core/position.d.ts +1 -1
- package/vscode/src/vs/editor/common/core/range.d.ts +1 -1
- package/vscode/src/vs/editor/common/core/selection.d.ts +1 -1
- package/vscode/src/vs/editor/common/diff/documentDiffProvider.d.ts +3 -2
- package/vscode/src/vs/editor/common/diff/{smartLinesDiffComputer.d.ts → legacyLinesDiffComputer.d.ts} +1 -1
- package/vscode/src/vs/editor/common/diff/linesDiffComputer.d.ts +1 -0
- package/vscode/src/vs/editor/common/editorCommon.d.ts +1 -1
- package/vscode/src/vs/editor/common/encodedTokenAttributes.d.ts +1 -1
- package/vscode/src/vs/editor/common/languageFeatureRegistry.d.ts +1 -1
- package/vscode/src/vs/editor/common/languageSelector.d.ts +1 -1
- package/vscode/src/vs/editor/common/languages/language.d.ts +1 -1
- package/vscode/src/vs/editor/common/languages/languageConfiguration.d.ts +1 -1
- package/vscode/src/vs/editor/common/languages/languageConfigurationRegistry.d.ts +1 -1
- package/vscode/src/vs/editor/common/languages/supports/electricCharacter.d.ts +1 -1
- package/vscode/src/vs/editor/common/languages/supports/languageBracketsConfiguration.d.ts +1 -1
- package/vscode/src/vs/editor/common/languages.d.ts +37 -7
- package/vscode/src/vs/editor/common/model.d.ts +1 -1
- package/vscode/src/vs/editor/common/services/editorWorker.d.ts +2 -2
- package/vscode/src/vs/editor/common/services/languageFeatureDebounce.d.ts +1 -1
- package/vscode/src/vs/editor/common/services/languageFeatures.d.ts +2 -1
- package/vscode/src/vs/editor/common/services/languageFeaturesService.js +1 -0
- package/vscode/src/vs/editor/common/services/resolverService.d.ts +1 -1
- package/vscode/src/vs/editor/common/services/unicodeTextModelHighlighter.d.ts +1 -1
- package/vscode/src/vs/editor/common/textModelEvents.d.ts +1 -1
- package/vscode/src/vs/editor/common/tokens/lineTokens.d.ts +1 -1
- package/vscode/src/vs/editor/contrib/folding/browser/folding.d.ts +1 -1
- package/vscode/src/vs/editor/contrib/folding/browser/foldingModel.d.ts +1 -1
- package/vscode/src/vs/editor/contrib/folding/browser/foldingRanges.d.ts +1 -1
- package/vscode/src/vs/editor/standalone/browser/standaloneCodeEditor.d.ts +1 -1
- package/vscode/src/vs/editor/standalone/browser/standaloneServices.d.ts +1 -1
- package/vscode/src/vs/platform/accessibility/common/accessibility.d.ts +1 -1
- package/vscode/src/vs/platform/action/common/action.d.ts +1 -1
- package/vscode/src/vs/platform/actions/browser/floatingMenu.js +73 -0
- package/vscode/src/vs/platform/actions/browser/toolbar.d.ts +1 -1
- package/vscode/src/vs/platform/actions/common/actions.d.ts +5 -2
- package/vscode/src/vs/platform/audioCues/browser/audioCueService.d.ts +10 -3
- package/vscode/src/vs/platform/commands/common/commands.d.ts +1 -1
- package/vscode/src/vs/platform/configuration/common/configuration.d.ts +1 -1
- package/vscode/src/vs/platform/configuration/common/configurationRegistry.d.ts +1 -1
- package/vscode/src/vs/platform/contextkey/common/contextkey.d.ts +1 -1
- package/vscode/src/vs/platform/contextview/browser/contextView.d.ts +1 -1
- package/vscode/src/vs/platform/credentials/common/credentials.d.ts +1 -1
- package/vscode/src/vs/platform/diagnostics/common/diagnostics.d.ts +1 -1
- package/vscode/src/vs/platform/dialogs/common/dialogs.d.ts +1 -1
- package/vscode/src/vs/platform/editor/common/editor.d.ts +1 -1
- package/vscode/src/vs/platform/environment/common/environment.d.ts +1 -1
- package/vscode/src/vs/platform/extensionManagement/common/extensionManagement.d.ts +1 -1
- package/vscode/src/vs/platform/extensionManagement/common/extensionNls.d.ts +1 -1
- package/vscode/src/vs/platform/extensionManagement/common/extensionStorage.js +13 -14
- package/vscode/src/vs/platform/extensions/common/extensions.d.ts +1 -1
- package/vscode/src/vs/platform/files/common/files.d.ts +1 -1
- package/vscode/src/vs/platform/instantiation/common/descriptors.d.ts +1 -1
- package/vscode/src/vs/platform/instantiation/common/instantiation.d.ts +1 -1
- package/vscode/src/vs/platform/jsonschemas/common/jsonContributionRegistry.d.ts +1 -1
- package/vscode/src/vs/platform/keybinding/common/keybinding.d.ts +1 -1
- package/vscode/src/vs/platform/keybinding/common/keybindingResolver.d.ts +1 -1
- package/vscode/src/vs/platform/keybinding/common/keybindingsRegistry.d.ts +1 -1
- package/vscode/src/vs/platform/layout/browser/layoutService.d.ts +1 -1
- package/vscode/src/vs/platform/log/common/log.d.ts +1 -1
- package/vscode/src/vs/platform/markers/common/markers.d.ts +1 -1
- package/vscode/src/vs/platform/notification/common/notification.d.ts +1 -1
- package/vscode/src/vs/platform/opener/common/opener.d.ts +1 -1
- package/vscode/src/vs/platform/policy/common/policy.d.ts +1 -1
- package/vscode/src/vs/platform/progress/common/progress.d.ts +1 -1
- package/vscode/src/vs/platform/quickinput/common/quickAccess.d.ts +1 -1
- package/vscode/src/vs/platform/quickinput/common/quickInput.d.ts +17 -13
- package/vscode/src/vs/platform/registry/common/platform.d.ts +1 -1
- package/vscode/src/vs/platform/remote/browser/browserSocketFactory.d.ts +1 -1
- package/vscode/src/vs/platform/remote/common/managedSocket.js +80 -1
- package/vscode/src/vs/platform/remote/common/remoteAgentConnection.d.ts +1 -1
- package/vscode/src/vs/platform/remote/common/remoteAgentEnvironment.d.ts +1 -1
- package/vscode/src/vs/platform/remote/common/remoteAuthorityResolver.d.ts +1 -1
- package/vscode/src/vs/platform/remote/common/remoteSocketFactoryService.d.ts +1 -1
- package/vscode/src/vs/platform/secrets/common/secrets.d.ts +1 -1
- package/vscode/src/vs/platform/storage/common/storage.d.ts +24 -5
- package/vscode/src/vs/platform/storage/common/storage.js +4 -2
- package/vscode/src/vs/platform/telemetry/common/gdprTypings.d.ts +1 -1
- package/vscode/src/vs/platform/telemetry/common/telemetry.d.ts +1 -1
- package/vscode/src/vs/platform/terminal/common/capabilities/bufferMarkCapability.js +4 -2
- package/vscode/src/vs/platform/terminal/common/capabilities/capabilities.d.ts +21 -3
- package/vscode/src/vs/platform/terminal/common/capabilities/commandDetectionCapability.d.ts +32 -0
- package/vscode/src/vs/platform/terminal/common/capabilities/commandDetectionCapability.js +14 -9
- package/vscode/src/vs/platform/terminal/common/capabilities/cwdDetectionCapability.js +4 -2
- package/vscode/src/vs/platform/terminal/common/capabilities/terminalCapabilityStore.js +18 -4
- package/vscode/src/vs/platform/terminal/common/environmentVariable.d.ts +1 -1
- package/vscode/src/vs/platform/terminal/common/terminal.d.ts +1 -1
- package/vscode/src/vs/platform/terminal/common/terminalProcess.d.ts +1 -1
- package/vscode/src/vs/platform/terminal/common/xterm/shellIntegrationAddon.js +6 -3
- package/vscode/src/vs/platform/theme/common/colorRegistry.d.ts +1 -1
- package/vscode/src/vs/platform/theme/common/iconRegistry.d.ts +1 -1
- package/vscode/src/vs/platform/theme/common/themeService.d.ts +1 -1
- package/vscode/src/vs/platform/tunnel/common/tunnel.d.ts +1 -1
- package/vscode/src/vs/platform/userDataProfile/common/userDataProfile.d.ts +1 -1
- package/vscode/src/vs/platform/webview/common/webviewPortMapping.js +5 -1
- package/vscode/src/vs/platform/window/common/window.d.ts +1 -1
- package/vscode/src/vs/platform/workspace/common/workspace.d.ts +1 -1
- package/vscode/src/vs/platform/workspace/common/workspaceTrust.d.ts +1 -1
- package/vscode/src/vs/platform/workspaces/common/workspaces.d.ts +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadAiEmbeddingVector.js +29 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadAiRelatedInformation.js +33 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadChat.js +13 -16
- package/vscode/src/vs/workbench/api/browser/mainThreadChatProvider.js +59 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadChatSlashCommands.js +46 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadChatVariables.js +29 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadCustomEditors.js +5 -4
- package/vscode/src/vs/workbench/api/browser/mainThreadEditor.js +1 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadEditors.js +4 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadInlineChat.js +2 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadLanguageFeatures.js +31 -14
- package/vscode/src/vs/workbench/api/browser/mainThreadManagedSockets.js +12 -67
- package/vscode/src/vs/workbench/api/browser/mainThreadStorage.js +7 -6
- package/vscode/src/vs/workbench/api/browser/mainThreadTask.js +1 -1
- package/vscode/src/vs/workbench/api/browser/mainThreadTerminalService.js +36 -11
- package/vscode/src/vs/workbench/api/browser/mainThreadTunnelService.js +21 -17
- package/vscode/src/vs/workbench/api/browser/mainThreadWebviews.js +4 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadWorkspace.js +2 -3
- package/vscode/src/vs/workbench/api/browser/statusBarExtensionPoint.js +10 -1
- package/vscode/src/vs/workbench/api/browser/viewsExtensionPoint.js +1 -1
- package/vscode/src/vs/workbench/api/common/extHost.api.impl.d.ts +1 -1
- package/vscode/src/vs/workbench/api/common/extHost.api.impl.js +55 -16
- package/vscode/src/vs/workbench/api/common/extHost.protocol.d.ts +32 -7
- package/vscode/src/vs/workbench/api/common/extHost.protocol.js +10 -2
- package/vscode/src/vs/workbench/api/common/extHostAiRelatedInformation.js +34 -0
- package/vscode/src/vs/workbench/api/common/extHostApiCommands.js +21 -2
- package/vscode/src/vs/workbench/api/common/extHostChat.js +12 -31
- package/vscode/src/vs/workbench/api/common/extHostChatProvider.js +70 -0
- package/vscode/src/vs/workbench/api/common/extHostChatSlashCommand.js +53 -0
- package/vscode/src/vs/workbench/api/common/extHostChatVariables.js +37 -0
- package/vscode/src/vs/workbench/api/common/extHostCommands.js +11 -0
- package/vscode/src/vs/workbench/api/common/extHostComments.js +1 -2
- package/vscode/src/vs/workbench/api/common/extHostDebugService.js +2 -3
- package/vscode/src/vs/workbench/api/common/extHostDecorations.js +6 -4
- package/vscode/src/vs/workbench/api/common/extHostDiagnostics.js +8 -6
- package/vscode/src/vs/workbench/api/common/extHostEmbeddingVector.js +34 -0
- package/vscode/src/vs/workbench/api/common/extHostExtensionActivator.d.ts +1 -1
- package/vscode/src/vs/workbench/api/common/extHostExtensionService.js +5 -4
- package/vscode/src/vs/workbench/api/common/extHostFileSystemConsumer.js +11 -10
- package/vscode/src/vs/workbench/api/common/extHostInlineChat.js +3 -2
- package/vscode/src/vs/workbench/api/common/extHostLanguageFeatures.js +45 -15
- package/vscode/src/vs/workbench/api/common/extHostRequireInterceptor.js +5 -3
- package/vscode/src/vs/workbench/api/common/extHostSCM.js +4 -2
- package/vscode/src/vs/workbench/api/common/extHostTelemetry.js +17 -1
- package/vscode/src/vs/workbench/api/common/extHostTerminalService.d.ts +12 -11
- package/vscode/src/vs/workbench/api/common/extHostTerminalService.js +66 -53
- package/vscode/src/vs/workbench/api/common/extHostTesting.js +32 -18
- package/vscode/src/vs/workbench/api/common/extHostTreeViews.js +3 -0
- package/vscode/src/vs/workbench/api/common/extHostTunnelService.d.ts +1 -1
- package/vscode/src/vs/workbench/api/common/extHostTunnelService.js +19 -5
- package/vscode/src/vs/workbench/api/common/extHostTypeConverters.js +128 -6
- package/vscode/src/vs/workbench/api/common/extHostTypes.js +28 -13
- package/vscode/src/vs/workbench/api/common/extHostWindow.js +4 -2
- package/vscode/src/vs/workbench/api/common/extHostWorkspace.d.ts +1 -1
- package/vscode/src/vs/workbench/api/common/extHostWorkspace.js +2 -3
- package/vscode/src/vs/workbench/api/common/extensionHostMain.js +2 -2
- package/vscode/src/vs/workbench/browser/actions/widgetNavigationCommands.js +5 -3
- package/vscode/src/vs/workbench/browser/codeeditor.js +34 -67
- package/vscode/src/vs/workbench/browser/dnd.js +3 -2
- package/vscode/src/vs/workbench/browser/part.d.ts +1 -1
- package/vscode/src/vs/workbench/browser/parts/activitybar/activitybarActions.js +37 -20
- package/vscode/src/vs/workbench/browser/parts/activitybar/activitybarPart.d.ts +1 -1
- package/vscode/src/vs/workbench/browser/parts/activitybar/activitybarPart.js +21 -22
- package/vscode/src/vs/workbench/browser/parts/auxiliarybar/auxiliaryBarPart.js +4 -2
- package/vscode/src/vs/workbench/browser/parts/compositeBarActions.d.ts +1 -1
- package/vscode/src/vs/workbench/browser/parts/compositeBarActions.js +10 -7
- package/vscode/src/vs/workbench/browser/parts/compositePart.d.ts +1 -1
- package/vscode/src/vs/workbench/browser/parts/compositePart.js +2 -2
- package/vscode/src/vs/workbench/browser/parts/dialogs/dialogHandler.js +4 -2
- package/vscode/src/vs/workbench/browser/parts/editor/accessibilityStatus.js +19 -24
- package/vscode/src/vs/workbench/browser/parts/editor/breadcrumbsControl.js +11 -9
- package/vscode/src/vs/workbench/browser/parts/editor/breadcrumbsModel.js +1 -2
- package/vscode/src/vs/workbench/browser/parts/editor/editor.contribution.js +17 -16
- package/vscode/src/vs/workbench/browser/parts/editor/editor.d.ts +1 -1
- package/vscode/src/vs/workbench/browser/parts/editor/editor.js +1 -0
- package/vscode/src/vs/workbench/browser/parts/editor/editorAutoSave.js +1 -2
- package/vscode/src/vs/workbench/browser/parts/editor/editorCommands.js +25 -16
- package/vscode/src/vs/workbench/browser/parts/editor/editorConfiguration.js +6 -4
- package/vscode/src/vs/workbench/browser/parts/editor/editorDropTarget.js +4 -2
- package/vscode/src/vs/workbench/browser/parts/editor/editorGroupView.js +12 -12
- package/vscode/src/vs/workbench/browser/parts/editor/editorGroupWatermark.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/editor/editorPart.js +10 -8
- package/vscode/src/vs/workbench/browser/parts/editor/editorPlaceholder.js +13 -9
- package/vscode/src/vs/workbench/browser/parts/editor/editorQuickAccess.js +10 -6
- package/vscode/src/vs/workbench/browser/parts/editor/editorStatus.js +14 -16
- package/vscode/src/vs/workbench/browser/parts/editor/editorsObserver.js +6 -4
- package/vscode/src/vs/workbench/browser/parts/editor/media/tabstitlecontrol.css.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/editor/noTabsTitleControl.js +6 -4
- package/vscode/src/vs/workbench/browser/parts/editor/sideBySideEditor.js +7 -5
- package/vscode/src/vs/workbench/browser/parts/editor/tabsTitleControl.js +42 -32
- package/vscode/src/vs/workbench/browser/parts/editor/textCodeEditor.js +2 -2
- package/vscode/src/vs/workbench/browser/parts/editor/textDiffEditor.js +13 -6
- package/vscode/src/vs/workbench/browser/parts/editor/textEditor.js +4 -2
- package/vscode/src/vs/workbench/browser/parts/editor/textResourceEditor.js +6 -4
- package/vscode/src/vs/workbench/browser/parts/editor/titleControl.js +6 -5
- package/vscode/src/vs/workbench/browser/parts/notifications/notificationsActions.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/notifications/notificationsCenter.js +5 -3
- package/vscode/src/vs/workbench/browser/parts/notifications/notificationsCommands.js +8 -3
- package/vscode/src/vs/workbench/browser/parts/notifications/notificationsToasts.js +9 -7
- package/vscode/src/vs/workbench/browser/parts/notifications/notificationsViewer.js +14 -11
- package/vscode/src/vs/workbench/browser/parts/paneCompositePart.d.ts +1 -1
- package/vscode/src/vs/workbench/browser/parts/panel/panelPart.d.ts +1 -1
- package/vscode/src/vs/workbench/browser/parts/panel/panelPart.js +14 -10
- package/vscode/src/vs/workbench/browser/parts/sidebar/sidebarPart.js +4 -2
- package/vscode/src/vs/workbench/browser/parts/statusbar/media/statusbarpart.css.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/statusbar/statusbarItem.js +12 -2
- package/vscode/src/vs/workbench/browser/parts/statusbar/statusbarModel.js +21 -23
- package/vscode/src/vs/workbench/browser/parts/statusbar/statusbarPart.js +2 -2
- package/vscode/src/vs/workbench/browser/parts/titlebar/menubarControl.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/views/treeView.js +10 -4
- package/vscode/src/vs/workbench/browser/parts/views/viewFilter.d.ts +1 -1
- package/vscode/src/vs/workbench/browser/parts/views/viewPane.d.ts +1 -1
- package/vscode/src/vs/workbench/browser/parts/views/viewPane.js +4 -2
- package/vscode/src/vs/workbench/browser/parts/views/viewPaneContainer.d.ts +1 -1
- package/vscode/src/vs/workbench/browser/parts/views/viewsService.js +13 -1
- package/vscode/src/vs/workbench/browser/parts/views/viewsViewlet.d.ts +1 -1
- package/vscode/src/vs/workbench/browser/web.api.d.ts +1 -1
- package/vscode/src/vs/workbench/browser/workbench.contribution.js +37 -7
- package/vscode/src/vs/workbench/common/composite.d.ts +1 -1
- package/vscode/src/vs/workbench/common/contextkeys.js +12 -10
- package/vscode/src/vs/workbench/common/contributions.d.ts +1 -1
- package/vscode/src/vs/workbench/common/editor/diffEditorInput.js +6 -8
- package/vscode/src/vs/workbench/common/editor/editorGroupModel.d.ts +1 -1
- package/vscode/src/vs/workbench/common/editor/editorGroupModel.js +15 -5
- package/vscode/src/vs/workbench/common/editor/editorInput.d.ts +1 -1
- package/vscode/src/vs/workbench/common/editor/sideBySideEditorInput.js +7 -5
- package/vscode/src/vs/workbench/common/editor/textEditorModel.js +5 -4
- package/vscode/src/vs/workbench/common/editor/textResourceEditorInput.js +5 -3
- package/vscode/src/vs/workbench/common/editor.d.ts +3 -1
- package/vscode/src/vs/workbench/common/editor.js +18 -1
- package/vscode/src/vs/workbench/common/memento.d.ts +1 -1
- package/vscode/src/vs/workbench/common/panecomposite.d.ts +1 -1
- package/vscode/src/vs/workbench/common/resources.js +11 -9
- package/vscode/src/vs/workbench/common/theme.js +118 -10
- package/vscode/src/vs/workbench/common/views.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibility.contribution.js +5 -241
- package/vscode/src/vs/workbench/contrib/accessibility/browser/{accessibilityContribution.js → accessibilityConfiguration.js} +50 -73
- package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibilityContributions.js +312 -0
- package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibleView.js +376 -81
- package/vscode/src/vs/workbench/contrib/accessibility/browser/accessibleViewActions.js +216 -0
- package/vscode/src/vs/workbench/contrib/accessibility/browser/unfocusedViewDimmingContribution.js +63 -0
- package/vscode/src/vs/workbench/contrib/audioCues/browser/audioCueDebuggerContribution.js +1 -1
- package/vscode/src/vs/workbench/contrib/audioCues/browser/audioCueLineFeatureContribution.js +13 -13
- package/vscode/src/vs/workbench/contrib/bulkEdit/browser/bulkEditService.js +4 -1
- package/vscode/src/vs/workbench/contrib/bulkEdit/browser/bulkFileEdits.js +8 -3
- package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchy.contribution.js +10 -7
- package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchyPeek.js +4 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.js +2 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chat.js +2 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatModel.js +204 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatProvider.js +3 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatSlashCommands.js +3 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatVariables.js +3 -0
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/accessibility/accessibility.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/accessibility/accessibility.js +1 -1
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/diffEditorHelper.js +21 -10
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/find/simpleFindWidget.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/find/simpleFindWidget.js +45 -1
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/inspectEditorTokens/inspectEditorTokens.js +4 -2
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/largeFileOptimizations.js +1 -1
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/outline/documentSymbolsTree.js +4 -2
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/quickaccess/gotoSymbolQuickAccess.js +14 -4
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/toggleRenderControlCharacter.js +1 -1
- package/vscode/src/vs/workbench/contrib/codeEditor/browser/toggleRenderWhitespace.js +1 -1
- package/vscode/src/vs/workbench/contrib/comments/browser/commentColors.js +0 -5
- package/vscode/src/vs/workbench/contrib/comments/browser/commentReply.js +7 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadRangeDecorator.js +4 -2
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadWidget.js +15 -0
- package/vscode/src/vs/workbench/contrib/comments/browser/commentThreadZoneWidget.js +2 -3
- package/vscode/src/vs/workbench/contrib/comments/browser/commentsController.js +2 -3
- package/vscode/src/vs/workbench/contrib/comments/browser/media/review.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/comments/browser/simpleCommentEditor.js +2 -1
- package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditorInput.js +7 -5
- package/vscode/src/vs/workbench/contrib/customEditor/common/customTextEditorModel.js +4 -3
- package/vscode/src/vs/workbench/contrib/debug/browser/breakpointEditorContribution.js +1 -2
- package/vscode/src/vs/workbench/contrib/debug/browser/breakpointsView.js +13 -8
- package/vscode/src/vs/workbench/contrib/debug/browser/callStackView.js +10 -6
- package/vscode/src/vs/workbench/contrib/debug/browser/debug.contribution.js +5 -1
- package/vscode/src/vs/workbench/contrib/debug/browser/debugActionViewItems.js +5 -3
- package/vscode/src/vs/workbench/contrib/debug/browser/debugCommands.js +0 -1
- package/vscode/src/vs/workbench/contrib/debug/browser/debugConfigurationManager.js +3 -4
- package/vscode/src/vs/workbench/contrib/debug/browser/debugHover.js +5 -3
- package/vscode/src/vs/workbench/contrib/debug/browser/debugQuickAccess.js +1 -2
- package/vscode/src/vs/workbench/contrib/debug/browser/debugService.js +1 -1
- package/vscode/src/vs/workbench/contrib/debug/browser/debugSession.js +27 -26
- package/vscode/src/vs/workbench/contrib/debug/browser/debugTaskRunner.js +1 -2
- package/vscode/src/vs/workbench/contrib/debug/browser/disassemblyView.js +17 -13
- package/vscode/src/vs/workbench/contrib/debug/browser/repl.js +10 -7
- package/vscode/src/vs/workbench/contrib/debug/browser/replViewer.js +10 -6
- package/vscode/src/vs/workbench/contrib/debug/browser/variablesView.js +5 -4
- package/vscode/src/vs/workbench/contrib/debug/browser/watchExpressionsView.js +4 -2
- package/vscode/src/vs/workbench/contrib/debug/common/debug.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/debug/common/debugContentProvider.js +5 -3
- package/vscode/src/vs/workbench/contrib/debug/common/debugModel.js +19 -11
- package/vscode/src/vs/workbench/contrib/debug/common/debugStorage.js +25 -1
- package/vscode/src/vs/workbench/contrib/extensions/browser/extensionsActions.js +225 -113
- package/vscode/src/vs/workbench/contrib/externalUriOpener/common/contributedOpeners.js +4 -2
- package/vscode/src/vs/workbench/contrib/files/browser/editors/binaryFileEditor.js +4 -2
- package/vscode/src/vs/workbench/contrib/files/browser/editors/fileEditorInput.js +4 -3
- package/vscode/src/vs/workbench/contrib/files/browser/editors/textFileEditor.js +4 -2
- package/vscode/src/vs/workbench/contrib/files/browser/editors/textFileEditorTracker.js +1 -1
- package/vscode/src/vs/workbench/contrib/files/browser/explorerService.js +29 -5
- package/vscode/src/vs/workbench/contrib/files/browser/fileCommands.js +2 -1
- package/vscode/src/vs/workbench/contrib/files/browser/fileImportExport.js +11 -8
- package/vscode/src/vs/workbench/contrib/files/browser/files.contribution.js +1 -1
- package/vscode/src/vs/workbench/contrib/files/browser/files.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/files/browser/views/emptyView.js +4 -2
- package/vscode/src/vs/workbench/contrib/files/browser/views/explorerView.js +11 -6
- package/vscode/src/vs/workbench/contrib/files/browser/views/explorerViewer.js +22 -19
- package/vscode/src/vs/workbench/contrib/files/browser/views/openEditorsView.js +11 -7
- package/vscode/src/vs/workbench/contrib/files/common/files.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/files/common/files.js +6 -5
- package/vscode/src/vs/workbench/contrib/folding/browser/folding.contribution.js +16 -14
- package/vscode/src/vs/workbench/contrib/inlayHints/browser/inlayHintsAccessibilty.js +5 -3
- package/vscode/src/vs/workbench/contrib/interactive/browser/interactiveEditorInput.js +7 -5
- package/vscode/src/vs/workbench/contrib/languageDetection/browser/languageDetection.contribution.js +4 -2
- package/vscode/src/vs/workbench/contrib/languageStatus/browser/languageStatus.contribution.js +16 -23
- package/vscode/src/vs/workbench/contrib/markers/browser/markersModel.js +1 -2
- package/vscode/src/vs/workbench/contrib/markers/browser/markersTable.js +10 -6
- package/vscode/src/vs/workbench/contrib/markers/browser/markersView.js +1 -2
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorInput.js +7 -5
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditorInputModel.js +5 -3
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/diffComputer.js +27 -0
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/mapping.js +0 -24
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/mergeEditorModel.js +14 -14
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/model/textModelDiffs.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookBrowser.js +1 -6
- package/vscode/src/vs/workbench/contrib/output/browser/logViewer.js +7 -4
- package/vscode/src/vs/workbench/contrib/output/browser/outputLinkProvider.js +4 -2
- package/vscode/src/vs/workbench/contrib/preferences/browser/keybindingWidgets.js +16 -11
- package/vscode/src/vs/workbench/contrib/preferences/browser/keybindingsEditor.js +13 -8
- package/vscode/src/vs/workbench/contrib/preferences/browser/preferences.contribution.js +77 -62
- package/vscode/src/vs/workbench/contrib/preferences/browser/preferencesRenderers.js +5 -3
- package/vscode/src/vs/workbench/contrib/preferences/browser/preferencesSearch.js +114 -36
- package/vscode/src/vs/workbench/contrib/preferences/browser/settingsEditor2.js +92 -73
- package/vscode/src/vs/workbench/contrib/preferences/browser/settingsTree.js +21 -14
- package/vscode/src/vs/workbench/contrib/preferences/browser/settingsTreeModels.js +110 -103
- package/vscode/src/vs/workbench/contrib/preferences/browser/settingsWidgets.js +0 -4
- package/vscode/src/vs/workbench/contrib/preferences/common/preferences.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/preferences/common/preferences.js +4 -4
- package/vscode/src/vs/workbench/contrib/quickaccess/browser/commandsQuickAccess.js +38 -36
- package/vscode/src/vs/workbench/contrib/quickaccess/browser/quickAccess.contribution.js +6 -2
- package/vscode/src/vs/workbench/contrib/quickaccess/browser/viewQuickAccess.js +5 -4
- package/vscode/src/vs/workbench/contrib/remote/browser/remoteExplorer.js +2 -2
- package/vscode/src/vs/workbench/contrib/remote/browser/tunnelView.js +66 -36
- package/vscode/src/vs/workbench/contrib/scm/browser/dirtydiffDecorator.js +7 -5
- package/vscode/src/vs/workbench/contrib/search/browser/anythingQuickAccess.js +57 -55
- package/vscode/src/vs/workbench/contrib/search/browser/quickTextSearch/textSearchQuickAccess.js +232 -0
- package/vscode/src/vs/workbench/contrib/search/browser/replaceService.js +7 -5
- package/vscode/src/vs/workbench/contrib/search/browser/search.contribution.js +33 -3
- package/vscode/src/vs/workbench/contrib/search/browser/searchActionsFind.js +1 -2
- package/vscode/src/vs/workbench/contrib/search/browser/searchActionsNav.js +3 -3
- package/vscode/src/vs/workbench/contrib/search/browser/searchActionsTextQuickAccess.js +23 -0
- package/vscode/src/vs/workbench/contrib/search/browser/searchIcons.js +5 -1
- package/vscode/src/vs/workbench/contrib/search/browser/searchModel.js +162 -90
- package/vscode/src/vs/workbench/contrib/search/browser/searchNotebookHelpers.js +57 -23
- package/vscode/src/vs/workbench/contrib/search/browser/searchResultsView.js +10 -6
- package/vscode/src/vs/workbench/contrib/search/browser/searchView.js +80 -58
- package/vscode/src/vs/workbench/contrib/search/browser/searchWidget.js +7 -5
- package/vscode/src/vs/workbench/contrib/search/browser/symbolsQuickAccess.js +7 -6
- package/vscode/src/vs/workbench/contrib/search/common/constants.js +2 -1
- package/vscode/src/vs/workbench/contrib/search/common/searchHistoryService.js +7 -5
- package/vscode/src/vs/workbench/contrib/searchEditor/browser/searchEditor.js +10 -7
- package/vscode/src/vs/workbench/contrib/searchEditor/browser/searchEditorActions.js +1 -2
- package/vscode/src/vs/workbench/contrib/searchEditor/browser/searchEditorInput.js +7 -5
- package/vscode/src/vs/workbench/contrib/snippets/browser/snippetCodeActionProvider.js +9 -6
- package/vscode/src/vs/workbench/contrib/snippets/browser/snippets.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/snippets/browser/snippetsService.js +9 -6
- package/vscode/src/vs/workbench/contrib/snippets/browser/tabCompletion.js +5 -3
- package/vscode/src/vs/workbench/contrib/tasks/common/tasks.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/terminal/browser/baseTerminalBackend.js +5 -6
- package/vscode/src/vs/workbench/contrib/terminal/browser/detachedTerminal.js +54 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/media/terminal.css.js +1 -1
- package/vscode/src/vs/workbench/contrib/terminal/browser/remoteTerminalBackend.js +3 -1
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminal.contribution.js +1 -1
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminal.d.ts +56 -6
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalActions.js +44 -31
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalConfigHelper.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalConfigHelper.js +4 -2
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalEditor.js +1 -1
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalEditorInput.js +5 -3
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalEditorService.js +7 -7
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalEvents.js +47 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalExtensions.js +4 -4
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalGroup.js +9 -9
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalGroupService.js +13 -18
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalInstance.js +86 -73
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalInstanceService.js +1 -1
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalMenus.js +15 -103
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalProfileResolverService.js +1 -2
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalProfileService.js +11 -6
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalQuickAccess.js +4 -2
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalRunRecentQuickPick.js +4 -2
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalService.js +49 -32
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalStatusList.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalTabbedView.js +3 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalTabsList.js +9 -13
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalView.js +30 -6
- package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/decorationAddon.js +2 -2
- package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/suggestAddon.js +2 -2
- package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/xtermTerminal.d.ts +7 -1
- package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/xtermTerminal.js +91 -25
- package/vscode/src/vs/workbench/contrib/terminal/browser/xterm-private.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/terminal/common/environmentVariable.d.ts +9 -0
- package/vscode/src/vs/workbench/contrib/terminal/common/environmentVariableService.js +4 -2
- package/vscode/src/vs/workbench/contrib/terminal/common/history.js +6 -6
- package/vscode/src/vs/workbench/contrib/terminal/common/remote/remoteTerminalChannel.js +6 -7
- package/vscode/src/vs/workbench/contrib/terminal/common/terminal.d.ts +35 -2
- package/vscode/src/vs/workbench/contrib/terminal/common/terminal.js +3 -7
- package/vscode/src/vs/workbench/contrib/terminal/common/terminalConfiguration.js +62 -10
- package/vscode/src/vs/workbench/contrib/terminal/common/terminalContextKey.js +8 -0
- package/vscode/src/vs/workbench/contrib/terminal/common/terminalEnvironment.js +3 -3
- package/vscode/src/vs/workbench/contrib/terminal/common/terminalStrings.js +7 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/accessibility/browser/terminal.accessibility.contribution.js +48 -11
- package/vscode/src/vs/workbench/contrib/terminalContrib/accessibility/browser/terminalAccessibilityHelp.js +42 -17
- package/vscode/src/vs/workbench/contrib/terminalContrib/accessibility/browser/terminalAccessibleBuffer.js +23 -17
- package/vscode/src/vs/workbench/contrib/terminalContrib/accessibility/browser/terminalAccessibleWidget.js +30 -20
- package/vscode/src/vs/workbench/contrib/terminalContrib/accessibility/browser/textAreaSyncAddon.js +98 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/quickFix/browser/quickFix.js +8 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/quickFix/browser/terminalQuickFixService.js +12 -0
- package/vscode/src/vs/workbench/contrib/testing/common/testResult.js +44 -17
- package/vscode/src/vs/workbench/contrib/testing/common/testTypes.js +2 -0
- package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchy.contribution.js +10 -7
- package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchyPeek.js +4 -2
- package/vscode/src/vs/workbench/contrib/webview/browser/webviewFindWidget.js +5 -1
- package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewEditor.js +4 -2
- package/vscode/src/vs/workbench/contrib/webviewView/browser/webviewViewPane.js +5 -4
- package/vscode/src/vs/workbench/services/actions/common/menusExtensionPoint.js +28 -0
- package/vscode/src/vs/workbench/services/activity/common/activity.d.ts +1 -1
- package/vscode/src/vs/workbench/services/{semanticSimilarity/common/semanticSimilarityService.js → aiEmbeddingVector/common/aiEmbeddingVectorService.js} +18 -13
- package/vscode/src/vs/workbench/services/aiRelatedInformation/common/aiRelatedInformation.js +10 -0
- package/vscode/src/vs/workbench/services/configuration/browser/configuration.js +6 -4
- package/vscode/src/vs/workbench/services/configuration/browser/configurationService.js +1 -1
- package/vscode/src/vs/workbench/services/configuration/common/configurationEditing.js +5 -6
- package/vscode/src/vs/workbench/services/editor/browser/codeEditorService.js +2 -2
- package/vscode/src/vs/workbench/services/editor/browser/editorResolverService.js +12 -9
- package/vscode/src/vs/workbench/services/editor/browser/editorService.js +6 -6
- package/vscode/src/vs/workbench/services/editor/common/editorGroupColumn.d.ts +1 -1
- package/vscode/src/vs/workbench/services/editor/common/editorGroupsService.d.ts +1 -1
- package/vscode/src/vs/workbench/services/editor/common/editorResolverService.d.ts +1 -1
- package/vscode/src/vs/workbench/services/editor/common/editorService.d.ts +1 -1
- package/vscode/src/vs/workbench/services/extensionManagement/common/extensionManagement.d.ts +1 -1
- package/vscode/src/vs/workbench/services/extensions/browser/extensionService.js +4 -3
- package/vscode/src/vs/workbench/services/extensions/browser/extensionUrlHandler.js +8 -6
- package/vscode/src/vs/workbench/services/extensions/common/abstractExtensionService.d.ts +1 -1
- package/vscode/src/vs/workbench/services/extensions/common/abstractExtensionService.js +4 -3
- package/vscode/src/vs/workbench/services/extensions/common/extensionDescriptionRegistry.d.ts +1 -1
- package/vscode/src/vs/workbench/services/extensions/common/extensionHostKind.d.ts +1 -1
- package/vscode/src/vs/workbench/services/extensions/common/extensionHostManager.d.ts +1 -1
- package/vscode/src/vs/workbench/services/extensions/common/extensionHostManager.js +5 -4
- package/vscode/src/vs/workbench/services/extensions/common/extensionHostProtocol.d.ts +1 -1
- package/vscode/src/vs/workbench/services/extensions/common/extensionHostProxy.d.ts +1 -1
- package/vscode/src/vs/workbench/services/extensions/common/extensionRunningLocation.d.ts +1 -1
- package/vscode/src/vs/workbench/services/extensions/common/extensions.d.ts +1 -1
- package/vscode/src/vs/workbench/services/extensions/common/extensionsApiProposals.js +10 -5
- package/vscode/src/vs/workbench/services/extensions/common/extensionsRegistry.d.ts +1 -1
- package/vscode/src/vs/workbench/services/extensions/common/extensionsRegistry.js +9 -0
- package/vscode/src/vs/workbench/services/extensions/common/proxyIdentifier.d.ts +1 -1
- package/vscode/src/vs/workbench/services/filesConfiguration/common/filesConfigurationService.d.ts +1 -1
- package/vscode/src/vs/workbench/services/filesConfiguration/common/filesConfigurationService.js +10 -9
- package/vscode/src/vs/workbench/services/history/browser/historyService.js +14 -11
- package/vscode/src/vs/workbench/services/host/browser/browserHostService.d.ts +1 -1
- package/vscode/src/vs/workbench/services/hover/browser/hover.d.ts +2 -2
- package/vscode/src/vs/workbench/services/hover/browser/hoverService.d.ts +1 -1
- package/vscode/src/vs/workbench/services/hover/browser/hoverWidget.js +11 -3
- package/vscode/src/vs/workbench/services/keybinding/browser/keybindingService.js +6 -5
- package/vscode/src/vs/workbench/services/languageDetection/browser/languageDetectionWorkerServiceImpl.js +10 -8
- package/vscode/src/vs/workbench/services/languageStatus/common/languageStatusService.d.ts +1 -1
- package/vscode/src/vs/workbench/services/layout/browser/layoutService.d.ts +1 -1
- package/vscode/src/vs/workbench/services/lifecycle/common/lifecycle.d.ts +1 -1
- package/vscode/src/vs/workbench/services/lifecycle/common/lifecycleService.js +6 -4
- package/vscode/src/vs/workbench/services/localization/common/locale.js +3 -0
- package/vscode/src/vs/workbench/services/notification/common/notificationService.js +5 -3
- package/vscode/src/vs/workbench/services/output/common/output.d.ts +1 -1
- package/vscode/src/vs/workbench/services/path/common/pathService.js +4 -3
- package/vscode/src/vs/workbench/services/preferences/browser/keybindingsEditorInput.js +5 -3
- package/vscode/src/vs/workbench/services/preferences/browser/keybindingsEditorModel.js +12 -11
- package/vscode/src/vs/workbench/services/preferences/common/preferences.d.ts +4 -3
- package/vscode/src/vs/workbench/services/preferences/common/preferences.js +3 -2
- package/vscode/src/vs/workbench/services/preferences/common/preferencesEditorInput.js +5 -3
- package/vscode/src/vs/workbench/services/preferences/common/preferencesModels.js +4 -2
- package/vscode/src/vs/workbench/services/remote/common/remoteAgentService.d.ts +1 -1
- package/vscode/src/vs/workbench/services/remote/common/remoteExplorerService.js +6 -817
- package/vscode/src/vs/workbench/services/remote/common/{remoteExplorerService.d.ts → tunnelModel.d.ts} +1 -1
- package/vscode/src/vs/workbench/services/remote/common/tunnelModel.js +860 -0
- package/vscode/src/vs/workbench/services/search/common/queryBuilder.d.ts +1 -1
- package/vscode/src/vs/workbench/services/search/common/search.d.ts +1 -1
- package/vscode/src/vs/workbench/services/search/common/searchService.js +41 -26
- package/vscode/src/vs/workbench/services/statusbar/browser/statusbar.d.ts +12 -3
- package/vscode/src/vs/workbench/services/statusbar/browser/statusbar.js +2 -1
- package/vscode/src/vs/workbench/services/storage/browser/storageService.js +4 -2
- package/vscode/src/vs/workbench/services/suggest/browser/simpleCompletionItem.d.ts +1 -1
- package/vscode/src/vs/workbench/services/suggest/browser/simpleCompletionModel.d.ts +1 -1
- package/vscode/src/vs/workbench/services/suggest/browser/simpleSuggestWidget.d.ts +1 -1
- package/vscode/src/vs/workbench/services/textMate/browser/backgroundTokenization/textMateWorkerTokenizerController.js +1 -1
- package/vscode/src/vs/workbench/services/textMate/browser/backgroundTokenization/threadedBackgroundTokenizerFactory.js +9 -7
- package/vscode/src/vs/workbench/services/textMate/browser/textMateTokenizationFeatureImpl.js +7 -5
- package/vscode/src/vs/workbench/services/textfile/browser/browserTextFileService.js +1 -1
- package/vscode/src/vs/workbench/services/textfile/browser/textFileService.js +8 -6
- package/vscode/src/vs/workbench/services/textfile/common/encoding.js +5 -3
- package/vscode/src/vs/workbench/services/textfile/common/textFileEditorModel.js +19 -17
- package/vscode/src/vs/workbench/services/textfile/common/textFileSaveParticipant.js +4 -1
- package/vscode/src/vs/workbench/services/textfile/common/textfiles.d.ts +1 -1
- package/vscode/src/vs/workbench/services/themes/common/workbenchThemeService.d.ts +1 -1
- package/vscode/src/vs/workbench/services/untitled/common/untitledTextEditorInput.js +5 -3
- package/vscode/src/vs/workbench/services/untitled/common/untitledTextEditorModel.d.ts +1 -1
- package/vscode/src/vs/workbench/services/untitled/common/untitledTextEditorModel.js +12 -9
- package/vscode/src/vs/workbench/services/untitled/common/untitledTextEditorService.d.ts +1 -1
- package/vscode/src/vs/workbench/services/untitled/common/untitledTextEditorService.js +4 -2
- package/vscode/src/vs/workbench/services/update/browser/updateService.d.ts +1 -1
- package/vscode/src/vs/workbench/services/url/browser/urlService.d.ts +1 -1
- package/vscode/src/vs/workbench/services/userData/browser/userDataInit.d.ts +1 -1
- package/vscode/src/vs/workbench/services/userDataProfile/common/userDataProfile.d.ts +1 -1
- package/vscode/src/vs/workbench/services/views/browser/viewDescriptorService.js +14 -13
- package/vscode/src/vs/workbench/services/views/common/viewContainerModel.js +4 -5
- package/vscode/src/vs/workbench/services/workingCopy/common/fileWorkingCopy.d.ts +1 -1
- package/vscode/src/vs/workbench/services/workingCopy/common/resourceWorkingCopy.d.ts +1 -1
- package/vscode/src/vs/workbench/services/workingCopy/common/storedFileWorkingCopy.d.ts +1 -1
- package/vscode/src/vs/workbench/services/workingCopy/common/storedFileWorkingCopySaveParticipant.js +1 -0
- package/vscode/src/vs/workbench/services/workingCopy/common/workingCopy.d.ts +1 -1
- package/vscode/src/vs/workbench/services/workingCopy/common/workingCopyBackupService.js +17 -8
- package/vscode/src/vs/workbench/services/workingCopy/common/workingCopyFileOperationParticipant.js +1 -0
- package/vscode/src/vs/workbench/services/workingCopy/common/workingCopyFileService.d.ts +1 -1
- package/vscode/src/vs/workbench/services/workspaces/browser/workspacesService.js +8 -11
- package/vscode/src/vs/workbench/api/browser/mainThreadSemanticSimilarity.js +0 -29
- package/vscode/src/vs/workbench/api/common/extHostSemanticSimilarity.js +0 -31
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatActions.js +0 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/quickQuestionActions/quickQuestionAction.js +0 -47
- package/vscode/src/vs/workbench/contrib/chat/common/chatContextKeys.js +0 -4
- package/vscode/src/vs/workbench/contrib/tasks/browser/taskQuickPick.js +0 -386
- package/vscode/src/vs/workbench/contrib/tasks/browser/tasksQuickAccess.js +0 -109
- /package/vscode/src/vs/workbench/contrib/search/{browser → common}/notebookSearch.js +0 -0
|
@@ -0,0 +1,860 @@
|
|
|
1
|
+
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
+
import * as nls from 'monaco-editor/esm/vs/nls.js';
|
|
3
|
+
import { flatten } from 'monaco-editor/esm/vs/base/common/arrays.js';
|
|
4
|
+
import { debounce } from 'monaco-editor/esm/vs/base/common/decorators.js';
|
|
5
|
+
import { Emitter, Event } from 'monaco-editor/esm/vs/base/common/event.js';
|
|
6
|
+
import { hash } from 'monaco-editor/esm/vs/base/common/hash.js';
|
|
7
|
+
import { Disposable, DisposableStore } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
8
|
+
import { URI } from 'monaco-editor/esm/vs/base/common/uri.js';
|
|
9
|
+
import { IConfigurationService } from 'monaco-editor/esm/vs/platform/configuration/common/configuration.js';
|
|
10
|
+
import '../../../../../../../override/vs/platform/dialogs/common/dialogs.js';
|
|
11
|
+
import { ILogService } from 'monaco-editor/esm/vs/platform/log/common/log.js';
|
|
12
|
+
import { IRemoteAuthorityResolverService } from '../../../../platform/remote/common/remoteAuthorityResolver.js';
|
|
13
|
+
import { IStorageService } from 'monaco-editor/esm/vs/platform/storage/common/storage.js';
|
|
14
|
+
import { ProvidedOnAutoForward, isLocalhost, isAllInterfaces, TunnelProtocol, TunnelPrivacyId, LOCALHOST_ADDRESSES, ALL_INTERFACES_ADDRESSES, ITunnelService } from '../../../../platform/tunnel/common/tunnel.js';
|
|
15
|
+
import { IWorkspaceContextService } from 'monaco-editor/esm/vs/platform/workspace/common/workspace.js';
|
|
16
|
+
import { IWorkbenchEnvironmentService } from '../../environment/common/environmentService.js';
|
|
17
|
+
import { IExtensionService } from '../../extensions/common/extensions.js';
|
|
18
|
+
import { CancellationTokenSource } from 'monaco-editor/esm/vs/base/common/cancellation.js';
|
|
19
|
+
import { isString, isNumber, isObject } from 'monaco-editor/esm/vs/base/common/types.js';
|
|
20
|
+
import { deepClone } from 'monaco-editor/esm/vs/base/common/objects.js';
|
|
21
|
+
import { RawContextKey, IContextKeyService } from 'monaco-editor/esm/vs/platform/contextkey/common/contextkey.js';
|
|
22
|
+
import { IDialogService } from '../../../../platform/dialogs/common/dialogs.js';
|
|
23
|
+
const MISMATCH_LOCAL_PORT_COOLDOWN = 10 * 1000;
|
|
24
|
+
const TUNNELS_TO_RESTORE = 'remote.tunnels.toRestore';
|
|
25
|
+
const ACTIVATION_EVENT = 'onTunnel';
|
|
26
|
+
const forwardedPortsViewEnabled = ( (new RawContextKey(
|
|
27
|
+
'forwardedPortsViewEnabled',
|
|
28
|
+
false,
|
|
29
|
+
(nls.localize('tunnel.forwardedPortsViewEnabled', "Whether the Ports view is enabled."))
|
|
30
|
+
)));
|
|
31
|
+
function parseAddress(address) {
|
|
32
|
+
const matches = address.match(/^([a-zA-Z0-9_-]+(?:\.[a-zA-Z0-9_-]+)*:)?([0-9]+)$/);
|
|
33
|
+
if (!matches) {
|
|
34
|
+
return undefined;
|
|
35
|
+
}
|
|
36
|
+
return { host: matches[1]?.substring(0, matches[1].length - 1) || 'localhost', port: Number(matches[2]) };
|
|
37
|
+
}
|
|
38
|
+
var TunnelCloseReason;
|
|
39
|
+
( ((function(TunnelCloseReason) {
|
|
40
|
+
TunnelCloseReason["Other"] = "Other";
|
|
41
|
+
TunnelCloseReason["User"] = "User";
|
|
42
|
+
TunnelCloseReason["AutoForwardEnd"] = "AutoForwardEnd";
|
|
43
|
+
})(TunnelCloseReason || (TunnelCloseReason = {}))));
|
|
44
|
+
var TunnelSource;
|
|
45
|
+
( ((function(TunnelSource) {
|
|
46
|
+
TunnelSource[TunnelSource["User"] = 0] = "User";
|
|
47
|
+
TunnelSource[TunnelSource["Auto"] = 1] = "Auto";
|
|
48
|
+
TunnelSource[TunnelSource["Extension"] = 2] = "Extension";
|
|
49
|
+
})(TunnelSource || (TunnelSource = {}))));
|
|
50
|
+
const UserTunnelSource = {
|
|
51
|
+
source: TunnelSource.User,
|
|
52
|
+
description: ( (nls.localize('tunnel.source.user', "User Forwarded")))
|
|
53
|
+
};
|
|
54
|
+
const AutoTunnelSource = {
|
|
55
|
+
source: TunnelSource.Auto,
|
|
56
|
+
description: ( (nls.localize('tunnel.source.auto', "Auto Forwarded")))
|
|
57
|
+
};
|
|
58
|
+
function mapHasAddress(map, host, port) {
|
|
59
|
+
const initialAddress = map.get(makeAddress(host, port));
|
|
60
|
+
if (initialAddress) {
|
|
61
|
+
return initialAddress;
|
|
62
|
+
}
|
|
63
|
+
if (isLocalhost(host)) {
|
|
64
|
+
for (const testHost of LOCALHOST_ADDRESSES) {
|
|
65
|
+
const testAddress = makeAddress(testHost, port);
|
|
66
|
+
if (( (map.has(testAddress)))) {
|
|
67
|
+
return map.get(testAddress);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
else if (isAllInterfaces(host)) {
|
|
72
|
+
for (const testHost of ALL_INTERFACES_ADDRESSES) {
|
|
73
|
+
const testAddress = makeAddress(testHost, port);
|
|
74
|
+
if (( (map.has(testAddress)))) {
|
|
75
|
+
return map.get(testAddress);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return undefined;
|
|
80
|
+
}
|
|
81
|
+
function mapHasAddressLocalhostOrAllInterfaces(map, host, port) {
|
|
82
|
+
const originalAddress = mapHasAddress(map, host, port);
|
|
83
|
+
if (originalAddress) {
|
|
84
|
+
return originalAddress;
|
|
85
|
+
}
|
|
86
|
+
const otherHost = isAllInterfaces(host) ? 'localhost' : (isLocalhost(host) ? '0.0.0.0' : undefined);
|
|
87
|
+
if (otherHost) {
|
|
88
|
+
return mapHasAddress(map, otherHost, port);
|
|
89
|
+
}
|
|
90
|
+
return undefined;
|
|
91
|
+
}
|
|
92
|
+
function makeAddress(host, port) {
|
|
93
|
+
return host + ':' + port;
|
|
94
|
+
}
|
|
95
|
+
var OnPortForward;
|
|
96
|
+
( ((function(OnPortForward) {
|
|
97
|
+
OnPortForward["Notify"] = "notify";
|
|
98
|
+
OnPortForward["OpenBrowser"] = "openBrowser";
|
|
99
|
+
OnPortForward["OpenBrowserOnce"] = "openBrowserOnce";
|
|
100
|
+
OnPortForward["OpenPreview"] = "openPreview";
|
|
101
|
+
OnPortForward["Silent"] = "silent";
|
|
102
|
+
OnPortForward["Ignore"] = "ignore";
|
|
103
|
+
})(OnPortForward || (OnPortForward = {}))));
|
|
104
|
+
function isCandidatePort(candidate) {
|
|
105
|
+
return candidate && 'host' in candidate && typeof candidate.host === 'string'
|
|
106
|
+
&& 'port' in candidate && typeof candidate.port === 'number'
|
|
107
|
+
&& (!('detail' in candidate) || typeof candidate.detail === 'string')
|
|
108
|
+
&& (!('pid' in candidate) || typeof candidate.pid === 'string');
|
|
109
|
+
}
|
|
110
|
+
class PortsAttributes extends Disposable {
|
|
111
|
+
static { this.SETTING = 'remote.portsAttributes'; }
|
|
112
|
+
static { this.DEFAULTS = 'remote.otherPortsAttributes'; }
|
|
113
|
+
static { this.RANGE = /^(\d+)\-(\d+)$/; }
|
|
114
|
+
static { this.HOST_AND_PORT = /^([a-z0-9\-]+):(\d{1,5})$/; }
|
|
115
|
+
constructor(configurationService) {
|
|
116
|
+
super();
|
|
117
|
+
this.configurationService = configurationService;
|
|
118
|
+
this.portsAttributes = [];
|
|
119
|
+
this._onDidChangeAttributes = ( (new Emitter()));
|
|
120
|
+
this.onDidChangeAttributes = this._onDidChangeAttributes.event;
|
|
121
|
+
this._register(configurationService.onDidChangeConfiguration(e => {
|
|
122
|
+
if (e.affectsConfiguration(PortsAttributes.SETTING) || e.affectsConfiguration(PortsAttributes.DEFAULTS)) {
|
|
123
|
+
this.updateAttributes();
|
|
124
|
+
}
|
|
125
|
+
}));
|
|
126
|
+
this.updateAttributes();
|
|
127
|
+
}
|
|
128
|
+
updateAttributes() {
|
|
129
|
+
this.portsAttributes = this.readSetting();
|
|
130
|
+
this._onDidChangeAttributes.fire();
|
|
131
|
+
}
|
|
132
|
+
getAttributes(port, host, commandLine) {
|
|
133
|
+
let index = this.findNextIndex(port, host, commandLine, this.portsAttributes, 0);
|
|
134
|
+
const attributes = {
|
|
135
|
+
label: undefined,
|
|
136
|
+
onAutoForward: undefined,
|
|
137
|
+
elevateIfNeeded: undefined,
|
|
138
|
+
requireLocalPort: undefined,
|
|
139
|
+
protocol: undefined
|
|
140
|
+
};
|
|
141
|
+
while (index >= 0) {
|
|
142
|
+
const found = this.portsAttributes[index];
|
|
143
|
+
if (found.key === port) {
|
|
144
|
+
attributes.onAutoForward = found.onAutoForward ?? attributes.onAutoForward;
|
|
145
|
+
attributes.elevateIfNeeded = (found.elevateIfNeeded !== undefined) ? found.elevateIfNeeded : attributes.elevateIfNeeded;
|
|
146
|
+
attributes.label = found.label ?? attributes.label;
|
|
147
|
+
attributes.requireLocalPort = found.requireLocalPort;
|
|
148
|
+
attributes.protocol = found.protocol;
|
|
149
|
+
}
|
|
150
|
+
else {
|
|
151
|
+
attributes.onAutoForward = attributes.onAutoForward ?? found.onAutoForward;
|
|
152
|
+
attributes.elevateIfNeeded = (attributes.elevateIfNeeded !== undefined) ? attributes.elevateIfNeeded : found.elevateIfNeeded;
|
|
153
|
+
attributes.label = attributes.label ?? found.label;
|
|
154
|
+
attributes.requireLocalPort = (attributes.requireLocalPort !== undefined) ? attributes.requireLocalPort : undefined;
|
|
155
|
+
attributes.protocol = attributes.protocol ?? found.protocol;
|
|
156
|
+
}
|
|
157
|
+
index = this.findNextIndex(port, host, commandLine, this.portsAttributes, index + 1);
|
|
158
|
+
}
|
|
159
|
+
if (attributes.onAutoForward !== undefined || attributes.elevateIfNeeded !== undefined
|
|
160
|
+
|| attributes.label !== undefined || attributes.requireLocalPort !== undefined
|
|
161
|
+
|| attributes.protocol !== undefined) {
|
|
162
|
+
return attributes;
|
|
163
|
+
}
|
|
164
|
+
return this.getOtherAttributes();
|
|
165
|
+
}
|
|
166
|
+
hasStartEnd(value) {
|
|
167
|
+
return (value.start !== undefined) && (value.end !== undefined);
|
|
168
|
+
}
|
|
169
|
+
hasHostAndPort(value) {
|
|
170
|
+
return (value.host !== undefined) && (value.port !== undefined)
|
|
171
|
+
&& isString(value.host) && isNumber(value.port);
|
|
172
|
+
}
|
|
173
|
+
findNextIndex(port, host, commandLine, attributes, fromIndex) {
|
|
174
|
+
if (fromIndex >= attributes.length) {
|
|
175
|
+
return -1;
|
|
176
|
+
}
|
|
177
|
+
const shouldUseHost = !isLocalhost(host) && !isAllInterfaces(host);
|
|
178
|
+
const sliced = attributes.slice(fromIndex);
|
|
179
|
+
const foundIndex = sliced.findIndex((value) => {
|
|
180
|
+
if (isNumber(value.key)) {
|
|
181
|
+
return shouldUseHost ? false : value.key === port;
|
|
182
|
+
}
|
|
183
|
+
else if (this.hasStartEnd(value.key)) {
|
|
184
|
+
return shouldUseHost ? false : (port >= value.key.start && port <= value.key.end);
|
|
185
|
+
}
|
|
186
|
+
else if (this.hasHostAndPort(value.key)) {
|
|
187
|
+
return (port === value.key.port) && (host === value.key.host);
|
|
188
|
+
}
|
|
189
|
+
else {
|
|
190
|
+
return commandLine ? value.key.test(commandLine) : false;
|
|
191
|
+
}
|
|
192
|
+
});
|
|
193
|
+
return foundIndex >= 0 ? foundIndex + fromIndex : -1;
|
|
194
|
+
}
|
|
195
|
+
readSetting() {
|
|
196
|
+
const settingValue = this.configurationService.getValue(PortsAttributes.SETTING);
|
|
197
|
+
if (!settingValue || !isObject(settingValue)) {
|
|
198
|
+
return [];
|
|
199
|
+
}
|
|
200
|
+
const attributes = [];
|
|
201
|
+
for (const attributesKey in settingValue) {
|
|
202
|
+
if (attributesKey === undefined) {
|
|
203
|
+
continue;
|
|
204
|
+
}
|
|
205
|
+
const setting = settingValue[attributesKey];
|
|
206
|
+
let key = undefined;
|
|
207
|
+
if (Number(attributesKey)) {
|
|
208
|
+
key = Number(attributesKey);
|
|
209
|
+
}
|
|
210
|
+
else if (isString(attributesKey)) {
|
|
211
|
+
if (PortsAttributes.RANGE.test(attributesKey)) {
|
|
212
|
+
const match = attributesKey.match(PortsAttributes.RANGE);
|
|
213
|
+
key = { start: Number(match[1]), end: Number(match[2]) };
|
|
214
|
+
}
|
|
215
|
+
else if (PortsAttributes.HOST_AND_PORT.test(attributesKey)) {
|
|
216
|
+
const match = attributesKey.match(PortsAttributes.HOST_AND_PORT);
|
|
217
|
+
key = { host: match[1], port: Number(match[2]) };
|
|
218
|
+
}
|
|
219
|
+
else {
|
|
220
|
+
let regTest = undefined;
|
|
221
|
+
try {
|
|
222
|
+
regTest = RegExp(attributesKey);
|
|
223
|
+
}
|
|
224
|
+
catch (e) {
|
|
225
|
+
}
|
|
226
|
+
if (regTest) {
|
|
227
|
+
key = regTest;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
if (!key) {
|
|
232
|
+
continue;
|
|
233
|
+
}
|
|
234
|
+
attributes.push({
|
|
235
|
+
key: key,
|
|
236
|
+
elevateIfNeeded: setting.elevateIfNeeded,
|
|
237
|
+
onAutoForward: setting.onAutoForward,
|
|
238
|
+
label: setting.label,
|
|
239
|
+
requireLocalPort: setting.requireLocalPort,
|
|
240
|
+
protocol: setting.protocol
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
const defaults = this.configurationService.getValue(PortsAttributes.DEFAULTS);
|
|
244
|
+
if (defaults) {
|
|
245
|
+
this.defaultPortAttributes = {
|
|
246
|
+
elevateIfNeeded: defaults.elevateIfNeeded,
|
|
247
|
+
label: defaults.label,
|
|
248
|
+
onAutoForward: defaults.onAutoForward,
|
|
249
|
+
requireLocalPort: defaults.requireLocalPort,
|
|
250
|
+
protocol: defaults.protocol
|
|
251
|
+
};
|
|
252
|
+
}
|
|
253
|
+
return this.sortAttributes(attributes);
|
|
254
|
+
}
|
|
255
|
+
sortAttributes(attributes) {
|
|
256
|
+
function getVal(item, thisRef) {
|
|
257
|
+
if (isNumber(item.key)) {
|
|
258
|
+
return item.key;
|
|
259
|
+
}
|
|
260
|
+
else if (thisRef.hasStartEnd(item.key)) {
|
|
261
|
+
return item.key.start;
|
|
262
|
+
}
|
|
263
|
+
else if (thisRef.hasHostAndPort(item.key)) {
|
|
264
|
+
return item.key.port;
|
|
265
|
+
}
|
|
266
|
+
else {
|
|
267
|
+
return Number.MAX_VALUE;
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
return attributes.sort((a, b) => {
|
|
271
|
+
return getVal(a, this) - getVal(b, this);
|
|
272
|
+
});
|
|
273
|
+
}
|
|
274
|
+
getOtherAttributes() {
|
|
275
|
+
return this.defaultPortAttributes;
|
|
276
|
+
}
|
|
277
|
+
static providedActionToAction(providedAction) {
|
|
278
|
+
switch (providedAction) {
|
|
279
|
+
case ProvidedOnAutoForward.Notify: return OnPortForward.Notify;
|
|
280
|
+
case ProvidedOnAutoForward.OpenBrowser: return OnPortForward.OpenBrowser;
|
|
281
|
+
case ProvidedOnAutoForward.OpenBrowserOnce: return OnPortForward.OpenBrowserOnce;
|
|
282
|
+
case ProvidedOnAutoForward.OpenPreview: return OnPortForward.OpenPreview;
|
|
283
|
+
case ProvidedOnAutoForward.Silent: return OnPortForward.Silent;
|
|
284
|
+
case ProvidedOnAutoForward.Ignore: return OnPortForward.Ignore;
|
|
285
|
+
default: return undefined;
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
async addAttributes(port, attributes, target) {
|
|
289
|
+
const settingValue = this.configurationService.inspect(PortsAttributes.SETTING);
|
|
290
|
+
const remoteValue = settingValue.userRemoteValue;
|
|
291
|
+
let newRemoteValue;
|
|
292
|
+
if (!remoteValue || !isObject(remoteValue)) {
|
|
293
|
+
newRemoteValue = {};
|
|
294
|
+
}
|
|
295
|
+
else {
|
|
296
|
+
newRemoteValue = deepClone(remoteValue);
|
|
297
|
+
}
|
|
298
|
+
if (!newRemoteValue[`${port}`]) {
|
|
299
|
+
newRemoteValue[`${port}`] = {};
|
|
300
|
+
}
|
|
301
|
+
for (const attribute in attributes) {
|
|
302
|
+
newRemoteValue[`${port}`][attribute] = attributes[attribute];
|
|
303
|
+
}
|
|
304
|
+
return this.configurationService.updateValue(PortsAttributes.SETTING, newRemoteValue, target);
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
let TunnelModel = class TunnelModel extends Disposable {
|
|
308
|
+
constructor(tunnelService, storageService, configurationService, environmentService, remoteAuthorityResolverService, workspaceContextService, logService, dialogService, extensionService, contextKeyService) {
|
|
309
|
+
super();
|
|
310
|
+
this.tunnelService = tunnelService;
|
|
311
|
+
this.storageService = storageService;
|
|
312
|
+
this.configurationService = configurationService;
|
|
313
|
+
this.environmentService = environmentService;
|
|
314
|
+
this.remoteAuthorityResolverService = remoteAuthorityResolverService;
|
|
315
|
+
this.workspaceContextService = workspaceContextService;
|
|
316
|
+
this.logService = logService;
|
|
317
|
+
this.dialogService = dialogService;
|
|
318
|
+
this.extensionService = extensionService;
|
|
319
|
+
this.contextKeyService = contextKeyService;
|
|
320
|
+
this.inProgress = ( (new Map()));
|
|
321
|
+
this._onForwardPort = ( (new Emitter()));
|
|
322
|
+
this.onForwardPort = this._onForwardPort.event;
|
|
323
|
+
this._onClosePort = ( (new Emitter()));
|
|
324
|
+
this.onClosePort = this._onClosePort.event;
|
|
325
|
+
this._onPortName = ( (new Emitter()));
|
|
326
|
+
this.onPortName = this._onPortName.event;
|
|
327
|
+
this._onCandidatesChanged = ( (new Emitter()));
|
|
328
|
+
this.onCandidatesChanged = this._onCandidatesChanged.event;
|
|
329
|
+
this._onEnvironmentTunnelsSet = ( (new Emitter()));
|
|
330
|
+
this.onEnvironmentTunnelsSet = this._onEnvironmentTunnelsSet.event;
|
|
331
|
+
this._environmentTunnelsSet = false;
|
|
332
|
+
this.restoreListener = undefined;
|
|
333
|
+
this.restoreComplete = false;
|
|
334
|
+
this.onRestoreComplete = ( (new Emitter()));
|
|
335
|
+
this.unrestoredExtensionTunnels = ( (new Map()));
|
|
336
|
+
this.sessionCachedProperties = ( (new Map()));
|
|
337
|
+
this.portAttributesProviders = [];
|
|
338
|
+
this.mismatchCooldown = ( (new Date()));
|
|
339
|
+
this.configPortsAttributes = ( (new PortsAttributes(configurationService)));
|
|
340
|
+
this.tunnelRestoreValue = this.getTunnelRestoreValue();
|
|
341
|
+
this._register(this.configPortsAttributes.onDidChangeAttributes(this.updateAttributes, this));
|
|
342
|
+
this.forwarded = ( (new Map()));
|
|
343
|
+
this.remoteTunnels = ( (new Map()));
|
|
344
|
+
this.tunnelService.tunnels.then(async (tunnels) => {
|
|
345
|
+
const attributes = await this.getAttributes(( (tunnels.map(tunnel => {
|
|
346
|
+
return { port: tunnel.tunnelRemotePort, host: tunnel.tunnelRemoteHost };
|
|
347
|
+
}))));
|
|
348
|
+
for (const tunnel of tunnels) {
|
|
349
|
+
if (tunnel.localAddress) {
|
|
350
|
+
const key = makeAddress(tunnel.tunnelRemoteHost, tunnel.tunnelRemotePort);
|
|
351
|
+
const matchingCandidate = mapHasAddressLocalhostOrAllInterfaces(this._candidates ?? ( (new Map())), tunnel.tunnelRemoteHost, tunnel.tunnelRemotePort);
|
|
352
|
+
this.forwarded.set(key, {
|
|
353
|
+
remotePort: tunnel.tunnelRemotePort,
|
|
354
|
+
remoteHost: tunnel.tunnelRemoteHost,
|
|
355
|
+
localAddress: tunnel.localAddress,
|
|
356
|
+
protocol: attributes?.get(tunnel.tunnelRemotePort)?.protocol ?? TunnelProtocol.Http,
|
|
357
|
+
localUri: await this.makeLocalUri(tunnel.localAddress, attributes?.get(tunnel.tunnelRemotePort)),
|
|
358
|
+
localPort: tunnel.tunnelLocalPort,
|
|
359
|
+
runningProcess: matchingCandidate?.detail,
|
|
360
|
+
hasRunningProcess: !!matchingCandidate,
|
|
361
|
+
pid: matchingCandidate?.pid,
|
|
362
|
+
privacy: tunnel.privacy,
|
|
363
|
+
source: UserTunnelSource,
|
|
364
|
+
});
|
|
365
|
+
this.remoteTunnels.set(key, tunnel);
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
});
|
|
369
|
+
this.detected = ( (new Map()));
|
|
370
|
+
this._register(this.tunnelService.onTunnelOpened(async (tunnel) => {
|
|
371
|
+
const key = makeAddress(tunnel.tunnelRemoteHost, tunnel.tunnelRemotePort);
|
|
372
|
+
if (!mapHasAddressLocalhostOrAllInterfaces(this.forwarded, tunnel.tunnelRemoteHost, tunnel.tunnelRemotePort)
|
|
373
|
+
&& !mapHasAddressLocalhostOrAllInterfaces(this.detected, tunnel.tunnelRemoteHost, tunnel.tunnelRemotePort)
|
|
374
|
+
&& !mapHasAddressLocalhostOrAllInterfaces(this.inProgress, tunnel.tunnelRemoteHost, tunnel.tunnelRemotePort)
|
|
375
|
+
&& tunnel.localAddress) {
|
|
376
|
+
const matchingCandidate = mapHasAddressLocalhostOrAllInterfaces(this._candidates ?? ( (new Map())), tunnel.tunnelRemoteHost, tunnel.tunnelRemotePort);
|
|
377
|
+
const attributes = (await this.getAttributes([{ port: tunnel.tunnelRemotePort, host: tunnel.tunnelRemoteHost }]))?.get(tunnel.tunnelRemotePort);
|
|
378
|
+
this.forwarded.set(key, {
|
|
379
|
+
remoteHost: tunnel.tunnelRemoteHost,
|
|
380
|
+
remotePort: tunnel.tunnelRemotePort,
|
|
381
|
+
localAddress: tunnel.localAddress,
|
|
382
|
+
protocol: attributes?.protocol ?? TunnelProtocol.Http,
|
|
383
|
+
localUri: await this.makeLocalUri(tunnel.localAddress, attributes),
|
|
384
|
+
localPort: tunnel.tunnelLocalPort,
|
|
385
|
+
closeable: true,
|
|
386
|
+
runningProcess: matchingCandidate?.detail,
|
|
387
|
+
hasRunningProcess: !!matchingCandidate,
|
|
388
|
+
pid: matchingCandidate?.pid,
|
|
389
|
+
privacy: tunnel.privacy,
|
|
390
|
+
source: UserTunnelSource,
|
|
391
|
+
});
|
|
392
|
+
}
|
|
393
|
+
await this.storeForwarded();
|
|
394
|
+
this.remoteTunnels.set(key, tunnel);
|
|
395
|
+
this._onForwardPort.fire(this.forwarded.get(key));
|
|
396
|
+
}));
|
|
397
|
+
this._register(this.tunnelService.onTunnelClosed(address => {
|
|
398
|
+
return this.onTunnelClosed(address, TunnelCloseReason.Other);
|
|
399
|
+
}));
|
|
400
|
+
this.checkExtensionActivationEvents();
|
|
401
|
+
}
|
|
402
|
+
extensionHasActivationEvent() {
|
|
403
|
+
if (this.extensionService.extensions.find(extension => extension.activationEvents?.includes(ACTIVATION_EVENT))) {
|
|
404
|
+
this.contextKeyService.createKey(forwardedPortsViewEnabled.key, true);
|
|
405
|
+
return true;
|
|
406
|
+
}
|
|
407
|
+
return false;
|
|
408
|
+
}
|
|
409
|
+
checkExtensionActivationEvents() {
|
|
410
|
+
if (this.extensionHasActivationEvent()) {
|
|
411
|
+
return;
|
|
412
|
+
}
|
|
413
|
+
const activationDisposable = this._register(this.extensionService.onDidRegisterExtensions(() => {
|
|
414
|
+
if (this.extensionHasActivationEvent()) {
|
|
415
|
+
activationDisposable.dispose();
|
|
416
|
+
}
|
|
417
|
+
}));
|
|
418
|
+
}
|
|
419
|
+
async onTunnelClosed(address, reason) {
|
|
420
|
+
const key = makeAddress(address.host, address.port);
|
|
421
|
+
if (( (this.forwarded.has(key)))) {
|
|
422
|
+
this.forwarded.delete(key);
|
|
423
|
+
await this.storeForwarded();
|
|
424
|
+
this._onClosePort.fire(address);
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
makeLocalUri(localAddress, attributes) {
|
|
428
|
+
if (localAddress.startsWith('http')) {
|
|
429
|
+
return (
|
|
430
|
+
(URI.parse(localAddress))
|
|
431
|
+
);
|
|
432
|
+
}
|
|
433
|
+
const protocol = attributes?.protocol ?? 'http';
|
|
434
|
+
return (
|
|
435
|
+
(URI.parse(`${protocol}://${localAddress}`))
|
|
436
|
+
);
|
|
437
|
+
}
|
|
438
|
+
async getStorageKey() {
|
|
439
|
+
const workspace = this.workspaceContextService.getWorkspace();
|
|
440
|
+
const workspaceHash = workspace.configuration ? hash(workspace.configuration.path) : (workspace.folders.length > 0 ? hash(workspace.folders[0].uri.path) : undefined);
|
|
441
|
+
if (workspaceHash === undefined) {
|
|
442
|
+
this.logService.debug('Could not get workspace hash for forwarded ports storage key.');
|
|
443
|
+
return undefined;
|
|
444
|
+
}
|
|
445
|
+
return `${TUNNELS_TO_RESTORE}.${this.environmentService.remoteAuthority}.${workspaceHash}`;
|
|
446
|
+
}
|
|
447
|
+
async getTunnelRestoreValue() {
|
|
448
|
+
const deprecatedValue = this.storageService.get(TUNNELS_TO_RESTORE, 1 );
|
|
449
|
+
if (deprecatedValue) {
|
|
450
|
+
this.storageService.remove(TUNNELS_TO_RESTORE, 1 );
|
|
451
|
+
await this.storeForwarded();
|
|
452
|
+
return deprecatedValue;
|
|
453
|
+
}
|
|
454
|
+
const storageKey = await this.getStorageKey();
|
|
455
|
+
if (!storageKey) {
|
|
456
|
+
return undefined;
|
|
457
|
+
}
|
|
458
|
+
return this.storageService.get(storageKey, 0 );
|
|
459
|
+
}
|
|
460
|
+
async restoreForwarded() {
|
|
461
|
+
if (this.configurationService.getValue('remote.restoreForwardedPorts')) {
|
|
462
|
+
const tunnelRestoreValue = await this.tunnelRestoreValue;
|
|
463
|
+
if (tunnelRestoreValue && (tunnelRestoreValue !== this.knownPortsRestoreValue)) {
|
|
464
|
+
const tunnels = JSON.parse(tunnelRestoreValue) ?? [];
|
|
465
|
+
this.logService.trace(`ForwardedPorts: (TunnelModel) restoring ports ${( ( tunnels.map(tunnel => tunnel.remotePort))).join(', ')}`);
|
|
466
|
+
for (const tunnel of tunnels) {
|
|
467
|
+
const alreadyForwarded = mapHasAddressLocalhostOrAllInterfaces(this.detected, tunnel.remoteHost, tunnel.remotePort);
|
|
468
|
+
if ((tunnel.source.source !== TunnelSource.Extension && !alreadyForwarded) || (tunnel.source.source === TunnelSource.Extension && alreadyForwarded)) {
|
|
469
|
+
await this.doForward({
|
|
470
|
+
remote: { host: tunnel.remoteHost, port: tunnel.remotePort },
|
|
471
|
+
local: tunnel.localPort,
|
|
472
|
+
name: tunnel.name,
|
|
473
|
+
privacy: tunnel.privacy,
|
|
474
|
+
elevateIfNeeded: true,
|
|
475
|
+
source: tunnel.source
|
|
476
|
+
});
|
|
477
|
+
}
|
|
478
|
+
else if (tunnel.source.source === TunnelSource.Extension && !alreadyForwarded) {
|
|
479
|
+
this.unrestoredExtensionTunnels.set(makeAddress(tunnel.remoteHost, tunnel.remotePort), tunnel);
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
this.restoreComplete = true;
|
|
485
|
+
this.onRestoreComplete.fire();
|
|
486
|
+
if (!this.restoreListener) {
|
|
487
|
+
const key = await this.getStorageKey();
|
|
488
|
+
this.restoreListener = this._register(( (new DisposableStore())));
|
|
489
|
+
this.restoreListener.add(this.storageService.onDidChangeValue(0 , undefined, this.restoreListener)(async (e) => {
|
|
490
|
+
if (e.key === key) {
|
|
491
|
+
this.tunnelRestoreValue = Promise.resolve(this.storageService.get(key, 0 ));
|
|
492
|
+
await this.restoreForwarded();
|
|
493
|
+
}
|
|
494
|
+
}));
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
async storeForwarded() {
|
|
498
|
+
if (this.configurationService.getValue('remote.restoreForwardedPorts')) {
|
|
499
|
+
const valueToStore = JSON.stringify(Array.from(( (this.forwarded.values()))));
|
|
500
|
+
if (valueToStore !== this.knownPortsRestoreValue) {
|
|
501
|
+
this.knownPortsRestoreValue = valueToStore;
|
|
502
|
+
const key = await this.getStorageKey();
|
|
503
|
+
if (key) {
|
|
504
|
+
this.storageService.store(key, this.knownPortsRestoreValue, 0 , 0 );
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
async showPortMismatchModalIfNeeded(tunnel, expectedLocal, attributes) {
|
|
510
|
+
if (!tunnel.tunnelLocalPort || !attributes?.requireLocalPort) {
|
|
511
|
+
return;
|
|
512
|
+
}
|
|
513
|
+
if (tunnel.tunnelLocalPort === expectedLocal) {
|
|
514
|
+
return;
|
|
515
|
+
}
|
|
516
|
+
const newCooldown = ( (new Date()));
|
|
517
|
+
if ((this.mismatchCooldown.getTime() + MISMATCH_LOCAL_PORT_COOLDOWN) > newCooldown.getTime()) {
|
|
518
|
+
return;
|
|
519
|
+
}
|
|
520
|
+
this.mismatchCooldown = newCooldown;
|
|
521
|
+
const mismatchString = ( (nls.localize(
|
|
522
|
+
'remote.localPortMismatch.single',
|
|
523
|
+
"Local port {0} could not be used for forwarding to remote port {1}.\n\nThis usually happens when there is already another process using local port {0}.\n\nPort number {2} has been used instead.",
|
|
524
|
+
expectedLocal,
|
|
525
|
+
tunnel.tunnelRemotePort,
|
|
526
|
+
tunnel.tunnelLocalPort
|
|
527
|
+
)));
|
|
528
|
+
return this.dialogService.info(mismatchString);
|
|
529
|
+
}
|
|
530
|
+
async forward(tunnelProperties, attributes) {
|
|
531
|
+
if (!this.restoreComplete && this.environmentService.remoteAuthority) {
|
|
532
|
+
await Event.toPromise(this.onRestoreComplete.event);
|
|
533
|
+
}
|
|
534
|
+
return this.doForward(tunnelProperties, attributes);
|
|
535
|
+
}
|
|
536
|
+
async doForward(tunnelProperties, attributes) {
|
|
537
|
+
await this.extensionService.activateByEvent(ACTIVATION_EVENT);
|
|
538
|
+
const existingTunnel = mapHasAddressLocalhostOrAllInterfaces(this.forwarded, tunnelProperties.remote.host, tunnelProperties.remote.port);
|
|
539
|
+
attributes = attributes ??
|
|
540
|
+
((attributes !== null)
|
|
541
|
+
? (await this.getAttributes([tunnelProperties.remote]))?.get(tunnelProperties.remote.port)
|
|
542
|
+
: undefined);
|
|
543
|
+
const localPort = (tunnelProperties.local !== undefined) ? tunnelProperties.local : tunnelProperties.remote.port;
|
|
544
|
+
let noTunnelValue;
|
|
545
|
+
if (!existingTunnel) {
|
|
546
|
+
const authority = this.environmentService.remoteAuthority;
|
|
547
|
+
const addressProvider = authority ? {
|
|
548
|
+
getAddress: async () => { return (await this.remoteAuthorityResolverService.resolveAuthority(authority)).authority; }
|
|
549
|
+
} : undefined;
|
|
550
|
+
const key = makeAddress(tunnelProperties.remote.host, tunnelProperties.remote.port);
|
|
551
|
+
this.inProgress.set(key, true);
|
|
552
|
+
tunnelProperties = this.mergeCachedAndUnrestoredProperties(key, tunnelProperties);
|
|
553
|
+
const tunnel = await this.tunnelService.openTunnel(addressProvider, tunnelProperties.remote.host, tunnelProperties.remote.port, undefined, localPort, (!tunnelProperties.elevateIfNeeded) ? attributes?.elevateIfNeeded : tunnelProperties.elevateIfNeeded, tunnelProperties.privacy, attributes?.protocol);
|
|
554
|
+
if (typeof tunnel === 'string') {
|
|
555
|
+
noTunnelValue = tunnel;
|
|
556
|
+
}
|
|
557
|
+
else if (tunnel && tunnel.localAddress) {
|
|
558
|
+
const matchingCandidate = mapHasAddressLocalhostOrAllInterfaces(this._candidates ?? ( (new Map())), tunnelProperties.remote.host, tunnelProperties.remote.port);
|
|
559
|
+
const protocol = (tunnel.protocol ?
|
|
560
|
+
((tunnel.protocol === TunnelProtocol.Https) ? TunnelProtocol.Https : TunnelProtocol.Http)
|
|
561
|
+
: (attributes?.protocol ?? TunnelProtocol.Http));
|
|
562
|
+
const newForward = {
|
|
563
|
+
remoteHost: tunnel.tunnelRemoteHost,
|
|
564
|
+
remotePort: tunnel.tunnelRemotePort,
|
|
565
|
+
localPort: tunnel.tunnelLocalPort,
|
|
566
|
+
name: attributes?.label ?? tunnelProperties.name,
|
|
567
|
+
closeable: true,
|
|
568
|
+
localAddress: tunnel.localAddress,
|
|
569
|
+
protocol,
|
|
570
|
+
localUri: await this.makeLocalUri(tunnel.localAddress, attributes),
|
|
571
|
+
runningProcess: matchingCandidate?.detail,
|
|
572
|
+
hasRunningProcess: !!matchingCandidate,
|
|
573
|
+
pid: matchingCandidate?.pid,
|
|
574
|
+
source: tunnelProperties.source ?? UserTunnelSource,
|
|
575
|
+
privacy: tunnel.privacy,
|
|
576
|
+
};
|
|
577
|
+
this.forwarded.set(key, newForward);
|
|
578
|
+
this.remoteTunnels.set(key, tunnel);
|
|
579
|
+
this.inProgress.delete(key);
|
|
580
|
+
await this.storeForwarded();
|
|
581
|
+
await this.showPortMismatchModalIfNeeded(tunnel, localPort, attributes);
|
|
582
|
+
this._onForwardPort.fire(newForward);
|
|
583
|
+
return tunnel;
|
|
584
|
+
}
|
|
585
|
+
this.inProgress.delete(key);
|
|
586
|
+
}
|
|
587
|
+
else {
|
|
588
|
+
return this.mergeAttributesIntoExistingTunnel(existingTunnel, tunnelProperties, attributes);
|
|
589
|
+
}
|
|
590
|
+
return noTunnelValue;
|
|
591
|
+
}
|
|
592
|
+
mergeCachedAndUnrestoredProperties(key, tunnelProperties) {
|
|
593
|
+
const map = ( (this.unrestoredExtensionTunnels.has(key))) ? this.unrestoredExtensionTunnels : (( (this.sessionCachedProperties.has(key))) ? this.sessionCachedProperties : undefined);
|
|
594
|
+
if (map) {
|
|
595
|
+
const updateProps = map.get(key);
|
|
596
|
+
map.delete(key);
|
|
597
|
+
if (updateProps) {
|
|
598
|
+
tunnelProperties.name = updateProps.name ?? tunnelProperties.name;
|
|
599
|
+
tunnelProperties.local = (('local' in updateProps) ? updateProps.local : (('localPort' in updateProps) ? updateProps.localPort : undefined)) ?? tunnelProperties.local;
|
|
600
|
+
tunnelProperties.privacy = updateProps.privacy ?? tunnelProperties.privacy;
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
return tunnelProperties;
|
|
604
|
+
}
|
|
605
|
+
async mergeAttributesIntoExistingTunnel(existingTunnel, tunnelProperties, attributes) {
|
|
606
|
+
const newName = attributes?.label ?? tunnelProperties.name;
|
|
607
|
+
let MergedAttributeAction;
|
|
608
|
+
( ((function(MergedAttributeAction) {
|
|
609
|
+
MergedAttributeAction[MergedAttributeAction["None"] = 0] = "None";
|
|
610
|
+
MergedAttributeAction[MergedAttributeAction["Fire"] = 1] = "Fire";
|
|
611
|
+
MergedAttributeAction[MergedAttributeAction["Reopen"] = 2] = "Reopen";
|
|
612
|
+
})(MergedAttributeAction || (MergedAttributeAction = {}))));
|
|
613
|
+
let mergedAction = MergedAttributeAction.None;
|
|
614
|
+
if (newName !== existingTunnel.name) {
|
|
615
|
+
existingTunnel.name = newName;
|
|
616
|
+
mergedAction = MergedAttributeAction.Fire;
|
|
617
|
+
}
|
|
618
|
+
if ((attributes?.protocol || (existingTunnel.protocol !== TunnelProtocol.Http)) && (attributes?.protocol !== existingTunnel.protocol)) {
|
|
619
|
+
tunnelProperties.source = existingTunnel.source;
|
|
620
|
+
mergedAction = MergedAttributeAction.Reopen;
|
|
621
|
+
}
|
|
622
|
+
if (tunnelProperties.privacy && (existingTunnel.privacy !== tunnelProperties.privacy)) {
|
|
623
|
+
mergedAction = MergedAttributeAction.Reopen;
|
|
624
|
+
}
|
|
625
|
+
switch (mergedAction) {
|
|
626
|
+
case MergedAttributeAction.Fire: {
|
|
627
|
+
this._onForwardPort.fire();
|
|
628
|
+
break;
|
|
629
|
+
}
|
|
630
|
+
case MergedAttributeAction.Reopen: {
|
|
631
|
+
await this.close(existingTunnel.remoteHost, existingTunnel.remotePort, TunnelCloseReason.User);
|
|
632
|
+
await this.doForward(tunnelProperties, attributes);
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
return mapHasAddressLocalhostOrAllInterfaces(this.remoteTunnels, tunnelProperties.remote.host, tunnelProperties.remote.port);
|
|
636
|
+
}
|
|
637
|
+
async name(host, port, name) {
|
|
638
|
+
const existingForwarded = mapHasAddressLocalhostOrAllInterfaces(this.forwarded, host, port);
|
|
639
|
+
const key = makeAddress(host, port);
|
|
640
|
+
if (existingForwarded) {
|
|
641
|
+
existingForwarded.name = name;
|
|
642
|
+
await this.storeForwarded();
|
|
643
|
+
this._onPortName.fire({ host, port });
|
|
644
|
+
return;
|
|
645
|
+
}
|
|
646
|
+
else if (( (this.detected.has(key)))) {
|
|
647
|
+
this.detected.get(key).name = name;
|
|
648
|
+
this._onPortName.fire({ host, port });
|
|
649
|
+
}
|
|
650
|
+
}
|
|
651
|
+
async close(host, port, reason) {
|
|
652
|
+
const key = makeAddress(host, port);
|
|
653
|
+
const oldTunnel = this.forwarded.get(key);
|
|
654
|
+
if ((reason === TunnelCloseReason.AutoForwardEnd) && oldTunnel && (oldTunnel.source.source === TunnelSource.Auto)) {
|
|
655
|
+
this.sessionCachedProperties.set(key, {
|
|
656
|
+
local: oldTunnel.localPort,
|
|
657
|
+
name: oldTunnel.name,
|
|
658
|
+
privacy: oldTunnel.privacy,
|
|
659
|
+
});
|
|
660
|
+
}
|
|
661
|
+
await this.tunnelService.closeTunnel(host, port);
|
|
662
|
+
return this.onTunnelClosed({ host, port }, reason);
|
|
663
|
+
}
|
|
664
|
+
address(host, port) {
|
|
665
|
+
const key = makeAddress(host, port);
|
|
666
|
+
return (this.forwarded.get(key) || this.detected.get(key))?.localAddress;
|
|
667
|
+
}
|
|
668
|
+
get environmentTunnelsSet() {
|
|
669
|
+
return this._environmentTunnelsSet;
|
|
670
|
+
}
|
|
671
|
+
addEnvironmentTunnels(tunnels) {
|
|
672
|
+
if (tunnels) {
|
|
673
|
+
for (const tunnel of tunnels) {
|
|
674
|
+
const matchingCandidate = mapHasAddressLocalhostOrAllInterfaces(this._candidates ?? ( (new Map())), tunnel.remoteAddress.host, tunnel.remoteAddress.port);
|
|
675
|
+
const localAddress = typeof tunnel.localAddress === 'string' ? tunnel.localAddress : makeAddress(tunnel.localAddress.host, tunnel.localAddress.port);
|
|
676
|
+
this.detected.set(makeAddress(tunnel.remoteAddress.host, tunnel.remoteAddress.port), {
|
|
677
|
+
remoteHost: tunnel.remoteAddress.host,
|
|
678
|
+
remotePort: tunnel.remoteAddress.port,
|
|
679
|
+
localAddress: localAddress,
|
|
680
|
+
protocol: TunnelProtocol.Http,
|
|
681
|
+
localUri: this.makeLocalUri(localAddress),
|
|
682
|
+
closeable: false,
|
|
683
|
+
runningProcess: matchingCandidate?.detail,
|
|
684
|
+
hasRunningProcess: !!matchingCandidate,
|
|
685
|
+
pid: matchingCandidate?.pid,
|
|
686
|
+
privacy: TunnelPrivacyId.ConstantPrivate,
|
|
687
|
+
source: {
|
|
688
|
+
source: TunnelSource.Extension,
|
|
689
|
+
description: ( (nls.localize('tunnel.staticallyForwarded', "Statically Forwarded")))
|
|
690
|
+
}
|
|
691
|
+
});
|
|
692
|
+
this.tunnelService.setEnvironmentTunnel(tunnel.remoteAddress.host, tunnel.remoteAddress.port, localAddress, TunnelPrivacyId.ConstantPrivate, TunnelProtocol.Http);
|
|
693
|
+
}
|
|
694
|
+
}
|
|
695
|
+
this._environmentTunnelsSet = true;
|
|
696
|
+
this._onEnvironmentTunnelsSet.fire();
|
|
697
|
+
this._onForwardPort.fire();
|
|
698
|
+
}
|
|
699
|
+
setCandidateFilter(filter) {
|
|
700
|
+
this._candidateFilter = filter;
|
|
701
|
+
}
|
|
702
|
+
async setCandidates(candidates) {
|
|
703
|
+
let processedCandidates = candidates;
|
|
704
|
+
if (this._candidateFilter) {
|
|
705
|
+
processedCandidates = await this._candidateFilter(candidates);
|
|
706
|
+
}
|
|
707
|
+
const removedCandidates = this.updateInResponseToCandidates(processedCandidates);
|
|
708
|
+
this.logService.trace(`ForwardedPorts: (TunnelModel) removed candidates ${( ( Array.from(( ( removedCandidates.values()))).map(candidate => candidate.port))).join(', ')}`);
|
|
709
|
+
this._onCandidatesChanged.fire(removedCandidates);
|
|
710
|
+
}
|
|
711
|
+
updateInResponseToCandidates(candidates) {
|
|
712
|
+
const removedCandidates = this._candidates ?? ( (new Map()));
|
|
713
|
+
const candidatesMap = ( (new Map()));
|
|
714
|
+
this._candidates = candidatesMap;
|
|
715
|
+
candidates.forEach(value => {
|
|
716
|
+
const addressKey = makeAddress(value.host, value.port);
|
|
717
|
+
candidatesMap.set(addressKey, {
|
|
718
|
+
host: value.host,
|
|
719
|
+
port: value.port,
|
|
720
|
+
detail: value.detail,
|
|
721
|
+
pid: value.pid
|
|
722
|
+
});
|
|
723
|
+
if (( (removedCandidates.has(addressKey)))) {
|
|
724
|
+
removedCandidates.delete(addressKey);
|
|
725
|
+
}
|
|
726
|
+
const forwardedValue = mapHasAddressLocalhostOrAllInterfaces(this.forwarded, value.host, value.port);
|
|
727
|
+
if (forwardedValue) {
|
|
728
|
+
forwardedValue.runningProcess = value.detail;
|
|
729
|
+
forwardedValue.hasRunningProcess = true;
|
|
730
|
+
forwardedValue.pid = value.pid;
|
|
731
|
+
}
|
|
732
|
+
});
|
|
733
|
+
removedCandidates.forEach((_value, key) => {
|
|
734
|
+
const parsedAddress = parseAddress(key);
|
|
735
|
+
if (!parsedAddress) {
|
|
736
|
+
return;
|
|
737
|
+
}
|
|
738
|
+
const forwardedValue = mapHasAddressLocalhostOrAllInterfaces(this.forwarded, parsedAddress.host, parsedAddress.port);
|
|
739
|
+
if (forwardedValue) {
|
|
740
|
+
forwardedValue.runningProcess = undefined;
|
|
741
|
+
forwardedValue.hasRunningProcess = false;
|
|
742
|
+
forwardedValue.pid = undefined;
|
|
743
|
+
}
|
|
744
|
+
const detectedValue = mapHasAddressLocalhostOrAllInterfaces(this.detected, parsedAddress.host, parsedAddress.port);
|
|
745
|
+
if (detectedValue) {
|
|
746
|
+
detectedValue.runningProcess = undefined;
|
|
747
|
+
detectedValue.hasRunningProcess = false;
|
|
748
|
+
detectedValue.pid = undefined;
|
|
749
|
+
}
|
|
750
|
+
});
|
|
751
|
+
return removedCandidates;
|
|
752
|
+
}
|
|
753
|
+
get candidates() {
|
|
754
|
+
return this._candidates ? Array.from(( (this._candidates.values()))) : [];
|
|
755
|
+
}
|
|
756
|
+
get candidatesOrUndefined() {
|
|
757
|
+
return this._candidates ? this.candidates : undefined;
|
|
758
|
+
}
|
|
759
|
+
async updateAttributes() {
|
|
760
|
+
const tunnels = Array.from(( (this.forwarded.values())));
|
|
761
|
+
const allAttributes = await this.getAttributes(( (tunnels.map(tunnel => {
|
|
762
|
+
return { port: tunnel.remotePort, host: tunnel.remoteHost };
|
|
763
|
+
}))), false);
|
|
764
|
+
if (!allAttributes) {
|
|
765
|
+
return;
|
|
766
|
+
}
|
|
767
|
+
for (const forwarded of tunnels) {
|
|
768
|
+
const attributes = allAttributes.get(forwarded.remotePort);
|
|
769
|
+
if ((attributes?.protocol || (forwarded.protocol !== TunnelProtocol.Http)) && (attributes?.protocol !== forwarded.protocol)) {
|
|
770
|
+
await this.doForward({
|
|
771
|
+
remote: { host: forwarded.remoteHost, port: forwarded.remotePort },
|
|
772
|
+
local: forwarded.localPort,
|
|
773
|
+
name: forwarded.name,
|
|
774
|
+
source: forwarded.source
|
|
775
|
+
}, attributes);
|
|
776
|
+
}
|
|
777
|
+
if (!attributes) {
|
|
778
|
+
continue;
|
|
779
|
+
}
|
|
780
|
+
if (attributes.label && attributes.label !== forwarded.name) {
|
|
781
|
+
await this.name(forwarded.remoteHost, forwarded.remotePort, attributes.label);
|
|
782
|
+
}
|
|
783
|
+
}
|
|
784
|
+
}
|
|
785
|
+
async getAttributes(forwardedPorts, checkProviders = true) {
|
|
786
|
+
const matchingCandidates = ( (new Map()));
|
|
787
|
+
const pidToPortsMapping = ( (new Map()));
|
|
788
|
+
forwardedPorts.forEach(forwardedPort => {
|
|
789
|
+
const matchingCandidate = mapHasAddressLocalhostOrAllInterfaces(this._candidates ?? ( (new Map())), LOCALHOST_ADDRESSES[0], forwardedPort.port) ?? forwardedPort;
|
|
790
|
+
if (matchingCandidate) {
|
|
791
|
+
matchingCandidates.set(forwardedPort.port, matchingCandidate);
|
|
792
|
+
const pid = isCandidatePort(matchingCandidate) ? matchingCandidate.pid : undefined;
|
|
793
|
+
if (!( (pidToPortsMapping.has(pid)))) {
|
|
794
|
+
pidToPortsMapping.set(pid, []);
|
|
795
|
+
}
|
|
796
|
+
pidToPortsMapping.get(pid)?.push(forwardedPort.port);
|
|
797
|
+
}
|
|
798
|
+
});
|
|
799
|
+
const configAttributes = ( (new Map()));
|
|
800
|
+
forwardedPorts.forEach(forwardedPort => {
|
|
801
|
+
const attributes = this.configPortsAttributes.getAttributes(forwardedPort.port, forwardedPort.host, matchingCandidates.get(forwardedPort.port)?.detail);
|
|
802
|
+
if (attributes) {
|
|
803
|
+
configAttributes.set(forwardedPort.port, attributes);
|
|
804
|
+
}
|
|
805
|
+
});
|
|
806
|
+
if ((this.portAttributesProviders.length === 0) || !checkProviders) {
|
|
807
|
+
return (configAttributes.size > 0) ? configAttributes : undefined;
|
|
808
|
+
}
|
|
809
|
+
const allProviderResults = await Promise.all(flatten(( (this.portAttributesProviders.map(provider => {
|
|
810
|
+
return (
|
|
811
|
+
(Array.from(pidToPortsMapping.entries()).map(entry => {
|
|
812
|
+
const portGroup = entry[1];
|
|
813
|
+
const matchingCandidate = matchingCandidates.get(portGroup[0]);
|
|
814
|
+
return provider.providePortAttributes(portGroup, matchingCandidate?.pid, matchingCandidate?.detail, ( (new CancellationTokenSource())).token);
|
|
815
|
+
}))
|
|
816
|
+
);
|
|
817
|
+
})))));
|
|
818
|
+
const providedAttributes = ( (new Map()));
|
|
819
|
+
allProviderResults.forEach(attributes => attributes.forEach(attribute => {
|
|
820
|
+
if (attribute) {
|
|
821
|
+
providedAttributes.set(attribute.port, attribute);
|
|
822
|
+
}
|
|
823
|
+
}));
|
|
824
|
+
if (!configAttributes && !providedAttributes) {
|
|
825
|
+
return undefined;
|
|
826
|
+
}
|
|
827
|
+
const mergedAttributes = ( (new Map()));
|
|
828
|
+
forwardedPorts.forEach(forwardedPorts => {
|
|
829
|
+
const config = configAttributes.get(forwardedPorts.port);
|
|
830
|
+
const provider = providedAttributes.get(forwardedPorts.port);
|
|
831
|
+
mergedAttributes.set(forwardedPorts.port, {
|
|
832
|
+
elevateIfNeeded: config?.elevateIfNeeded,
|
|
833
|
+
label: config?.label,
|
|
834
|
+
onAutoForward: config?.onAutoForward ?? PortsAttributes.providedActionToAction(provider?.autoForwardAction),
|
|
835
|
+
requireLocalPort: config?.requireLocalPort,
|
|
836
|
+
protocol: config?.protocol
|
|
837
|
+
});
|
|
838
|
+
});
|
|
839
|
+
return mergedAttributes;
|
|
840
|
+
}
|
|
841
|
+
addAttributesProvider(provider) {
|
|
842
|
+
this.portAttributesProviders.push(provider);
|
|
843
|
+
}
|
|
844
|
+
};
|
|
845
|
+
TunnelModel.__decorator = ( (__decorate([
|
|
846
|
+
debounce(1000)
|
|
847
|
+
], TunnelModel.prototype, "storeForwarded", null)));
|
|
848
|
+
TunnelModel = ( (__decorate([
|
|
849
|
+
( (__param(0, ITunnelService))),
|
|
850
|
+
( (__param(1, IStorageService))),
|
|
851
|
+
( (__param(2, IConfigurationService))),
|
|
852
|
+
( (__param(3, IWorkbenchEnvironmentService))),
|
|
853
|
+
( (__param(4, IRemoteAuthorityResolverService))),
|
|
854
|
+
( (__param(5, IWorkspaceContextService))),
|
|
855
|
+
( (__param(6, ILogService))),
|
|
856
|
+
( (__param(7, IDialogService))),
|
|
857
|
+
( (__param(8, IExtensionService))),
|
|
858
|
+
( (__param(9, IContextKeyService)))
|
|
859
|
+
], TunnelModel)));
|
|
860
|
+
export { ACTIVATION_EVENT, AutoTunnelSource, OnPortForward, PortsAttributes, TunnelCloseReason, TunnelModel, TunnelSource, UserTunnelSource, forwardedPortsViewEnabled, isCandidatePort, makeAddress, mapHasAddress, mapHasAddressLocalhostOrAllInterfaces, parseAddress };
|