mirror of
https://github.com/zed-industries/zed.git
synced 2026-07-10 00:13:29 +00:00
Add project settings schema to schema_generator CLI (#44321)
Release Notes: - Added project settings schema to the schema_generator CLI. This allows for exporting the project settings schema as JSON for use in other tools.
This commit is contained in:
parent
935a7cc310
commit
005a85e57b
3 changed files with 8 additions and 0 deletions
1
Cargo.lock
generated
1
Cargo.lock
generated
|
|
@ -14249,6 +14249,7 @@ dependencies = [
|
|||
"schemars",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"settings",
|
||||
"theme",
|
||||
]
|
||||
|
||||
|
|
|
|||
|
|
@ -15,4 +15,5 @@ env_logger.workspace = true
|
|||
schemars = { workspace = true, features = ["indexmap2"] }
|
||||
serde.workspace = true
|
||||
serde_json.workspace = true
|
||||
settings.workspace = true
|
||||
theme.workspace = true
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
use anyhow::Result;
|
||||
use clap::{Parser, ValueEnum};
|
||||
use schemars::schema_for;
|
||||
use settings::ProjectSettingsContent;
|
||||
use theme::{IconThemeFamilyContent, ThemeFamilyContent};
|
||||
|
||||
#[derive(Parser, Debug)]
|
||||
|
|
@ -14,6 +15,7 @@ pub struct Args {
|
|||
pub enum SchemaType {
|
||||
Theme,
|
||||
IconTheme,
|
||||
Project,
|
||||
}
|
||||
|
||||
fn main() -> Result<()> {
|
||||
|
|
@ -30,6 +32,10 @@ fn main() -> Result<()> {
|
|||
let schema = schema_for!(IconThemeFamilyContent);
|
||||
println!("{}", serde_json::to_string_pretty(&schema)?);
|
||||
}
|
||||
SchemaType::Project => {
|
||||
let schema = schema_for!(ProjectSettingsContent);
|
||||
println!("{}", serde_json::to_string_pretty(&schema)?);
|
||||
}
|
||||
}
|
||||
|
||||
Ok(())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue