Skip to content

Commit 9db572a

Browse files
authored
Icon theme JSON parsing changed in 1.96.0 (microsoft#236085)
* Icon theme JSON parsing changed in 1.96.0 * remove fontCharacter validation for now
1 parent bac4606 commit 9db572a

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

src/vs/workbench/services/themes/browser/fileIconThemeData.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { getParseErrorMessage } from '../../../../base/common/jsonErrorMessages.
1313
import { IStorageService, StorageScope, StorageTarget } from '../../../../platform/storage/common/storage.js';
1414
import { IExtensionResourceLoaderService } from '../../../../platform/extensionResourceLoader/common/extensionResourceLoader.js';
1515
import { ILanguageService } from '../../../../editor/common/languages/language.js';
16-
import { fontCharacterRegex, fontColorRegex, fontSizeRegex } from '../common/productIconThemeSchema.js';
16+
import { fontColorRegex, fontSizeRegex } from '../common/productIconThemeSchema.js';
1717
import * as css from '../../../../base/browser/cssValue.js';
1818
import { fileIconSelectorEscape } from '../../../../editor/common/services/getIconClasses.js';
1919

@@ -424,7 +424,7 @@ export class FileIconThemeLoader {
424424
if (definition.fontColor && definition.fontColor.match(fontColorRegex)) {
425425
body.push(css.inline`color: ${css.hexColorValue(definition.fontColor)};`);
426426
}
427-
if (definition.fontCharacter && definition.fontCharacter.match(fontCharacterRegex)) {
427+
if (definition.fontCharacter) {
428428
body.push(css.inline`content: ${css.stringValue(definition.fontCharacter)};`);
429429
}
430430
const fontSize = definition.fontSize ?? (definition.fontId ? fontSizes.get(definition.fontId) : undefined);

src/vs/workbench/services/themes/browser/productIconThemeData.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import * as Json from '../../../../base/common/json.js';
1111
import { ExtensionData, IThemeExtensionPoint, IWorkbenchProductIconTheme, ThemeSettingDefaults } from '../common/workbenchThemeService.js';
1212
import { getParseErrorMessage } from '../../../../base/common/jsonErrorMessages.js';
1313
import { IStorageService, StorageScope, StorageTarget } from '../../../../platform/storage/common/storage.js';
14-
import { fontIdRegex, fontWeightRegex, fontStyleRegex, fontFormatRegex, fontCharacterRegex } from '../common/productIconThemeSchema.js';
14+
import { fontIdRegex, fontWeightRegex, fontStyleRegex, fontFormatRegex } from '../common/productIconThemeSchema.js';
1515
import { isObject, isString } from '../../../../base/common/types.js';
1616
import { ILogService } from '../../../../platform/log/common/log.js';
1717
import { IconDefinition, getIconRegistry, IconContribution, IconFontDefinition, IconFontSource } from '../../../../platform/theme/common/iconRegistry.js';
@@ -245,7 +245,7 @@ function _loadProductIconThemeDocument(fileService: IExtensionResourceLoaderServ
245245

246246
for (const iconId in contentValue.iconDefinitions) {
247247
const definition = contentValue.iconDefinitions[iconId];
248-
if (isString(definition.fontCharacter) && definition.fontCharacter.match(fontCharacterRegex)) {
248+
if (isString(definition.fontCharacter)) {
249249
const fontId = definition.fontId ?? primaryFontId;
250250
const fontDefinition = sanitizedFonts.get(fontId);
251251
if (fontDefinition) {

src/vs/workbench/services/themes/common/iconExtensionPoint.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,6 @@ export class IconExtensionPoint {
106106
collector.warn(nls.localize('invalid.icons.default.fontPath.extension', "Expected `contributes.icons.default.fontPath` to have file extension 'woff', woff2' or 'ttf', is '{0}'.", fileExt));
107107
return;
108108
}
109-
if (!defaultIcon.fontCharacter.match(fontCharacterRegex)) {
110-
collector.warn(nls.localize('invalid.icons.default.fontCharacter', 'Expected `contributes.icons.default.fontCharacter` to consist of a single character or a \\ followed by a Unicode code points in hexadecimal.')); return;
111-
}
112109
const extensionLocation = extension.description.extensionLocation;
113110
const iconFontLocation = resources.joinPath(extensionLocation, defaultIcon.fontPath);
114111
const fontId = getFontId(extension.description, defaultIcon.fontPath);

0 commit comments

Comments
 (0)