Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
theme_importer: Make VS Code theme parsing more lenient (#7292)
Marshall Bowers5360c0ea2853
diff --git a/Cargo.lock b/Cargo.lockindex b5751e0560d..6500eacea55 100644--- a/Cargo.lock+++ b/Cargo.lock@@ -3867,12 +3867,6 @@ dependencies = ["wasm-bindgen",]-[[package]]-name = "json_comments"-version = "0.2.2"-source = "registry+https://github.com/rust-lang/crates.io-index"-checksum = "9dbbfed4e59ba9750e15ba154fdfd9329cee16ff3df539c2666b70f58cc32105"-[[package]]name = "jwt"version = "0.16.0"@@ -8228,7 +8222,6 @@ dependencies = ["gpui","indexmap 1.9.3","indoc",- "json_comments","log","palette","pathfinder_color",@@ -8236,6 +8229,7 @@ dependencies = ["schemars","serde","serde_json",+ "serde_json_lenient","simplelog","strum","theme",diff --git a/crates/theme_importer/Cargo.toml b/crates/theme_importer/Cargo.tomlindex 2214af85c74..ddb9433f16d 100644--- a/crates/theme_importer/Cargo.toml+++ b/crates/theme_importer/Cargo.toml@@ -13,7 +13,6 @@ convert_case = "0.6.0"gpui = { path = "../gpui" }indexmap = { version = "1.6.2", features = ["serde"] }indoc.workspace = true-json_comments = "0.2.2"log.workspace = truepalette = { version = "0.7.3", default-features = false, features = ["std"] }pathfinder_color = "0.5"@@ -21,6 +20,7 @@ rust-embed.workspace = trueschemars = { workspace = true, features = ["indexmap"] }serde.workspace = trueserde_json.workspace = true+serde_json_lenient.workspace = truesimplelog = "0.9"strum = { version = "0.25.0", features = ["derive"] }theme = { path = "../theme" }diff --git a/crates/theme_importer/src/main.rs b/crates/theme_importer/src/main.rsindex a8cc8a1bdf7..c689d7f7f99 100644--- a/crates/theme_importer/src/main.rs+++ b/crates/theme_importer/src/main.rs@@ -9,7 +9,6 @@ use std::path::PathBuf;use anyhow::{Context, Result};use clap::{Parser, Subcommand};use indexmap::IndexMap;-use json_comments::StripComments;use log::LevelFilter;use schemars::schema_for;use serde::Deserialize;@@ -132,8 +131,7 @@ fn main() -> Result<()> {}};- let theme_without_comments = StripComments::new(theme_file);- let vscode_theme: VsCodeTheme = serde_json::from_reader(theme_without_comments)+ let vscode_theme: VsCodeTheme = serde_json_lenient::from_reader(theme_file).context(format!("failed to parse theme {theme_file_path:?}"))?;let theme_metadata = ThemeMetadata {