@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
|
@@ -1,832 +1,21 @@
|
|
|
1
|
-
import { __decorate, __param } from '../../../../../../../external/tslib/tslib.es6.js';
|
|
2
|
-
import * as nls from 'monaco-editor/esm/vs/nls.js';
|
|
3
|
-
import { Emitter } from 'monaco-editor/esm/vs/base/common/event.js';
|
|
4
1
|
import { createDecorator } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
|
|
5
|
-
|
|
6
|
-
import { ProvidedOnAutoForward, isLocalhost, isAllInterfaces, TunnelProtocol, TunnelPrivacyId, LOCALHOST_ADDRESSES, ALL_INTERFACES_ADDRESSES, ITunnelService } from '../../../../platform/tunnel/common/tunnel.js';
|
|
7
|
-
import { Disposable } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
8
|
-
import { IConfigurationService } from 'monaco-editor/esm/vs/platform/configuration/common/configuration.js';
|
|
9
|
-
import { IRemoteAuthorityResolverService } from '../../../../platform/remote/common/remoteAuthorityResolver.js';
|
|
10
|
-
import { IWorkbenchEnvironmentService } from '../../environment/common/environmentService.js';
|
|
11
|
-
import { isString, isNumber, isObject } from 'monaco-editor/esm/vs/base/common/types.js';
|
|
12
|
-
import { IWorkspaceContextService } from 'monaco-editor/esm/vs/platform/workspace/common/workspace.js';
|
|
13
|
-
import { hash } from 'monaco-editor/esm/vs/base/common/hash.js';
|
|
14
|
-
import { ILogService } from 'monaco-editor/esm/vs/platform/log/common/log.js';
|
|
15
|
-
import { CancellationTokenSource } from 'monaco-editor/esm/vs/base/common/cancellation.js';
|
|
16
|
-
import { flatten } from 'monaco-editor/esm/vs/base/common/arrays.js';
|
|
17
|
-
import '../../../../../../../override/vs/platform/dialogs/common/dialogs.js';
|
|
18
|
-
import { URI } from 'monaco-editor/esm/vs/base/common/uri.js';
|
|
19
|
-
import { deepClone } from 'monaco-editor/esm/vs/base/common/objects.js';
|
|
20
|
-
import { debounce } from 'monaco-editor/esm/vs/base/common/decorators.js';
|
|
21
|
-
import { IDialogService } from '../../../../platform/dialogs/common/dialogs.js';
|
|
22
|
-
const IRemoteExplorerService = ( (createDecorator('remoteExplorerService')));
|
|
23
|
-
const TUNNELS_TO_RESTORE = 'remote.tunnels.toRestore';
|
|
2
|
+
const IRemoteExplorerService = ( createDecorator('remoteExplorerService'));
|
|
24
3
|
const TUNNEL_VIEW_ID = '~remote.forwardedPorts';
|
|
25
4
|
const PORT_AUTO_FORWARD_SETTING = 'remote.autoForwardPorts';
|
|
26
5
|
const PORT_AUTO_SOURCE_SETTING = 'remote.autoForwardPortsSource';
|
|
27
6
|
const PORT_AUTO_SOURCE_SETTING_OUTPUT = 'output';
|
|
28
7
|
var TunnelType;
|
|
29
|
-
( (
|
|
8
|
+
( (function(TunnelType) {
|
|
30
9
|
TunnelType["Candidate"] = "Candidate";
|
|
31
10
|
TunnelType["Detected"] = "Detected";
|
|
32
11
|
TunnelType["Forwarded"] = "Forwarded";
|
|
33
12
|
TunnelType["Add"] = "Add";
|
|
34
|
-
})(TunnelType || (TunnelType = {})))
|
|
35
|
-
var TunnelCloseReason;
|
|
36
|
-
( ((function(TunnelCloseReason) {
|
|
37
|
-
TunnelCloseReason["Other"] = "Other";
|
|
38
|
-
TunnelCloseReason["User"] = "User";
|
|
39
|
-
TunnelCloseReason["AutoForwardEnd"] = "AutoForwardEnd";
|
|
40
|
-
})(TunnelCloseReason || (TunnelCloseReason = {}))));
|
|
13
|
+
})(TunnelType || (TunnelType = {})));
|
|
41
14
|
var TunnelEditId;
|
|
42
|
-
( (
|
|
15
|
+
( (function(TunnelEditId) {
|
|
43
16
|
TunnelEditId[TunnelEditId["None"] = 0] = "None";
|
|
44
17
|
TunnelEditId[TunnelEditId["New"] = 1] = "New";
|
|
45
18
|
TunnelEditId[TunnelEditId["Label"] = 2] = "Label";
|
|
46
19
|
TunnelEditId[TunnelEditId["LocalPort"] = 3] = "LocalPort";
|
|
47
|
-
})(TunnelEditId || (TunnelEditId = {})))
|
|
48
|
-
|
|
49
|
-
( ((function(TunnelSource) {
|
|
50
|
-
TunnelSource[TunnelSource["User"] = 0] = "User";
|
|
51
|
-
TunnelSource[TunnelSource["Auto"] = 1] = "Auto";
|
|
52
|
-
TunnelSource[TunnelSource["Extension"] = 2] = "Extension";
|
|
53
|
-
})(TunnelSource || (TunnelSource = {}))));
|
|
54
|
-
const UserTunnelSource = {
|
|
55
|
-
source: TunnelSource.User,
|
|
56
|
-
description: ( (nls.localize('tunnel.source.user', "User Forwarded")))
|
|
57
|
-
};
|
|
58
|
-
const AutoTunnelSource = {
|
|
59
|
-
source: TunnelSource.Auto,
|
|
60
|
-
description: ( (nls.localize('tunnel.source.auto', "Auto Forwarded")))
|
|
61
|
-
};
|
|
62
|
-
function makeAddress(host, port) {
|
|
63
|
-
return host + ':' + port;
|
|
64
|
-
}
|
|
65
|
-
function parseAddress(address) {
|
|
66
|
-
const matches = address.match(/^([a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*:)?([0-9]+)$/);
|
|
67
|
-
if (!matches) {
|
|
68
|
-
return undefined;
|
|
69
|
-
}
|
|
70
|
-
return { host: matches[1]?.substring(0, matches[1].length - 1) || 'localhost', port: Number(matches[2]) };
|
|
71
|
-
}
|
|
72
|
-
function mapHasAddress(map, host, port) {
|
|
73
|
-
const initialAddress = map.get(makeAddress(host, port));
|
|
74
|
-
if (initialAddress) {
|
|
75
|
-
return initialAddress;
|
|
76
|
-
}
|
|
77
|
-
if (isLocalhost(host)) {
|
|
78
|
-
for (const testHost of LOCALHOST_ADDRESSES) {
|
|
79
|
-
const testAddress = makeAddress(testHost, port);
|
|
80
|
-
if (( (map.has(testAddress)))) {
|
|
81
|
-
return map.get(testAddress);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
else if (isAllInterfaces(host)) {
|
|
86
|
-
for (const testHost of ALL_INTERFACES_ADDRESSES) {
|
|
87
|
-
const testAddress = makeAddress(testHost, port);
|
|
88
|
-
if (( (map.has(testAddress)))) {
|
|
89
|
-
return map.get(testAddress);
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
return undefined;
|
|
94
|
-
}
|
|
95
|
-
function mapHasAddressLocalhostOrAllInterfaces(map, host, port) {
|
|
96
|
-
const originalAddress = mapHasAddress(map, host, port);
|
|
97
|
-
if (originalAddress) {
|
|
98
|
-
return originalAddress;
|
|
99
|
-
}
|
|
100
|
-
const otherHost = isAllInterfaces(host) ? 'localhost' : (isLocalhost(host) ? '0.0.0.0' : undefined);
|
|
101
|
-
if (otherHost) {
|
|
102
|
-
return mapHasAddress(map, otherHost, port);
|
|
103
|
-
}
|
|
104
|
-
return undefined;
|
|
105
|
-
}
|
|
106
|
-
var OnPortForward;
|
|
107
|
-
( ((function(OnPortForward) {
|
|
108
|
-
OnPortForward["Notify"] = "notify";
|
|
109
|
-
OnPortForward["OpenBrowser"] = "openBrowser";
|
|
110
|
-
OnPortForward["OpenBrowserOnce"] = "openBrowserOnce";
|
|
111
|
-
OnPortForward["OpenPreview"] = "openPreview";
|
|
112
|
-
OnPortForward["Silent"] = "silent";
|
|
113
|
-
OnPortForward["Ignore"] = "ignore";
|
|
114
|
-
})(OnPortForward || (OnPortForward = {}))));
|
|
115
|
-
class PortsAttributes extends Disposable {
|
|
116
|
-
static { this.SETTING = 'remote.portsAttributes'; }
|
|
117
|
-
static { this.DEFAULTS = 'remote.otherPortsAttributes'; }
|
|
118
|
-
static { this.RANGE = /^(\d+)\-(\d+)$/; }
|
|
119
|
-
static { this.HOST_AND_PORT = /^([a-z0-9\-]+):(\d{1,5})$/; }
|
|
120
|
-
constructor(configurationService) {
|
|
121
|
-
super();
|
|
122
|
-
this.configurationService = configurationService;
|
|
123
|
-
this.portsAttributes = [];
|
|
124
|
-
this._onDidChangeAttributes = ( (new Emitter()));
|
|
125
|
-
this.onDidChangeAttributes = this._onDidChangeAttributes.event;
|
|
126
|
-
this._register(configurationService.onDidChangeConfiguration(e => {
|
|
127
|
-
if (e.affectsConfiguration(PortsAttributes.SETTING) || e.affectsConfiguration(PortsAttributes.DEFAULTS)) {
|
|
128
|
-
this.updateAttributes();
|
|
129
|
-
}
|
|
130
|
-
}));
|
|
131
|
-
this.updateAttributes();
|
|
132
|
-
}
|
|
133
|
-
updateAttributes() {
|
|
134
|
-
this.portsAttributes = this.readSetting();
|
|
135
|
-
this._onDidChangeAttributes.fire();
|
|
136
|
-
}
|
|
137
|
-
getAttributes(port, host, commandLine) {
|
|
138
|
-
let index = this.findNextIndex(port, host, commandLine, this.portsAttributes, 0);
|
|
139
|
-
const attributes = {
|
|
140
|
-
label: undefined,
|
|
141
|
-
onAutoForward: undefined,
|
|
142
|
-
elevateIfNeeded: undefined,
|
|
143
|
-
requireLocalPort: undefined,
|
|
144
|
-
protocol: undefined
|
|
145
|
-
};
|
|
146
|
-
while (index >= 0) {
|
|
147
|
-
const found = this.portsAttributes[index];
|
|
148
|
-
if (found.key === port) {
|
|
149
|
-
attributes.onAutoForward = found.onAutoForward ?? attributes.onAutoForward;
|
|
150
|
-
attributes.elevateIfNeeded = (found.elevateIfNeeded !== undefined) ? found.elevateIfNeeded : attributes.elevateIfNeeded;
|
|
151
|
-
attributes.label = found.label ?? attributes.label;
|
|
152
|
-
attributes.requireLocalPort = found.requireLocalPort;
|
|
153
|
-
attributes.protocol = found.protocol;
|
|
154
|
-
}
|
|
155
|
-
else {
|
|
156
|
-
attributes.onAutoForward = attributes.onAutoForward ?? found.onAutoForward;
|
|
157
|
-
attributes.elevateIfNeeded = (attributes.elevateIfNeeded !== undefined) ? attributes.elevateIfNeeded : found.elevateIfNeeded;
|
|
158
|
-
attributes.label = attributes.label ?? found.label;
|
|
159
|
-
attributes.requireLocalPort = (attributes.requireLocalPort !== undefined) ? attributes.requireLocalPort : undefined;
|
|
160
|
-
attributes.protocol = attributes.protocol ?? found.protocol;
|
|
161
|
-
}
|
|
162
|
-
index = this.findNextIndex(port, host, commandLine, this.portsAttributes, index + 1);
|
|
163
|
-
}
|
|
164
|
-
if (attributes.onAutoForward !== undefined || attributes.elevateIfNeeded !== undefined
|
|
165
|
-
|| attributes.label !== undefined || attributes.requireLocalPort !== undefined
|
|
166
|
-
|| attributes.protocol !== undefined) {
|
|
167
|
-
return attributes;
|
|
168
|
-
}
|
|
169
|
-
return this.getOtherAttributes();
|
|
170
|
-
}
|
|
171
|
-
hasStartEnd(value) {
|
|
172
|
-
return (value.start !== undefined) && (value.end !== undefined);
|
|
173
|
-
}
|
|
174
|
-
hasHostAndPort(value) {
|
|
175
|
-
return (value.host !== undefined) && (value.port !== undefined)
|
|
176
|
-
&& isString(value.host) && isNumber(value.port);
|
|
177
|
-
}
|
|
178
|
-
findNextIndex(port, host, commandLine, attributes, fromIndex) {
|
|
179
|
-
if (fromIndex >= attributes.length) {
|
|
180
|
-
return -1;
|
|
181
|
-
}
|
|
182
|
-
const shouldUseHost = !isLocalhost(host) && !isAllInterfaces(host);
|
|
183
|
-
const sliced = attributes.slice(fromIndex);
|
|
184
|
-
const foundIndex = sliced.findIndex((value) => {
|
|
185
|
-
if (isNumber(value.key)) {
|
|
186
|
-
return shouldUseHost ? false : value.key === port;
|
|
187
|
-
}
|
|
188
|
-
else if (this.hasStartEnd(value.key)) {
|
|
189
|
-
return shouldUseHost ? false : (port >= value.key.start && port <= value.key.end);
|
|
190
|
-
}
|
|
191
|
-
else if (this.hasHostAndPort(value.key)) {
|
|
192
|
-
return (port === value.key.port) && (host === value.key.host);
|
|
193
|
-
}
|
|
194
|
-
else {
|
|
195
|
-
return commandLine ? value.key.test(commandLine) : false;
|
|
196
|
-
}
|
|
197
|
-
});
|
|
198
|
-
return foundIndex >= 0 ? foundIndex + fromIndex : -1;
|
|
199
|
-
}
|
|
200
|
-
readSetting() {
|
|
201
|
-
const settingValue = this.configurationService.getValue(PortsAttributes.SETTING);
|
|
202
|
-
if (!settingValue || !isObject(settingValue)) {
|
|
203
|
-
return [];
|
|
204
|
-
}
|
|
205
|
-
const attributes = [];
|
|
206
|
-
for (const attributesKey in settingValue) {
|
|
207
|
-
if (attributesKey === undefined) {
|
|
208
|
-
continue;
|
|
209
|
-
}
|
|
210
|
-
const setting = settingValue[attributesKey];
|
|
211
|
-
let key = undefined;
|
|
212
|
-
if (Number(attributesKey)) {
|
|
213
|
-
key = Number(attributesKey);
|
|
214
|
-
}
|
|
215
|
-
else if (isString(attributesKey)) {
|
|
216
|
-
if (PortsAttributes.RANGE.test(attributesKey)) {
|
|
217
|
-
const match = attributesKey.match(PortsAttributes.RANGE);
|
|
218
|
-
key = { start: Number(match[1]), end: Number(match[2]) };
|
|
219
|
-
}
|
|
220
|
-
else if (PortsAttributes.HOST_AND_PORT.test(attributesKey)) {
|
|
221
|
-
const match = attributesKey.match(PortsAttributes.HOST_AND_PORT);
|
|
222
|
-
key = { host: match[1], port: Number(match[2]) };
|
|
223
|
-
}
|
|
224
|
-
else {
|
|
225
|
-
let regTest = undefined;
|
|
226
|
-
try {
|
|
227
|
-
regTest = RegExp(attributesKey);
|
|
228
|
-
}
|
|
229
|
-
catch (e) {
|
|
230
|
-
}
|
|
231
|
-
if (regTest) {
|
|
232
|
-
key = regTest;
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
if (!key) {
|
|
237
|
-
continue;
|
|
238
|
-
}
|
|
239
|
-
attributes.push({
|
|
240
|
-
key: key,
|
|
241
|
-
elevateIfNeeded: setting.elevateIfNeeded,
|
|
242
|
-
onAutoForward: setting.onAutoForward,
|
|
243
|
-
label: setting.label,
|
|
244
|
-
requireLocalPort: setting.requireLocalPort,
|
|
245
|
-
protocol: setting.protocol
|
|
246
|
-
});
|
|
247
|
-
}
|
|
248
|
-
const defaults = this.configurationService.getValue(PortsAttributes.DEFAULTS);
|
|
249
|
-
if (defaults) {
|
|
250
|
-
this.defaultPortAttributes = {
|
|
251
|
-
elevateIfNeeded: defaults.elevateIfNeeded,
|
|
252
|
-
label: defaults.label,
|
|
253
|
-
onAutoForward: defaults.onAutoForward,
|
|
254
|
-
requireLocalPort: defaults.requireLocalPort,
|
|
255
|
-
protocol: defaults.protocol
|
|
256
|
-
};
|
|
257
|
-
}
|
|
258
|
-
return this.sortAttributes(attributes);
|
|
259
|
-
}
|
|
260
|
-
sortAttributes(attributes) {
|
|
261
|
-
function getVal(item, thisRef) {
|
|
262
|
-
if (isNumber(item.key)) {
|
|
263
|
-
return item.key;
|
|
264
|
-
}
|
|
265
|
-
else if (thisRef.hasStartEnd(item.key)) {
|
|
266
|
-
return item.key.start;
|
|
267
|
-
}
|
|
268
|
-
else if (thisRef.hasHostAndPort(item.key)) {
|
|
269
|
-
return item.key.port;
|
|
270
|
-
}
|
|
271
|
-
else {
|
|
272
|
-
return Number.MAX_VALUE;
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
return attributes.sort((a, b) => {
|
|
276
|
-
return getVal(a, this) - getVal(b, this);
|
|
277
|
-
});
|
|
278
|
-
}
|
|
279
|
-
getOtherAttributes() {
|
|
280
|
-
return this.defaultPortAttributes;
|
|
281
|
-
}
|
|
282
|
-
static providedActionToAction(providedAction) {
|
|
283
|
-
switch (providedAction) {
|
|
284
|
-
case ProvidedOnAutoForward.Notify: return OnPortForward.Notify;
|
|
285
|
-
case ProvidedOnAutoForward.OpenBrowser: return OnPortForward.OpenBrowser;
|
|
286
|
-
case ProvidedOnAutoForward.OpenBrowserOnce: return OnPortForward.OpenBrowserOnce;
|
|
287
|
-
case ProvidedOnAutoForward.OpenPreview: return OnPortForward.OpenPreview;
|
|
288
|
-
case ProvidedOnAutoForward.Silent: return OnPortForward.Silent;
|
|
289
|
-
case ProvidedOnAutoForward.Ignore: return OnPortForward.Ignore;
|
|
290
|
-
default: return undefined;
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
async addAttributes(port, attributes, target) {
|
|
294
|
-
const settingValue = this.configurationService.inspect(PortsAttributes.SETTING);
|
|
295
|
-
const remoteValue = settingValue.userRemoteValue;
|
|
296
|
-
let newRemoteValue;
|
|
297
|
-
if (!remoteValue || !isObject(remoteValue)) {
|
|
298
|
-
newRemoteValue = {};
|
|
299
|
-
}
|
|
300
|
-
else {
|
|
301
|
-
newRemoteValue = deepClone(remoteValue);
|
|
302
|
-
}
|
|
303
|
-
if (!newRemoteValue[`${port}`]) {
|
|
304
|
-
newRemoteValue[`${port}`] = {};
|
|
305
|
-
}
|
|
306
|
-
for (const attribute in attributes) {
|
|
307
|
-
newRemoteValue[`${port}`][attribute] = attributes[attribute];
|
|
308
|
-
}
|
|
309
|
-
return this.configurationService.updateValue(PortsAttributes.SETTING, newRemoteValue, target);
|
|
310
|
-
}
|
|
311
|
-
}
|
|
312
|
-
const MISMATCH_LOCAL_PORT_COOLDOWN = 10 * 1000;
|
|
313
|
-
let TunnelModel = class TunnelModel extends Disposable {
|
|
314
|
-
constructor(tunnelService, storageService, configurationService, environmentService, remoteAuthorityResolverService, workspaceContextService, logService, dialogService) {
|
|
315
|
-
super();
|
|
316
|
-
this.tunnelService = tunnelService;
|
|
317
|
-
this.storageService = storageService;
|
|
318
|
-
this.configurationService = configurationService;
|
|
319
|
-
this.environmentService = environmentService;
|
|
320
|
-
this.remoteAuthorityResolverService = remoteAuthorityResolverService;
|
|
321
|
-
this.workspaceContextService = workspaceContextService;
|
|
322
|
-
this.logService = logService;
|
|
323
|
-
this.dialogService = dialogService;
|
|
324
|
-
this.inProgress = ( (new Map()));
|
|
325
|
-
this._onForwardPort = ( (new Emitter()));
|
|
326
|
-
this.onForwardPort = this._onForwardPort.event;
|
|
327
|
-
this._onClosePort = ( (new Emitter()));
|
|
328
|
-
this.onClosePort = this._onClosePort.event;
|
|
329
|
-
this._onPortName = ( (new Emitter()));
|
|
330
|
-
this.onPortName = this._onPortName.event;
|
|
331
|
-
this._onCandidatesChanged = ( (new Emitter()));
|
|
332
|
-
this.onCandidatesChanged = this._onCandidatesChanged.event;
|
|
333
|
-
this._onEnvironmentTunnelsSet = ( (new Emitter()));
|
|
334
|
-
this.onEnvironmentTunnelsSet = this._onEnvironmentTunnelsSet.event;
|
|
335
|
-
this._environmentTunnelsSet = false;
|
|
336
|
-
this.unrestoredExtensionTunnels = ( (new Map()));
|
|
337
|
-
this.sessionCachedProperties = ( (new Map()));
|
|
338
|
-
this.portAttributesProviders = [];
|
|
339
|
-
this.mismatchCooldown = ( (new Date()));
|
|
340
|
-
this.configPortsAttributes = ( (new PortsAttributes(configurationService)));
|
|
341
|
-
this.tunnelRestoreValue = this.getTunnelRestoreValue();
|
|
342
|
-
this._register(this.configPortsAttributes.onDidChangeAttributes(this.updateAttributes, this));
|
|
343
|
-
this.forwarded = ( (new Map()));
|
|
344
|
-
this.remoteTunnels = ( (new Map()));
|
|
345
|
-
this.tunnelService.tunnels.then(async (tunnels) => {
|
|
346
|
-
const attributes = await this.getAttributes(( (tunnels.map(tunnel => {
|
|
347
|
-
return { port: tunnel.tunnelRemotePort, host: tunnel.tunnelRemoteHost };
|
|
348
|
-
}))));
|
|
349
|
-
for (const tunnel of tunnels) {
|
|
350
|
-
if (tunnel.localAddress) {
|
|
351
|
-
const key = makeAddress(tunnel.tunnelRemoteHost, tunnel.tunnelRemotePort);
|
|
352
|
-
const matchingCandidate = mapHasAddressLocalhostOrAllInterfaces(this._candidates ?? ( (new Map())), tunnel.tunnelRemoteHost, tunnel.tunnelRemotePort);
|
|
353
|
-
this.forwarded.set(key, {
|
|
354
|
-
remotePort: tunnel.tunnelRemotePort,
|
|
355
|
-
remoteHost: tunnel.tunnelRemoteHost,
|
|
356
|
-
localAddress: tunnel.localAddress,
|
|
357
|
-
protocol: attributes?.get(tunnel.tunnelRemotePort)?.protocol ?? TunnelProtocol.Http,
|
|
358
|
-
localUri: await this.makeLocalUri(tunnel.localAddress, attributes?.get(tunnel.tunnelRemotePort)),
|
|
359
|
-
localPort: tunnel.tunnelLocalPort,
|
|
360
|
-
runningProcess: matchingCandidate?.detail,
|
|
361
|
-
hasRunningProcess: !!matchingCandidate,
|
|
362
|
-
pid: matchingCandidate?.pid,
|
|
363
|
-
privacy: tunnel.privacy,
|
|
364
|
-
source: UserTunnelSource,
|
|
365
|
-
});
|
|
366
|
-
this.remoteTunnels.set(key, tunnel);
|
|
367
|
-
}
|
|
368
|
-
}
|
|
369
|
-
});
|
|
370
|
-
this.detected = ( (new Map()));
|
|
371
|
-
this._register(this.tunnelService.onTunnelOpened(async (tunnel) => {
|
|
372
|
-
const key = makeAddress(tunnel.tunnelRemoteHost, tunnel.tunnelRemotePort);
|
|
373
|
-
if (!mapHasAddressLocalhostOrAllInterfaces(this.forwarded, tunnel.tunnelRemoteHost, tunnel.tunnelRemotePort)
|
|
374
|
-
&& !mapHasAddressLocalhostOrAllInterfaces(this.detected, tunnel.tunnelRemoteHost, tunnel.tunnelRemotePort)
|
|
375
|
-
&& !mapHasAddressLocalhostOrAllInterfaces(this.inProgress, tunnel.tunnelRemoteHost, tunnel.tunnelRemotePort)
|
|
376
|
-
&& tunnel.localAddress) {
|
|
377
|
-
const matchingCandidate = mapHasAddressLocalhostOrAllInterfaces(this._candidates ?? ( (new Map())), tunnel.tunnelRemoteHost, tunnel.tunnelRemotePort);
|
|
378
|
-
const attributes = (await this.getAttributes([{ port: tunnel.tunnelRemotePort, host: tunnel.tunnelRemoteHost }]))?.get(tunnel.tunnelRemotePort);
|
|
379
|
-
this.forwarded.set(key, {
|
|
380
|
-
remoteHost: tunnel.tunnelRemoteHost,
|
|
381
|
-
remotePort: tunnel.tunnelRemotePort,
|
|
382
|
-
localAddress: tunnel.localAddress,
|
|
383
|
-
protocol: attributes?.protocol ?? TunnelProtocol.Http,
|
|
384
|
-
localUri: await this.makeLocalUri(tunnel.localAddress, attributes),
|
|
385
|
-
localPort: tunnel.tunnelLocalPort,
|
|
386
|
-
closeable: true,
|
|
387
|
-
runningProcess: matchingCandidate?.detail,
|
|
388
|
-
hasRunningProcess: !!matchingCandidate,
|
|
389
|
-
pid: matchingCandidate?.pid,
|
|
390
|
-
privacy: tunnel.privacy,
|
|
391
|
-
source: UserTunnelSource,
|
|
392
|
-
});
|
|
393
|
-
}
|
|
394
|
-
await this.storeForwarded();
|
|
395
|
-
this.remoteTunnels.set(key, tunnel);
|
|
396
|
-
this._onForwardPort.fire(this.forwarded.get(key));
|
|
397
|
-
}));
|
|
398
|
-
this._register(this.tunnelService.onTunnelClosed(address => {
|
|
399
|
-
return this.onTunnelClosed(address, TunnelCloseReason.Other);
|
|
400
|
-
}));
|
|
401
|
-
}
|
|
402
|
-
async onTunnelClosed(address, reason) {
|
|
403
|
-
const key = makeAddress(address.host, address.port);
|
|
404
|
-
if (( (this.forwarded.has(key)))) {
|
|
405
|
-
this.forwarded.delete(key);
|
|
406
|
-
await this.storeForwarded();
|
|
407
|
-
this._onClosePort.fire(address);
|
|
408
|
-
}
|
|
409
|
-
}
|
|
410
|
-
makeLocalUri(localAddress, attributes) {
|
|
411
|
-
if (localAddress.startsWith('http')) {
|
|
412
|
-
return (
|
|
413
|
-
(URI.parse(localAddress))
|
|
414
|
-
);
|
|
415
|
-
}
|
|
416
|
-
const protocol = attributes?.protocol ?? 'http';
|
|
417
|
-
return (
|
|
418
|
-
(URI.parse(`${protocol}://${localAddress}`))
|
|
419
|
-
);
|
|
420
|
-
}
|
|
421
|
-
async getStorageKey() {
|
|
422
|
-
const workspace = this.workspaceContextService.getWorkspace();
|
|
423
|
-
const workspaceHash = workspace.configuration ? hash(workspace.configuration.path) : (workspace.folders.length > 0 ? hash(workspace.folders[0].uri.path) : undefined);
|
|
424
|
-
if (workspaceHash === undefined) {
|
|
425
|
-
this.logService.debug('Could not get workspace hash for forwarded ports storage key.');
|
|
426
|
-
return undefined;
|
|
427
|
-
}
|
|
428
|
-
return `${TUNNELS_TO_RESTORE}.${this.environmentService.remoteAuthority}.${workspaceHash}`;
|
|
429
|
-
}
|
|
430
|
-
async getTunnelRestoreValue() {
|
|
431
|
-
const deprecatedValue = this.storageService.get(TUNNELS_TO_RESTORE, 1 );
|
|
432
|
-
if (deprecatedValue) {
|
|
433
|
-
this.storageService.remove(TUNNELS_TO_RESTORE, 1 );
|
|
434
|
-
await this.storeForwarded();
|
|
435
|
-
return deprecatedValue;
|
|
436
|
-
}
|
|
437
|
-
const storageKey = await this.getStorageKey();
|
|
438
|
-
if (!storageKey) {
|
|
439
|
-
return undefined;
|
|
440
|
-
}
|
|
441
|
-
return this.storageService.get(storageKey, 0 );
|
|
442
|
-
}
|
|
443
|
-
async restoreForwarded() {
|
|
444
|
-
if (this.configurationService.getValue('remote.restoreForwardedPorts')) {
|
|
445
|
-
const tunnelRestoreValue = await this.tunnelRestoreValue;
|
|
446
|
-
if (tunnelRestoreValue && (tunnelRestoreValue !== this.knownPortsRestoreValue)) {
|
|
447
|
-
const tunnels = JSON.parse(tunnelRestoreValue) ?? [];
|
|
448
|
-
this.logService.trace(`ForwardedPorts: (TunnelModel) restoring ports ${( ( tunnels.map(tunnel => tunnel.remotePort))).join(', ')}`);
|
|
449
|
-
for (const tunnel of tunnels) {
|
|
450
|
-
const alreadyForwarded = mapHasAddressLocalhostOrAllInterfaces(this.detected, tunnel.remoteHost, tunnel.remotePort);
|
|
451
|
-
if ((tunnel.source.source === TunnelSource.User && !alreadyForwarded) || (tunnel.source.source === TunnelSource.Extension && alreadyForwarded)) {
|
|
452
|
-
await this.forward({
|
|
453
|
-
remote: { host: tunnel.remoteHost, port: tunnel.remotePort },
|
|
454
|
-
local: tunnel.localPort,
|
|
455
|
-
name: tunnel.name,
|
|
456
|
-
privacy: tunnel.privacy,
|
|
457
|
-
elevateIfNeeded: true
|
|
458
|
-
});
|
|
459
|
-
}
|
|
460
|
-
else if (tunnel.source.source === TunnelSource.Extension && !alreadyForwarded) {
|
|
461
|
-
this.unrestoredExtensionTunnels.set(makeAddress(tunnel.remoteHost, tunnel.remotePort), tunnel);
|
|
462
|
-
}
|
|
463
|
-
}
|
|
464
|
-
}
|
|
465
|
-
}
|
|
466
|
-
if (!this.restoreListener) {
|
|
467
|
-
const key = await this.getStorageKey();
|
|
468
|
-
this.restoreListener = this._register(this.storageService.onDidChangeValue(async (e) => {
|
|
469
|
-
if (e.key === key) {
|
|
470
|
-
this.tunnelRestoreValue = Promise.resolve(this.storageService.get(key, 0 ));
|
|
471
|
-
await this.restoreForwarded();
|
|
472
|
-
}
|
|
473
|
-
}));
|
|
474
|
-
}
|
|
475
|
-
}
|
|
476
|
-
async storeForwarded() {
|
|
477
|
-
if (this.configurationService.getValue('remote.restoreForwardedPorts')) {
|
|
478
|
-
const valueToStore = JSON.stringify(Array.from(( (this.forwarded.values()))).filter(value => value.source.source !== TunnelSource.Auto));
|
|
479
|
-
if (valueToStore !== this.knownPortsRestoreValue) {
|
|
480
|
-
this.knownPortsRestoreValue = valueToStore;
|
|
481
|
-
const key = await this.getStorageKey();
|
|
482
|
-
if (key) {
|
|
483
|
-
this.storageService.store(key, this.knownPortsRestoreValue, 0 , 0 );
|
|
484
|
-
}
|
|
485
|
-
}
|
|
486
|
-
}
|
|
487
|
-
}
|
|
488
|
-
async showPortMismatchModalIfNeeded(tunnel, expectedLocal, attributes) {
|
|
489
|
-
if (!tunnel.tunnelLocalPort || !attributes?.requireLocalPort) {
|
|
490
|
-
return;
|
|
491
|
-
}
|
|
492
|
-
if (tunnel.tunnelLocalPort === expectedLocal) {
|
|
493
|
-
return;
|
|
494
|
-
}
|
|
495
|
-
const newCooldown = ( (new Date()));
|
|
496
|
-
if ((this.mismatchCooldown.getTime() + MISMATCH_LOCAL_PORT_COOLDOWN) > newCooldown.getTime()) {
|
|
497
|
-
return;
|
|
498
|
-
}
|
|
499
|
-
this.mismatchCooldown = newCooldown;
|
|
500
|
-
const mismatchString = ( (nls.localize(
|
|
501
|
-
'remote.localPortMismatch.single',
|
|
502
|
-
"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.",
|
|
503
|
-
expectedLocal,
|
|
504
|
-
tunnel.tunnelRemotePort,
|
|
505
|
-
tunnel.tunnelLocalPort
|
|
506
|
-
)));
|
|
507
|
-
return this.dialogService.info(mismatchString);
|
|
508
|
-
}
|
|
509
|
-
async forward(tunnelProperties, attributes) {
|
|
510
|
-
const existingTunnel = mapHasAddressLocalhostOrAllInterfaces(this.forwarded, tunnelProperties.remote.host, tunnelProperties.remote.port);
|
|
511
|
-
attributes = attributes ??
|
|
512
|
-
((attributes !== null)
|
|
513
|
-
? (await this.getAttributes([tunnelProperties.remote]))?.get(tunnelProperties.remote.port)
|
|
514
|
-
: undefined);
|
|
515
|
-
const localPort = (tunnelProperties.local !== undefined) ? tunnelProperties.local : tunnelProperties.remote.port;
|
|
516
|
-
if (!existingTunnel) {
|
|
517
|
-
const authority = this.environmentService.remoteAuthority;
|
|
518
|
-
const addressProvider = authority ? {
|
|
519
|
-
getAddress: async () => { return (await this.remoteAuthorityResolverService.resolveAuthority(authority)).authority; }
|
|
520
|
-
} : undefined;
|
|
521
|
-
const key = makeAddress(tunnelProperties.remote.host, tunnelProperties.remote.port);
|
|
522
|
-
this.inProgress.set(key, true);
|
|
523
|
-
tunnelProperties = this.mergeCachedAndUnrestoredProperties(key, tunnelProperties);
|
|
524
|
-
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);
|
|
525
|
-
if (tunnel && tunnel.localAddress) {
|
|
526
|
-
const matchingCandidate = mapHasAddressLocalhostOrAllInterfaces(this._candidates ?? ( (new Map())), tunnelProperties.remote.host, tunnelProperties.remote.port);
|
|
527
|
-
const protocol = (tunnel.protocol ?
|
|
528
|
-
((tunnel.protocol === TunnelProtocol.Https) ? TunnelProtocol.Https : TunnelProtocol.Http)
|
|
529
|
-
: (attributes?.protocol ?? TunnelProtocol.Http));
|
|
530
|
-
const newForward = {
|
|
531
|
-
remoteHost: tunnel.tunnelRemoteHost,
|
|
532
|
-
remotePort: tunnel.tunnelRemotePort,
|
|
533
|
-
localPort: tunnel.tunnelLocalPort,
|
|
534
|
-
name: attributes?.label ?? tunnelProperties.name,
|
|
535
|
-
closeable: true,
|
|
536
|
-
localAddress: tunnel.localAddress,
|
|
537
|
-
protocol,
|
|
538
|
-
localUri: await this.makeLocalUri(tunnel.localAddress, attributes),
|
|
539
|
-
runningProcess: matchingCandidate?.detail,
|
|
540
|
-
hasRunningProcess: !!matchingCandidate,
|
|
541
|
-
pid: matchingCandidate?.pid,
|
|
542
|
-
source: tunnelProperties.source ?? UserTunnelSource,
|
|
543
|
-
privacy: tunnel.privacy,
|
|
544
|
-
};
|
|
545
|
-
this.forwarded.set(key, newForward);
|
|
546
|
-
this.remoteTunnels.set(key, tunnel);
|
|
547
|
-
this.inProgress.delete(key);
|
|
548
|
-
await this.storeForwarded();
|
|
549
|
-
await this.showPortMismatchModalIfNeeded(tunnel, localPort, attributes);
|
|
550
|
-
this._onForwardPort.fire(newForward);
|
|
551
|
-
return tunnel;
|
|
552
|
-
}
|
|
553
|
-
this.inProgress.delete(key);
|
|
554
|
-
}
|
|
555
|
-
else {
|
|
556
|
-
return this.mergeAttributesIntoExistingTunnel(existingTunnel, tunnelProperties, attributes);
|
|
557
|
-
}
|
|
558
|
-
return undefined;
|
|
559
|
-
}
|
|
560
|
-
mergeCachedAndUnrestoredProperties(key, tunnelProperties) {
|
|
561
|
-
const map = ( (this.unrestoredExtensionTunnels.has(key))) ? this.unrestoredExtensionTunnels : (( (this.sessionCachedProperties.has(key))) ? this.sessionCachedProperties : undefined);
|
|
562
|
-
if (map) {
|
|
563
|
-
const updateProps = map.get(key);
|
|
564
|
-
map.delete(key);
|
|
565
|
-
if (updateProps) {
|
|
566
|
-
tunnelProperties.name = updateProps.name ?? tunnelProperties.name;
|
|
567
|
-
tunnelProperties.local = (('local' in updateProps) ? updateProps.local : (('localPort' in updateProps) ? updateProps.localPort : undefined)) ?? tunnelProperties.local;
|
|
568
|
-
tunnelProperties.privacy = updateProps.privacy ?? tunnelProperties.privacy;
|
|
569
|
-
}
|
|
570
|
-
}
|
|
571
|
-
return tunnelProperties;
|
|
572
|
-
}
|
|
573
|
-
async mergeAttributesIntoExistingTunnel(existingTunnel, tunnelProperties, attributes) {
|
|
574
|
-
const newName = attributes?.label ?? tunnelProperties.name;
|
|
575
|
-
let MergedAttributeAction;
|
|
576
|
-
( ((function(MergedAttributeAction) {
|
|
577
|
-
MergedAttributeAction[MergedAttributeAction["None"] = 0] = "None";
|
|
578
|
-
MergedAttributeAction[MergedAttributeAction["Fire"] = 1] = "Fire";
|
|
579
|
-
MergedAttributeAction[MergedAttributeAction["Reopen"] = 2] = "Reopen";
|
|
580
|
-
})(MergedAttributeAction || (MergedAttributeAction = {}))));
|
|
581
|
-
let mergedAction = MergedAttributeAction.None;
|
|
582
|
-
if (newName !== existingTunnel.name) {
|
|
583
|
-
existingTunnel.name = newName;
|
|
584
|
-
mergedAction = MergedAttributeAction.Fire;
|
|
585
|
-
}
|
|
586
|
-
if ((attributes?.protocol || (existingTunnel.protocol !== TunnelProtocol.Http)) && (attributes?.protocol !== existingTunnel.protocol)) {
|
|
587
|
-
tunnelProperties.source = existingTunnel.source;
|
|
588
|
-
mergedAction = MergedAttributeAction.Reopen;
|
|
589
|
-
}
|
|
590
|
-
if (tunnelProperties.privacy && (existingTunnel.privacy !== tunnelProperties.privacy)) {
|
|
591
|
-
mergedAction = MergedAttributeAction.Reopen;
|
|
592
|
-
}
|
|
593
|
-
switch (mergedAction) {
|
|
594
|
-
case MergedAttributeAction.Fire: {
|
|
595
|
-
this._onForwardPort.fire();
|
|
596
|
-
break;
|
|
597
|
-
}
|
|
598
|
-
case MergedAttributeAction.Reopen: {
|
|
599
|
-
await this.close(existingTunnel.remoteHost, existingTunnel.remotePort, TunnelCloseReason.User);
|
|
600
|
-
await this.forward(tunnelProperties, attributes);
|
|
601
|
-
}
|
|
602
|
-
}
|
|
603
|
-
return mapHasAddressLocalhostOrAllInterfaces(this.remoteTunnels, tunnelProperties.remote.host, tunnelProperties.remote.port);
|
|
604
|
-
}
|
|
605
|
-
async name(host, port, name) {
|
|
606
|
-
const existingForwarded = mapHasAddressLocalhostOrAllInterfaces(this.forwarded, host, port);
|
|
607
|
-
const key = makeAddress(host, port);
|
|
608
|
-
if (existingForwarded) {
|
|
609
|
-
existingForwarded.name = name;
|
|
610
|
-
await this.storeForwarded();
|
|
611
|
-
this._onPortName.fire({ host, port });
|
|
612
|
-
return;
|
|
613
|
-
}
|
|
614
|
-
else if (( (this.detected.has(key)))) {
|
|
615
|
-
this.detected.get(key).name = name;
|
|
616
|
-
this._onPortName.fire({ host, port });
|
|
617
|
-
}
|
|
618
|
-
}
|
|
619
|
-
async close(host, port, reason) {
|
|
620
|
-
const key = makeAddress(host, port);
|
|
621
|
-
const oldTunnel = this.forwarded.get(key);
|
|
622
|
-
if ((reason === TunnelCloseReason.AutoForwardEnd) && oldTunnel && (oldTunnel.source.source === TunnelSource.Auto)) {
|
|
623
|
-
this.sessionCachedProperties.set(key, {
|
|
624
|
-
local: oldTunnel.localPort,
|
|
625
|
-
name: oldTunnel.name,
|
|
626
|
-
privacy: oldTunnel.privacy,
|
|
627
|
-
});
|
|
628
|
-
}
|
|
629
|
-
await this.tunnelService.closeTunnel(host, port);
|
|
630
|
-
return this.onTunnelClosed({ host, port }, reason);
|
|
631
|
-
}
|
|
632
|
-
address(host, port) {
|
|
633
|
-
const key = makeAddress(host, port);
|
|
634
|
-
return (this.forwarded.get(key) || this.detected.get(key))?.localAddress;
|
|
635
|
-
}
|
|
636
|
-
get environmentTunnelsSet() {
|
|
637
|
-
return this._environmentTunnelsSet;
|
|
638
|
-
}
|
|
639
|
-
addEnvironmentTunnels(tunnels) {
|
|
640
|
-
if (tunnels) {
|
|
641
|
-
for (const tunnel of tunnels) {
|
|
642
|
-
const matchingCandidate = mapHasAddressLocalhostOrAllInterfaces(this._candidates ?? ( (new Map())), tunnel.remoteAddress.host, tunnel.remoteAddress.port);
|
|
643
|
-
const localAddress = typeof tunnel.localAddress === 'string' ? tunnel.localAddress : makeAddress(tunnel.localAddress.host, tunnel.localAddress.port);
|
|
644
|
-
this.detected.set(makeAddress(tunnel.remoteAddress.host, tunnel.remoteAddress.port), {
|
|
645
|
-
remoteHost: tunnel.remoteAddress.host,
|
|
646
|
-
remotePort: tunnel.remoteAddress.port,
|
|
647
|
-
localAddress: localAddress,
|
|
648
|
-
protocol: TunnelProtocol.Http,
|
|
649
|
-
localUri: this.makeLocalUri(localAddress),
|
|
650
|
-
closeable: false,
|
|
651
|
-
runningProcess: matchingCandidate?.detail,
|
|
652
|
-
hasRunningProcess: !!matchingCandidate,
|
|
653
|
-
pid: matchingCandidate?.pid,
|
|
654
|
-
privacy: TunnelPrivacyId.ConstantPrivate,
|
|
655
|
-
source: {
|
|
656
|
-
source: TunnelSource.Extension,
|
|
657
|
-
description: ( (nls.localize('tunnel.staticallyForwarded', "Statically Forwarded")))
|
|
658
|
-
}
|
|
659
|
-
});
|
|
660
|
-
this.tunnelService.setEnvironmentTunnel(tunnel.remoteAddress.host, tunnel.remoteAddress.port, localAddress, TunnelPrivacyId.ConstantPrivate, TunnelProtocol.Http);
|
|
661
|
-
}
|
|
662
|
-
}
|
|
663
|
-
this._environmentTunnelsSet = true;
|
|
664
|
-
this._onEnvironmentTunnelsSet.fire();
|
|
665
|
-
this._onForwardPort.fire();
|
|
666
|
-
}
|
|
667
|
-
setCandidateFilter(filter) {
|
|
668
|
-
this._candidateFilter = filter;
|
|
669
|
-
}
|
|
670
|
-
async setCandidates(candidates) {
|
|
671
|
-
let processedCandidates = candidates;
|
|
672
|
-
if (this._candidateFilter) {
|
|
673
|
-
processedCandidates = await this._candidateFilter(candidates);
|
|
674
|
-
}
|
|
675
|
-
const removedCandidates = this.updateInResponseToCandidates(processedCandidates);
|
|
676
|
-
this.logService.trace(`ForwardedPorts: (TunnelModel) removed candidates ${( ( Array.from(( ( removedCandidates.values()))).map(candidate => candidate.port))).join(', ')}`);
|
|
677
|
-
this._onCandidatesChanged.fire(removedCandidates);
|
|
678
|
-
}
|
|
679
|
-
updateInResponseToCandidates(candidates) {
|
|
680
|
-
const removedCandidates = this._candidates ?? ( (new Map()));
|
|
681
|
-
const candidatesMap = ( (new Map()));
|
|
682
|
-
this._candidates = candidatesMap;
|
|
683
|
-
candidates.forEach(value => {
|
|
684
|
-
const addressKey = makeAddress(value.host, value.port);
|
|
685
|
-
candidatesMap.set(addressKey, {
|
|
686
|
-
host: value.host,
|
|
687
|
-
port: value.port,
|
|
688
|
-
detail: value.detail,
|
|
689
|
-
pid: value.pid
|
|
690
|
-
});
|
|
691
|
-
if (( (removedCandidates.has(addressKey)))) {
|
|
692
|
-
removedCandidates.delete(addressKey);
|
|
693
|
-
}
|
|
694
|
-
const forwardedValue = mapHasAddressLocalhostOrAllInterfaces(this.forwarded, value.host, value.port);
|
|
695
|
-
if (forwardedValue) {
|
|
696
|
-
forwardedValue.runningProcess = value.detail;
|
|
697
|
-
forwardedValue.hasRunningProcess = true;
|
|
698
|
-
forwardedValue.pid = value.pid;
|
|
699
|
-
}
|
|
700
|
-
});
|
|
701
|
-
removedCandidates.forEach((_value, key) => {
|
|
702
|
-
const parsedAddress = parseAddress(key);
|
|
703
|
-
if (!parsedAddress) {
|
|
704
|
-
return;
|
|
705
|
-
}
|
|
706
|
-
const forwardedValue = mapHasAddressLocalhostOrAllInterfaces(this.forwarded, parsedAddress.host, parsedAddress.port);
|
|
707
|
-
if (forwardedValue) {
|
|
708
|
-
forwardedValue.runningProcess = undefined;
|
|
709
|
-
forwardedValue.hasRunningProcess = false;
|
|
710
|
-
forwardedValue.pid = undefined;
|
|
711
|
-
}
|
|
712
|
-
const detectedValue = mapHasAddressLocalhostOrAllInterfaces(this.detected, parsedAddress.host, parsedAddress.port);
|
|
713
|
-
if (detectedValue) {
|
|
714
|
-
detectedValue.runningProcess = undefined;
|
|
715
|
-
detectedValue.hasRunningProcess = false;
|
|
716
|
-
detectedValue.pid = undefined;
|
|
717
|
-
}
|
|
718
|
-
});
|
|
719
|
-
return removedCandidates;
|
|
720
|
-
}
|
|
721
|
-
get candidates() {
|
|
722
|
-
return this._candidates ? Array.from(( (this._candidates.values()))) : [];
|
|
723
|
-
}
|
|
724
|
-
get candidatesOrUndefined() {
|
|
725
|
-
return this._candidates ? this.candidates : undefined;
|
|
726
|
-
}
|
|
727
|
-
async updateAttributes() {
|
|
728
|
-
const tunnels = Array.from(( (this.forwarded.values())));
|
|
729
|
-
const allAttributes = await this.getAttributes(( (tunnels.map(tunnel => {
|
|
730
|
-
return { port: tunnel.remotePort, host: tunnel.remoteHost };
|
|
731
|
-
}))), false);
|
|
732
|
-
if (!allAttributes) {
|
|
733
|
-
return;
|
|
734
|
-
}
|
|
735
|
-
for (const forwarded of tunnels) {
|
|
736
|
-
const attributes = allAttributes.get(forwarded.remotePort);
|
|
737
|
-
if ((attributes?.protocol || (forwarded.protocol !== TunnelProtocol.Http)) && (attributes?.protocol !== forwarded.protocol)) {
|
|
738
|
-
await this.forward({
|
|
739
|
-
remote: { host: forwarded.remoteHost, port: forwarded.remotePort },
|
|
740
|
-
local: forwarded.localPort,
|
|
741
|
-
name: forwarded.name,
|
|
742
|
-
source: forwarded.source
|
|
743
|
-
}, attributes);
|
|
744
|
-
}
|
|
745
|
-
if (!attributes) {
|
|
746
|
-
continue;
|
|
747
|
-
}
|
|
748
|
-
if (attributes.label && attributes.label !== forwarded.name) {
|
|
749
|
-
await this.name(forwarded.remoteHost, forwarded.remotePort, attributes.label);
|
|
750
|
-
}
|
|
751
|
-
}
|
|
752
|
-
}
|
|
753
|
-
async getAttributes(forwardedPorts, checkProviders = true) {
|
|
754
|
-
const matchingCandidates = ( (new Map()));
|
|
755
|
-
const pidToPortsMapping = ( (new Map()));
|
|
756
|
-
forwardedPorts.forEach(forwardedPort => {
|
|
757
|
-
const matchingCandidate = mapHasAddressLocalhostOrAllInterfaces(this._candidates ?? ( (new Map())), LOCALHOST_ADDRESSES[0], forwardedPort.port) ?? forwardedPort;
|
|
758
|
-
if (matchingCandidate) {
|
|
759
|
-
matchingCandidates.set(forwardedPort.port, matchingCandidate);
|
|
760
|
-
const pid = isCandidatePort(matchingCandidate) ? matchingCandidate.pid : undefined;
|
|
761
|
-
if (!( (pidToPortsMapping.has(pid)))) {
|
|
762
|
-
pidToPortsMapping.set(pid, []);
|
|
763
|
-
}
|
|
764
|
-
pidToPortsMapping.get(pid)?.push(forwardedPort.port);
|
|
765
|
-
}
|
|
766
|
-
});
|
|
767
|
-
const configAttributes = ( (new Map()));
|
|
768
|
-
forwardedPorts.forEach(forwardedPort => {
|
|
769
|
-
const attributes = this.configPortsAttributes.getAttributes(forwardedPort.port, forwardedPort.host, matchingCandidates.get(forwardedPort.port)?.detail);
|
|
770
|
-
if (attributes) {
|
|
771
|
-
configAttributes.set(forwardedPort.port, attributes);
|
|
772
|
-
}
|
|
773
|
-
});
|
|
774
|
-
if ((this.portAttributesProviders.length === 0) || !checkProviders) {
|
|
775
|
-
return (configAttributes.size > 0) ? configAttributes : undefined;
|
|
776
|
-
}
|
|
777
|
-
const allProviderResults = await Promise.all(flatten(( (this.portAttributesProviders.map(provider => {
|
|
778
|
-
return (
|
|
779
|
-
(Array.from(pidToPortsMapping.entries()).map(entry => {
|
|
780
|
-
const portGroup = entry[1];
|
|
781
|
-
const matchingCandidate = matchingCandidates.get(portGroup[0]);
|
|
782
|
-
return provider.providePortAttributes(portGroup, matchingCandidate?.pid, matchingCandidate?.detail, ( (new CancellationTokenSource())).token);
|
|
783
|
-
}))
|
|
784
|
-
);
|
|
785
|
-
})))));
|
|
786
|
-
const providedAttributes = ( (new Map()));
|
|
787
|
-
allProviderResults.forEach(attributes => attributes.forEach(attribute => {
|
|
788
|
-
if (attribute) {
|
|
789
|
-
providedAttributes.set(attribute.port, attribute);
|
|
790
|
-
}
|
|
791
|
-
}));
|
|
792
|
-
if (!configAttributes && !providedAttributes) {
|
|
793
|
-
return undefined;
|
|
794
|
-
}
|
|
795
|
-
const mergedAttributes = ( (new Map()));
|
|
796
|
-
forwardedPorts.forEach(forwardedPorts => {
|
|
797
|
-
const config = configAttributes.get(forwardedPorts.port);
|
|
798
|
-
const provider = providedAttributes.get(forwardedPorts.port);
|
|
799
|
-
mergedAttributes.set(forwardedPorts.port, {
|
|
800
|
-
elevateIfNeeded: config?.elevateIfNeeded,
|
|
801
|
-
label: config?.label,
|
|
802
|
-
onAutoForward: config?.onAutoForward ?? PortsAttributes.providedActionToAction(provider?.autoForwardAction),
|
|
803
|
-
requireLocalPort: config?.requireLocalPort,
|
|
804
|
-
protocol: config?.protocol
|
|
805
|
-
});
|
|
806
|
-
});
|
|
807
|
-
return mergedAttributes;
|
|
808
|
-
}
|
|
809
|
-
addAttributesProvider(provider) {
|
|
810
|
-
this.portAttributesProviders.push(provider);
|
|
811
|
-
}
|
|
812
|
-
};
|
|
813
|
-
TunnelModel.__decorator = ( (__decorate([
|
|
814
|
-
debounce(1000)
|
|
815
|
-
], TunnelModel.prototype, "storeForwarded", null)));
|
|
816
|
-
TunnelModel = ( (__decorate([
|
|
817
|
-
( (__param(0, ITunnelService))),
|
|
818
|
-
( (__param(1, IStorageService))),
|
|
819
|
-
( (__param(2, IConfigurationService))),
|
|
820
|
-
( (__param(3, IWorkbenchEnvironmentService))),
|
|
821
|
-
( (__param(4, IRemoteAuthorityResolverService))),
|
|
822
|
-
( (__param(5, IWorkspaceContextService))),
|
|
823
|
-
( (__param(6, ILogService))),
|
|
824
|
-
( (__param(7, IDialogService)))
|
|
825
|
-
], TunnelModel)));
|
|
826
|
-
function isCandidatePort(candidate) {
|
|
827
|
-
return candidate && 'host' in candidate && typeof candidate.host === 'string'
|
|
828
|
-
&& 'port' in candidate && typeof candidate.port === 'number'
|
|
829
|
-
&& (!('detail' in candidate) || typeof candidate.detail === 'string')
|
|
830
|
-
&& (!('pid' in candidate) || typeof candidate.pid === 'string');
|
|
831
|
-
}
|
|
832
|
-
export { AutoTunnelSource, IRemoteExplorerService, OnPortForward, PORT_AUTO_FORWARD_SETTING, PORT_AUTO_SOURCE_SETTING, PORT_AUTO_SOURCE_SETTING_OUTPUT, PortsAttributes, TUNNEL_VIEW_ID, TunnelCloseReason, TunnelEditId, TunnelModel, TunnelSource, TunnelType, UserTunnelSource, isCandidatePort, makeAddress, mapHasAddress, mapHasAddressLocalhostOrAllInterfaces, parseAddress };
|
|
20
|
+
})(TunnelEditId || (TunnelEditId = {})));
|
|
21
|
+
export { IRemoteExplorerService, PORT_AUTO_FORWARD_SETTING, PORT_AUTO_SOURCE_SETTING, PORT_AUTO_SOURCE_SETTING_OUTPUT, TUNNEL_VIEW_ID, TunnelEditId, TunnelType };
|