command: showWindowLogActionId, }, async (progress) => { progress.report({ message: localize('Importing profile', "{0} ({1})...", title, profileTemplate.name) }); <del> const profile = await this.getProfileToImport(profileTemplate, temporaryProfile); if (!profile) { return undefined; } </del> <ins> return this.importAndSwitchWithProgress(profileTemplate, temporaryProfile, extensions, extensionsDisabled, message => progress.report({ message: `${title} (${profileTemplate.name}): ${message}` })); }); } </ins> <del> if (profileTemplate.settings) { progress.report({ message: localize('progress settings', "{0} ({1}): Applying Settings...", title, profileTemplate.name) }); await this.instantiationService.createInstance(SettingsResource).apply(profileTemplate.settings, profile); } if (profileTemplate.keybindings) { progress.report({ message: localize('progress keybindings', "{0} ({1}): Applying Keyboard Shortcuts...", title, profileTemplate.name) }); await this.instantiationService.createInstance(KeybindingsResource).apply(profileTemplate.keybindings, profile); } if (profileTemplate.tasks) { progress.report({ message: localize('progress tasks', "{0} ({1}): Applying Tasks...", title, profileTemplate.name) }); await this.instantiationService.createInstance(TasksResource).apply(profileTemplate.tasks, profile); } if (profileTemplate.snippets) { progress.report({ message: localize('progress snippets', "{0} ({1}): Applying Snippets...", title, profileTemplate.name) }); await this.instantiationService.createInstance(SnippetsResource).apply(profileTemplate.snippets, profile); } if (profileTemplate.globalState) { progress.report({ message: localize('progress global state', "{0} ({1}): Applying State...", title, profileTemplate.name) }); await this.instantiationService.createInstance(GlobalStateResource).apply(profileTemplate.globalState, profile); } if (profileTemplate.extensions && extensions) { progress.report({ message: localize('progress extensions', "{0} ({1}): Applying Extensions...", title, profileTemplate.name) }); await this.instantiationService.createInstance(ExtensionsResource, extensionsDisabled).apply(profileTemplate.extensions, profile); } </del> <ins> private async importAndSwitchWithProgress(profileTemplate: IUserDataProfileTemplate, temporaryProfile: boolean, extensions: boolean, extensionsDisabled: boolean, progress: (message: string) => void): Promise<IUserDataProfile | undefined> { const profile = await this.getProfileToImport(profileTemplate, temporaryProfile); if (!profile) { return undefined; } </ins> <del> progress.report({ message: localize('switching profile', "{0} ({1}): Applying...", title, profileTemplate.name) }); await this.userDataProfileManagementService.switchProfile(profile); return profile; }); </del> <ins> if (profileTemplate.settings) { progress(localize('progress settings', "Applying Settings...")); await this.instantiationService.createInstance(SettingsResource).apply(profileTemplate.settings, profile); } if (profileTemplate.keybindings) { progress(localize('progress keybindings', "{0}ying Keyboard Shortcuts...")); await this.instantiationService.createInstance(KeybindingsResource).apply(profileTemplate.keybindings, profile); } if (profileTemplate.tasks) { progress(localize('progress tasks', "Applying Tasks...")); await this.instantiationService.createInstance(TasksResource).apply(profileTemplate.tasks, profile); } if (profileTemplate.snippets) { progress(localize('progress snippets', "Applying Snippets...")); await this.instantiationService.createInstance(SnippetsResource).apply(profileTemplate.snippets, profile); } if (profileTemplate.globalState) { progress(localize('progress global state', "Applying State...")); await this.instantiationService.createInstance(GlobalStateResource).apply(profileTemplate.globalState, profile); } if (profileTemplate.extensions && extensions) { progress(localize('progress extensions', "Applying Extensions...")); await this.instantiationService.createInstance(ExtensionsResource, extensionsDisabled).apply(profileTemplate.extensions, profile); } progress(localize('switching profile', " Applying...")); await this.userDataProfileManagementService.switchProfile(profile); return profile; </ins> } private async resolveProfileContent(resource: URI): Promise<string | null> {