src/vs/workbench/contrib/remoteTunnel/electron-sandbox/remoteTunnel.contribution.ts/RemoteTunnelWorkbenchContribution/startTunnel
class RemoteTunnelWorkbenchContribution:	private async startTunnel(silent: boolean): Promise<ConnectionInfo | undefined> {
		if (this.#authenticationSessionId !== undefined && this.connectionInfo) {
			return this.connectionInfo;
		}

		const authenticationSession = await this.getAuthenticationSession(silent);
		if (authenticationSession === undefined) {
			return undefined;
		}

		return await this.progressService.withProgress(
			{
				location: silent ? ProgressLocation.Window : ProgressLocation.Notification,
				title: localize({ key: 'progress.title', comment: ['Only translate \'Starting remote tunnel\', do not change the format of the rest (markdown link format)'] }, "[Starting remote tunnel](command:{0})", RemoteTunnelCommandIds.showLog),
			},
			(progress: IProgress<IProgressStep>) => {
				return new Promise<ConnectionInfo | undefined>((s, e) => {
					let completed = false;
					const listener = this.remoteTunnelService.onDidChangeTunnelStatus(status => {
						switch (status.type) {
							case 'connecting':
								if (status.progress) {
									progress.report({ message: status.progress });
								}
								break;
							case 'connected':
								listener.dispose();
								completed = true;
								s(status.info);
								break;
							case 'disconnected':
								listener.dispose();
								completed = true;
								s(undefined);
								break;
						}
					});
					const token = authenticationSession.session.idToken ?? authenticationSession.session.accessToken;
					const account: IRemoteTunnelAccount = { token, providerId: authenticationSession.providerId, accountLabel: authenticationSession.session.account.label };
					this.remoteTunnelService.updateAccount(account).then(status => {
						if (!completed && (status.type === 'connected') || status.type === 'disconnected') {
							listener.dispose();
							s(status.type === 'connected' ? status.info : undefined);
						}
					});
				});
			}
		);
	}