src/vs/workbench/services/userDataProfile/common/extensionsProfile.ts/ExtensionsProfile/applyProfile
class ExtensionsProfile:	async applyProfile(content: string): Promise<void> {
		const profileExtensions: IProfileExtension[] = JSON.parse(content);
		const installedExtensions = await this.extensionManagementService.getInstalled();
		const extensionsToEnableOrDisable: { extension: ILocalExtension; enablementState: EnablementState }[] = [];
		const extensionsToInstall: IProfileExtension[] = [];
		for (const e of profileExtensions) {
			const installedExtension = installedExtensions.find(installed => areSameExtensions(installed.identifier, e.identifier));
			if (!installedExtension || installedExtension.preRelease !== e.preRelease) {
				extensionsToInstall.push(e);
			}
			if (installedExtension && this.extensionEnablementService.isEnabled(installedExtension) !== !e.disabled) {
				extensionsToEnableOrDisable.push({ extension: installedExtension, enablementState: e.disabled ? EnablementState.DisabledGlobally : EnablementState.EnabledGlobally });
			}
		}
		const extensionsToUninstall: ILocalExtension[] = installedExtensions.filter(extension => extension.type === ExtensionType.User && !profileExtensions.some(({ identifier }) => areSameExtensions(identifier, extension.identifier)));
		for (const { extension, enablementState } of extensionsToEnableOrDisable) {
			this.logService.trace(`Profile: Updating extension enablement...`, extension.identifier.id);
			await this.extensionEnablementService.setEnablement([extension], enablementState);
			this.logService.info(`Profile: Updated extension enablement`, extension.identifier.id);
		}
		if (extensionsToInstall.length) {
			const galleryExtensions = await this.extensionGalleryService.getExtensions(extensionsToInstall.map(e => ({ ...e.identifier, hasPreRelease: e.preRelease })), CancellationToken.None);
			await Promise.all(extensionsToInstall.map(async e => {
				const extension = galleryExtensions.find(galleryExtension => areSameExtensions(galleryExtension.identifier, e.identifier));
				if (!extension) {
					return;
				}
				if (await this.extensionManagementService.canInstall(extension)) {
					this.logService.trace(`Profile: Installing extension...`, e.identifier.id, extension.version);
					await this.extensionManagementService.installFromGallery(extension, { isMachineScoped: false, donotIncludePackAndDependencies: true, installPreReleaseVersion: e.preRelease } /* set isMachineScoped value to prevent install and sync dialog in web */);
					this.logService.info(`Profile: Installed extension.`, e.identifier.id, extension.version);
				} else {
					this.logService.info(`Profile: Skipped installing extension because it cannot be installed.`, extension.displayName || extension.identifier.id);
				}
			}));
		}
		if (extensionsToUninstall.length) {
			await Promise.all(extensionsToUninstall.map(e => this.extensionManagementService.uninstall(e)));
		}
	}