Path: blob/main/extensions/copilot/src/util/vs/base/common/codiconsUtil.ts
13405 views
//!!! DO NOT modify, this file was COPIED from 'microsoft/vscode'12/*---------------------------------------------------------------------------------------------3* Copyright (c) Microsoft Corporation. All rights reserved.4* Licensed under the MIT License. See License.txt in the project root for license information.5*--------------------------------------------------------------------------------------------*/6import { ThemeIcon } from './themables';7import { isString } from './types';8910const _codiconFontCharacters: { [id: string]: number } = Object.create(null);1112export function register(id: string, fontCharacter: number | string): ThemeIcon {13if (isString(fontCharacter)) {14const val = _codiconFontCharacters[fontCharacter];15if (val === undefined) {16throw new Error(`${id} references an unknown codicon: ${fontCharacter}`);17}18fontCharacter = val;19}20_codiconFontCharacters[id] = fontCharacter;21return { id };22}2324/**25* Only to be used by the iconRegistry.26*/27export function getCodiconFontCharacters(): { [id: string]: number } {28return _codiconFontCharacters;29}303132