mirror of
https://github.com/zed-industries/zed.git
synced 2024-11-07 20:39:04 +03:00
Make theme parsing more lenient (#7154)
This PR improves the theme parsing to be a bit more lenient, allowing things like comments and trailing commas in theme files. Release Notes: - N/A
This commit is contained in:
parent
7cb97e57f9
commit
8c8a5ad275
1
Cargo.lock
generated
1
Cargo.lock
generated
@ -8183,6 +8183,7 @@ dependencies = [
|
||||
"serde",
|
||||
"serde_derive",
|
||||
"serde_json",
|
||||
"serde_json_lenient",
|
||||
"serde_repr",
|
||||
"settings",
|
||||
"story",
|
||||
|
@ -120,6 +120,7 @@ schemars = "0.8"
|
||||
serde = { version = "1.0", features = ["derive", "rc"] }
|
||||
serde_derive = { version = "1.0", features = ["deserialize_in_place"] }
|
||||
serde_json = { version = "1.0", features = ["preserve_order", "raw_value"] }
|
||||
serde_json_lenient = { version = "0.1", features = ["preserve_order", "raw_value"] }
|
||||
serde_repr = "0.1"
|
||||
smallvec = { version = "1.6", features = ["union"] }
|
||||
smol = "1.2"
|
||||
|
@ -27,7 +27,7 @@ schemars.workspace = true
|
||||
serde.workspace = true
|
||||
serde_derive.workspace = true
|
||||
serde_json.workspace = true
|
||||
serde_json_lenient = {version = "0.1", features = ["preserve_order", "raw_value"] }
|
||||
serde_json_lenient.workspace = true
|
||||
smallvec.workspace = true
|
||||
toml.workspace = true
|
||||
tree-sitter-json = "*"
|
||||
|
@ -34,6 +34,7 @@ schemars = { workspace = true, features = ["indexmap"] }
|
||||
serde.workspace = true
|
||||
serde_derive.workspace = true
|
||||
serde_json.workspace = true
|
||||
serde_json_lenient.workspace = true
|
||||
serde_repr.workspace = true
|
||||
settings = { path = "../settings" }
|
||||
story = { path = "../story", optional = true }
|
||||
|
@ -259,7 +259,7 @@ impl ThemeRegistry {
|
||||
continue;
|
||||
};
|
||||
|
||||
let Some(theme) = serde_json::from_reader(reader).log_err() else {
|
||||
let Some(theme) = serde_json_lenient::from_reader(reader).log_err() else {
|
||||
continue;
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user