src/vs/workbench/services/userDataSync/browser/userDataSyncWorkbenchService.ts/UserDataSyncWorkbenchService/turnOnUsingCurrentAccount
class UserDataSyncWorkbenchService:	async turnOnUsingCurrentAccount(): Promise<void> {
		if (this.userDataSyncEnablementService.isEnabled()) {
			return;
		}

		if (this.userDataSyncService.status !== SyncStatus.Idle) {
			throw new Error('Cannot turn on sync while syncing');
		}

		if (this.accountStatus !== AccountStatus.Available) {
			throw new Error(localize('no account', "No account available"));
		}

		const turnOnSyncCancellationToken = this.turnOnSyncCancellationToken = new CancellationTokenSource();
		const disposable = isWeb ? Disposable.None : this.lifecycleService.onBeforeShutdown(e => e.veto((async () => {
			const result = await this.dialogService.confirm({
				type: 'warning',
				message: localize('sync in progress', "Settings Sync is being turned on. Would you like to cancel it?"),
				title: localize('settings sync', "Settings Sync"),
				primaryButton: localize({ key: 'yes', comment: ['&& denotes a mnemonic'] }, "&&Yes"),
				secondaryButton: localize({ key: 'no', comment: ['&& denotes a mnemonic'] }, "&&No"),
			});
			if (result.confirmed) {
				turnOnSyncCancellationToken.cancel();
			}
			return !result.confirmed;
		})(), 'veto.settingsSync'));
		try {
			await this.doTurnOnSync(turnOnSyncCancellationToken.token);
		} finally {
			disposable.dispose();
			this.turnOnSyncCancellationToken = undefined;
		}
		await this.userDataAutoSyncService.turnOn();

		if (this.userDataSyncStoreManagementService.userDataSyncStore?.canSwitch) {
			await this.synchroniseUserDataSyncStoreType();
		}

		this.notificationService.info(localize('sync turned on', "{0} is turned on", SYNC_TITLE));
	}