Generating Theme Types
How to generate theme types:
Run a script
./script/build-theme-types
Types are generated in styles/src/types/zed.ts
How it works:
-
Rust types
The
crates/themecontains theme types. Crateschemarsused to generate a JSON schema from the theme structs. Every struct that represent theme type has a#[derive(JsonSchema)]attribute.Task lotaked at
crates/xtask/src/main.rsgenerates a JSON schema from the theme structs. -
TypeScript types
Script
npm run build-typesfromstylespackage generates TypeScript types from the JSON schema and saves them tostyles/src/types/zed.ts.