Change:
<!-- Do Not Delete This! bugreporttemplate --<!-- Please read our Rules of Conduct: --<!-- Read our guide about submitting issues: --<!-- Search existing issues to avoid creating duplicates. --<!-- Test using the latest Insiders build to see if your issue has already been fixed: --<!-- Instead of creating your report here, use 'Report Issue' from the 'Help' menu in VS Code to pre-fill useful information. --<!-- Launch with to check. --Does this issue occur when all extensions are disabled?: No <!-- If you answered No above, use 'Help: Start Extension Bisect' from Command Palette to try to identify the cause. --<!-- Issues caused by an extension need to be reported directly to the extension publisher. The 'Help Report Issue' dialog can assist with this. --- VS Code Version: 1.64.0 OS Version: Windows 11 21H2 Steps to Reproduce: a window another window with and observe that product icon themes don't load immediately and you are shown the default ones for a short while. https://user- The video above contains an example of this issue happening. If it matters, I am using the Fluent Icons product icon theme.
Why does this have the feature request label? This is a bug.

Discussion:
import { Codicon, CSSIcon } from 'vs/base/common/codicons'; import { Emitter, Event } from 'vs/base/common/event'; import { IJSONSchema, IJSONSchemaMap } from 'vs/base/common/jsonSchema'; <ins> import { isString } from 'vs/base/common/types'; </ins> import { URI } from 'vs/base/common/uri'; import { localize } from 'vs/nls'; import { Extensions as JSONExtensions, IJSONContributionRegistry } from 'vs/platform/jsonschemas/common/jsonContributionRegistry';

readonly src: IconFontSource[]; } <ins> export namespace IconFontDefinition { export function toJSONObject(iconFont: IconFontDefinition): any { return { weight: iconFont.weight, style: iconFont.style, src: iconFont.src.map(s => ({ format: s.format, location: s.location.toString() })) }; } export function fromJSONObject(json: any): IconFontDefinition | undefined { const stringOrUndef = (s: any) => isString(s) ? s : undefined; if (json && Array.isArray(json.src) && json.src.every((s: any) => isString(s.format) && isString(s.location))) { return { weight: stringOrUndef(json.weight), style: stringOrUndef(json.style), src: json.src.map((s: any) => ({ format: s.format, location: URI.parse(s.location) })) }; } return undefined; } } </ins> export interface IconFontSource { readonly location: URI; readonly format: string;

import { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage'; import { DEFAULT_PRODUCT_ICON_THEME_SETTING_VALUE } from 'vs/workbench/services/themes/common/themeConfiguration'; import { fontIdRegex, fontWeightRegex, fontStyleRegex, fontFormatRegex } from 'vs/workbench/services/themes/common/productIconThemeSchema'; <del> import { isString } from 'vs/base/common/types'; </del> <ins> import { isObject, isString } from 'vs/base/common/types'; </ins> import { ILogService } from 'vs/platform/log/common/log'; import { IconDefinition, getIconRegistry, IconContribution, IconFontDefinition, IconFontSource } from 'vs/platform/theme/common/iconRegistry'; import { ThemeIcon } from 'vs/platform/theme/common/themeService';

break; } } <ins> const { iconDefinitions, iconFontDefinitions } = data; if (Array.isArray(iconDefinitions) && isObject(iconFontDefinitions)) { const restoredIconDefinitions = new Map<string, IconDefinition>(); for (const entry of iconDefinitions) { const { id, fontCharacter, fontId } = entry; if (isString(id) && isString(fontCharacter)) { if (isString(fontId)) { const iconFontDefinition = IconFontDefinition.fromJSONObject(iconFontDefinitions[fontId]); if (iconFontDefinition) { restoredIconDefinitions.set(id, { fontCharacter, font: { id: fontId, definition: iconFontDefinition } }); } } else { restoredIconDefinitions.set(id, { fontCharacter }); } } } theme.iconThemeDocument = { iconDefinitions: restoredIconDefinitions }; } </ins> return theme; } catch (e) { return undefined;

} toStorage(storageService: IStorageService) { <ins> const iconDefinitions = []; const iconFontDefinitions: { [id: string]: IconFontDefinition } = {}; for (const entry of this.iconThemeDocument.iconDefinitions.entries()) { const font = entry[1].font; iconDefinitions.push({ id: entry[0], fontCharacter: entry[1].fontCharacter, fontId: font?.id }); if (font && iconFontDefinitions[font.id] === undefined) { iconFontDefinitions[font.id] = IconFontDefinition.toJSONObject(font.definition); } } </ins> const data = JSON.stringify({ id: this.id, label: this.label,

styleSheetContent: this.styleSheetContent, watch: this.watch, extensionData: ExtensionData.toJSONObject(this.extensionData), <ins> iconDefinitions, iconFontDefinitions </ins> }); storageService.store(ProductIconThemeData.STORAGE_KEY, data, StorageScope.PROFILE, StorageTarget.MACHINE); }