Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Add project settings schema to schema_generator CLI (#44321)

Dan Greco005a85e57b14
diff --git a/Cargo.lock b/Cargo.lock
index 5b35991dfde..b9a9dee415d 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -14249,6 +14249,7 @@ dependencies = [
"schemars",
"serde",
"serde_json",
+ "settings",
"theme",
]
diff --git a/crates/schema_generator/Cargo.toml b/crates/schema_generator/Cargo.toml
index 865f76f4af9..b92298a3b41 100644
--- a/crates/schema_generator/Cargo.toml
+++ b/crates/schema_generator/Cargo.toml
@@ -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
diff --git a/crates/schema_generator/src/main.rs b/crates/schema_generator/src/main.rs
index a7e406a1a9c..a77060c54d1 100644
--- a/crates/schema_generator/src/main.rs
+++ b/crates/schema_generator/src/main.rs
@@ -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(())