Skip to content

utils

Core utility class for theme data assembly and file output.

Orchestrates the three token sources — workbench colors, syntax tokens, and semantic tokens — into the shape expected by VS Code’s theme JSON format, then writes the results to disk.

Defined in: utils.ts:41

Assembles theme data from configuration and writes it to disk.

new Utils(): Utils

Utils

generate(darkPath, lightPath, data): Promise<void>

Defined in: utils.ts:49

Writes the dark and light theme JSON files to disk.

string

— Absolute path for the dark theme JSON file.

string

— Absolute path for the light theme JSON file.

Record<string, ThemeData>

— Assembled theme data containing dark and light variants.

Promise<void>

getThemeData(configuration, pkg_themes): Record<string, ThemeData>

Defined in: utils.ts:74

Assembles workbench colors, syntax tokens, and semantic tokens for all variants into the VS Code theme JSON shape.

Constructs the neutral palette prefix (${mode}-${temperature}-${contrast}) and passes it through to all token generators so neutral color lookups resolve correctly against the new three-part key structure.

Configuration

— The resolved user or default configuration.

PkgTheme[]

— Theme entries from package.json contributes.themes.

Record<string, ThemeData>

A ThemeData object keyed by variant ("dark" / "light").

isNewlyInstalled(): boolean

Defined in: utils.ts:99

Returns true on the first activation after a clean install.

Checks for the presence of a .flag file. Creates the file if absent.

boolean

A boolean indicating if this is a fresh installation.

writeFile(path, data): Promise<unknown>

Defined in: utils.ts:115

Serializes data as formatted JSON and writes it to path.

string

— Absolute path to the output file.

unknown

— Any JSON-serializable value.

Promise<unknown>

A promise that resolves to “Success” on completion.

Defined in: utils.ts:27

Shape of the assembled theme data written by the generate method. Contains one entry per variant keyed by "dark" and "light".

colors: ReturnType<typeof workbench>

Defined in: utils.ts:28

name: string

Defined in: utils.ts:29

semanticHighlighting: boolean

Defined in: utils.ts:30

semanticTokenColors: object

Defined in: utils.ts:31

class:python: any

class:typescript: any

class:typescriptreact: any

enum:typescript: any

enum:typescriptreact: any

enumMember:typescript: any

enumMember:typescriptreact: any

interface:typescript: any

interface:typescriptreact: any

intrinsic:python: any

macro:rust: any

memberOperatorOverload: any

module:python: any

namespace:rust: any

namespace:typescript: any

namespace:typescriptreact: any

operatorOverload: any

property.defaultLibrary:javascript: any

property.defaultLibrary:javascriptreact: any

property.defaultLibrary:typescript: any

property.defaultLibrary:typescriptreact: any

selfKeyword:rust: any

variable.defaultLibrary:javascript: any

variable.defaultLibrary:javascriptreact: any

variable.defaultLibrary:typescript: any

variable.defaultLibrary:typescriptreact: any

tokenColors: ({ name: string; scope: string; settings: { fontStyle?: undefined; foreground: any; }; } | { name: string; scope: string; settings: { fontStyle: string; foreground: any; }; } | { name: string; scope: string; settings: { fontStyle: string; foreground?: undefined; }; })[]

Defined in: utils.ts:32

type: string

Defined in: utils.ts:33