diff --git a/extensions/vscode-test-resolver/package.json b/extensions/vscode-test-resolver/package.json index d3368339ee7..12571d0dcb2 100644 --- a/extensions/vscode-test-resolver/package.json +++ b/extensions/vscode-test-resolver/package.json @@ -9,7 +9,9 @@ "engines": { "vscode": "^1.25.0" }, - "extensionKind": [ "ui" ], + "extensionKind": [ + "ui" + ], "scripts": { "compile": "node ./node_modules/vscode/bin/compile -watch -p ./", "vscode:prepublish": "node ../../node_modules/gulp/bin/gulp.js --gulpfile ../../build/gulpfile.extensions.js compile-extension:vscode-test-resolver" @@ -121,10 +123,13 @@ "description": "If set, connection is paused", "type": "boolean", "default": false + }, + "testresolver.supportPublicPorts": { + "description": "If set, the test resolver tunnel factory will support mock public ports. Forwarded ports will not actually be public. Requires reload.", + "type": "boolean", + "default": false } } } } - - } diff --git a/extensions/vscode-test-resolver/src/extension.ts b/extensions/vscode-test-resolver/src/extension.ts index b9506fe3abd..92aa3d3d9c9 100644 --- a/extensions/vscode-test-resolver/src/extension.ts +++ b/extensions/vscode-test-resolver/src/extension.ts @@ -216,7 +216,7 @@ export function activate(context: vscode.ExtensionContext) { }, (progress) => doResolve(_authority, progress)); }, tunnelFactory, - tunnelFeatures: { elevation: true, public: false }, + tunnelFeatures: { elevation: true, public: !!vscode.workspace.getConfiguration('testresolver').get('supportPublicPorts') }, showCandidatePort }); context.subscriptions.push(authorityResolverDisposable); @@ -358,7 +358,7 @@ async function tunnelFactory(tunnelOptions: vscode.TunnelOptions, tunnelCreation return { localAddress, remoteAddress: tunnelOptions.remoteAddress, - public: tunnelOptions.public, + public: !!vscode.workspace.getConfiguration('testresolver').get('supportPublicPorts') && tunnelOptions.public, onDidDispose: onDidDispose.event, dispose: () => { if (!isDisposed) {