Skip to content

Commit 7bdfb3a

Browse files
warn if vscode codicon moves outside expected range
Signed-off-by: Nikolas Komonen <[email protected]>
1 parent adbd6f0 commit 7bdfb3a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

scripts/build/generateIcons.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,10 @@ async function loadCodiconMappings(): Promise<Record<string, number | undefined>
203203
const mappings: Record<string, number | undefined> = {}
204204
for (const [k, v] of Object.entries(data)) {
205205
if (typeof k === 'string' && typeof v === 'number') {
206-
// Assumption in the 0XE000 range, verify in mapping.json if needed
206+
if (v < 0xe000 || v >= 0xf000) {
207+
// Will warn us if the codepoint moves outside the expected range
208+
throw new Error(`Codicon "${k}" has unexpected codepoint: ${v}`)
209+
}
207210
mappings[`vscode-${k}`] = v
208211
}
209212
}

0 commit comments

Comments
 (0)