src/vs/workbench/services/extensionManagement/electron-sandbox/nativeExtensionManagementService.ts/NativeExtensionManagementService/whenProfileChanged
class NativeExtensionManagementService:	private async whenProfileChanged(e: DidChangeUserDataProfileEvent): Promise<void> {
		const oldExtensions = await super.getInstalled(ExtensionType.User, e.previous.extensionsResource);
		if (e.preserveData) {
			const extensions: [ILocalExtension, Metadata | undefined][] = await Promise.all(oldExtensions
				.filter(e => !e.isApplicationScoped) /* remove application scoped extensions */
				.map(async e => ([e, await this.getMetadata(e)])));
			await this.extensionsProfileScannerService.addExtensionsToProfile(extensions, e.profile.extensionsResource!);
		} else {
			const newExtensions = await this.getInstalled(ExtensionType.User);
			const { added, removed } = delta(oldExtensions, newExtensions, (a, b) => compare(`${ExtensionIdentifier.toKey(a.identifier.id)}@${a.manifest.version}`, `${ExtensionIdentifier.toKey(b.identifier.id)}@${b.manifest.version}`));
			if (added.length || removed.length) {
				this._onDidChangeProfile.fire({ added, removed });
			}
		}
	}