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.
Classes
Section titled “Classes”Defined in: utils.ts:41
Assembles theme data from configuration and writes it to disk.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new Utils():
Utils
Returns
Section titled “Returns”Methods
Section titled “Methods”generate()
Section titled “generate()”generate(
darkPath,lightPath,data):Promise<void>
Defined in: utils.ts:49
Writes the dark and light theme JSON files to disk.
Parameters
Section titled “Parameters”darkPath
Section titled “darkPath”string
— Absolute path for the dark theme JSON file.
lightPath
Section titled “lightPath”string
— Absolute path for the light theme JSON file.
Record<string, ThemeData>
— Assembled theme data containing dark and light variants.
Returns
Section titled “Returns”Promise<void>
getThemeData()
Section titled “getThemeData()”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.
Parameters
Section titled “Parameters”configuration
Section titled “configuration”— The resolved user or default configuration.
pkg_themes
Section titled “pkg_themes”PkgTheme[]
— Theme entries from package.json
contributes.themes.
Returns
Section titled “Returns”Record<string, ThemeData>
A ThemeData object keyed by variant ("dark" /
"light").
isNewlyInstalled()
Section titled “isNewlyInstalled()”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.
Returns
Section titled “Returns”boolean
A boolean indicating if this is a fresh installation.
writeFile()
Section titled “writeFile()”writeFile(
path,data):Promise<unknown>
Defined in: utils.ts:115
Serializes data as formatted JSON and writes it to path.
Parameters
Section titled “Parameters”string
— Absolute path to the output file.
unknown
— Any JSON-serializable value.
Returns
Section titled “Returns”Promise<unknown>
A promise that resolves to “Success” on completion.
Interfaces
Section titled “Interfaces”ThemeData
Section titled “ThemeData”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".
Properties
Section titled “Properties”colors
Section titled “colors”colors:
ReturnType<typeofworkbench>
Defined in: utils.ts:28
name:
string
Defined in: utils.ts:29
semanticHighlighting
Section titled “semanticHighlighting”semanticHighlighting:
boolean
Defined in: utils.ts:30
semanticTokenColors
Section titled “semanticTokenColors”semanticTokenColors:
object
Defined in: utils.ts:31
class:python
Section titled “class:python”class:python:
any
class:typescript
Section titled “class:typescript”class:typescript:
any
class:typescriptreact
Section titled “class:typescriptreact”class:typescriptreact:
any
enum:typescript
Section titled “enum:typescript”enum:typescript:
any
enum:typescriptreact
Section titled “enum:typescriptreact”enum:typescriptreact:
any
enumMember:typescript
Section titled “enumMember:typescript”enumMember:typescript:
any
enumMember:typescriptreact
Section titled “enumMember:typescriptreact”enumMember:typescriptreact:
any
interface:typescript
Section titled “interface:typescript”interface:typescript:
any
interface:typescriptreact
Section titled “interface:typescriptreact”interface:typescriptreact:
any
intrinsic:python
Section titled “intrinsic:python”intrinsic:python:
any
macro:rust
Section titled “macro:rust”macro:rust:
any
memberOperatorOverload
Section titled “memberOperatorOverload”memberOperatorOverload:
any
module:python
Section titled “module:python”module:python:
any
namespace:rust
Section titled “namespace:rust”namespace:rust:
any
namespace:typescript
Section titled “namespace:typescript”namespace:typescript:
any
namespace:typescriptreact
Section titled “namespace:typescriptreact”namespace:typescriptreact:
any
operatorOverload
Section titled “operatorOverload”operatorOverload:
any
property.defaultLibrary:javascript
Section titled “property.defaultLibrary:javascript”property.defaultLibrary:javascript:
any
property.defaultLibrary:javascriptreact
Section titled “property.defaultLibrary:javascriptreact”property.defaultLibrary:javascriptreact:
any
property.defaultLibrary:typescript
Section titled “property.defaultLibrary:typescript”property.defaultLibrary:typescript:
any
property.defaultLibrary:typescriptreact
Section titled “property.defaultLibrary:typescriptreact”property.defaultLibrary:typescriptreact:
any
selfKeyword:rust
Section titled “selfKeyword:rust”selfKeyword:rust:
any
variable.defaultLibrary:javascript
Section titled “variable.defaultLibrary:javascript”variable.defaultLibrary:javascript:
any
variable.defaultLibrary:javascriptreact
Section titled “variable.defaultLibrary:javascriptreact”variable.defaultLibrary:javascriptreact:
any
variable.defaultLibrary:typescript
Section titled “variable.defaultLibrary:typescript”variable.defaultLibrary:typescript:
any
variable.defaultLibrary:typescriptreact
Section titled “variable.defaultLibrary:typescriptreact”variable.defaultLibrary:typescriptreact:
any
tokenColors
Section titled “tokenColors”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