Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set port context #169535

Merged
merged 1 commit into from
Dec 19, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/vs/workbench/contrib/remote/browser/tunnelFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import { IOpenerService } from 'vs/platform/opener/common/opener';
import { URI } from 'vs/base/common/uri';
import { IRemoteExplorerService } from 'vs/workbench/services/remote/common/remoteExplorerService';
import { ILogService } from 'vs/platform/log/common/log';
import { forwardedPortsViewEnabled } from 'vs/workbench/contrib/remote/browser/tunnelView';
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';

export class TunnelFactoryContribution extends Disposable implements IWorkbenchContribution {

Expand All @@ -20,11 +22,14 @@ export class TunnelFactoryContribution extends Disposable implements IWorkbenchC
@IBrowserWorkbenchEnvironmentService environmentService: IBrowserWorkbenchEnvironmentService,
@IOpenerService private openerService: IOpenerService,
@IRemoteExplorerService remoteExplorerService: IRemoteExplorerService,
@ILogService logService: ILogService
@ILogService logService: ILogService,
@IContextKeyService contextKeyService: IContextKeyService
) {
super();
const tunnelFactory = environmentService.options?.tunnelProvider?.tunnelFactory;
if (tunnelFactory) {
// At this point we clearly want the ports view/features since we have a tunnel factory
contextKeyService.createKey(forwardedPortsViewEnabled.key, true);
let privacyOptions = environmentService.options?.tunnelProvider?.features?.privacyOptions ?? [];
if (environmentService.options?.tunnelProvider?.features?.public
&& (privacyOptions.length === 0)) {
Expand Down