src/vs/workbench/services/userDataProfile/browser/userDataProfileImportExportService.ts/UserDataProfileImportExportService/importProfile
class UserDataProfileImportExportService:	async importProfile(uri: URI): Promise<void> {
		if (this.isProfileImportExportInProgressContextKey.get()) {
			this.notificationService.warn('Profile import/export already in progress.');
			return;
		}

		this.isProfileImportExportInProgressContextKey.set(true);
		const disposables = new DisposableStore();
		disposables.add(toDisposable(() => this.isProfileImportExportInProgressContextKey.set(false)));

		try {
			await this.progressService.withProgress({
				location: ProgressLocation.Window,
				title: localize('profiles.importing', "{0}: Importing...", PROFILES_CATEGORY.value),
			}, async progress => {
				const profileContent = await this.resolveProfileContent(uri);
				if (profileContent === null) {
					return;
				}

				let profileTemplate: IUserDataProfileTemplate = JSON.parse(profileContent);
				if (!isUserDataProfileTemplate(profileTemplate)) {
					throw new Error('Invalid profile content.');
				}
				const userDataProfileImportState = disposables.add(this.instantiationService.createInstance(UserDataProfileImportState, profileTemplate));

				const title = localize('import profile preview', "Import");

				if (!userDataProfileImportState.isEmpty()) {
					let importProfile = await this.selectProfileResources(
						userDataProfileImportState,
						localize('import title', "{0}: {1} ({2})", PROFILES_CATEGORY.value, title, profileTemplate.name),
						localize('import description', "Chose what to import")
					);

					if (importProfile === undefined) {
						return;
					}

					if (!importProfile) {
						importProfile = await this.showProfilePreviewView(`workbench.views.profiles.import.preview`, title, userDataProfileImportState);
					}

					if (!importProfile) {
						return;
					}
				}

				profileTemplate = await userDataProfileImportState.getProfileTemplateToImport();
				const profile = await this.getProfileToImport(profileTemplate);
				if (!profile) {
					return;
				}

				if (profileTemplate.settings) {
					await this.instantiationService.createInstance(SettingsResource).apply(profileTemplate.settings, profile);
				}
				if (profileTemplate.keybindings) {
					await this.instantiationService.createInstance(KeybindingsResource).apply(profileTemplate.keybindings, profile);
				}
				if (profileTemplate.tasks) {
					await this.instantiationService.createInstance(TasksResource).apply(profileTemplate.tasks, profile);
				}
				if (profileTemplate.snippets) {
					await this.instantiationService.createInstance(SnippetsResource).apply(profileTemplate.snippets, profile);
				}
				if (profileTemplate.globalState) {
					await this.instantiationService.createInstance(GlobalStateResource).apply(profileTemplate.globalState, profile);
				}
				if (profileTemplate.extensions) {
					await this.instantiationService.createInstance(ExtensionsResource).apply(profileTemplate.extensions, profile);
				}
				await this.userDataProfileManagementService.switchProfile(profile);

				this.notificationService.info(localize('imported profile', "Profile '{0}' is imported successfully.", profile.name));
			});
		} finally {
			disposables.dispose();
		}
	}