src/vs/workbench/services/userDataProfile/browser/globalStateResource.ts/GlobalStateResource/writeGlobalState
class GlobalStateResource:	private async writeGlobalState(globalState: IGlobalState, profile: IUserDataProfile): Promise<void> {
		const storageKeys = Object.keys(globalState.storage);
		if (storageKeys.length) {
			const updatedStorage = new Map<string, string | undefined>();
			const nonProfileKeys = [
				// Do not include application scope user target keys because they also include default profile user target keys
				...this.storageService.keys(StorageScope.APPLICATION, StorageTarget.MACHINE),
				...this.storageService.keys(StorageScope.WORKSPACE, StorageTarget.USER),
				...this.storageService.keys(StorageScope.WORKSPACE, StorageTarget.MACHINE),
			];
			for (const key of storageKeys) {
				if (nonProfileKeys.includes(key)) {
					this.logService.info(`Profile: Ignoring global state key '${key}' because it is not a profile key.`);
				} else {
					updatedStorage.set(key, globalState.storage[key]);
				}
			}
			await this.userDataProfileStorageService.updateStorageData(profile, updatedStorage, StorageTarget.USER);
		}
	}