diff --git a/Cargo.lock b/Cargo.lock index 82cc00bf9e..f8d8c1cc0d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -306,6 +306,12 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "any_ascii" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea50b14b7a4b9343f8c627a7a53c52076482bd4bdad0a24fd3ec533ed616cc2c" + [[package]] name = "anyhow" version = "1.0.75" @@ -9836,6 +9842,7 @@ dependencies = [ name = "theme_importer" version = "0.1.0" dependencies = [ + "any_ascii", "anyhow", "clap 4.4.4", "convert_case 0.6.0", diff --git a/assets/themes/src/vscode/rose-pine/family.json b/assets/themes/src/vscode/rose-pine/family.json index 3f7b149db8..517b20c652 100644 --- a/assets/themes/src/vscode/rose-pine/family.json +++ b/assets/themes/src/vscode/rose-pine/family.json @@ -1,19 +1,19 @@ { - "name": "Rose Pine", + "name": "Rosé Pine", "author": "Rosé Pine", "themes": [ { - "name": "Rose Pine", + "name": "Rosé Pine", "file_name": "rose-pine.json", "appearance": "dark" }, { - "name": "Rose Pine Moon", + "name": "Rosé Pine Moon", "file_name": "rose-pine-moon.json", "appearance": "dark" }, { - "name": "Rose Pine Dawn", + "name": "Rosé Pine Dawn", "file_name": "rose-pine-dawn.json", "appearance": "light" } diff --git a/crates/theme2/src/themes/rose_pine.rs b/crates/theme2/src/themes/rose_pine.rs index 828838530f..a24c7ef80d 100644 --- a/crates/theme2/src/themes/rose_pine.rs +++ b/crates/theme2/src/themes/rose_pine.rs @@ -11,11 +11,11 @@ use crate::{ pub fn rose_pine() -> UserThemeFamily { UserThemeFamily { - name: "Rose Pine".into(), + name: "Rosé Pine".into(), author: "Rosé Pine".into(), themes: vec![ UserTheme { - name: "Rose Pine".into(), + name: "Rosé Pine".into(), appearance: Appearance::Dark, styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement { @@ -278,7 +278,7 @@ pub fn rose_pine() -> UserThemeFamily { }, }, UserTheme { - name: "Rose Pine Moon".into(), + name: "Rosé Pine Moon".into(), appearance: Appearance::Dark, styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement { @@ -541,7 +541,7 @@ pub fn rose_pine() -> UserThemeFamily { }, }, UserTheme { - name: "Rose Pine Dawn".into(), + name: "Rosé Pine Dawn".into(), appearance: Appearance::Light, styles: UserThemeStylesRefinement { colors: ThemeColorsRefinement { diff --git a/crates/theme_importer/Cargo.toml b/crates/theme_importer/Cargo.toml index 4b8641faa4..23a53053ce 100644 --- a/crates/theme_importer/Cargo.toml +++ b/crates/theme_importer/Cargo.toml @@ -7,6 +7,7 @@ publish = false # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] +any_ascii = "0.3.2" anyhow.workspace = true clap = { version = "4.4", features = ["derive"] } convert_case = "0.6.0" diff --git a/crates/theme_importer/src/main.rs b/crates/theme_importer/src/main.rs index a02b1ca114..01ab191571 100644 --- a/crates/theme_importer/src/main.rs +++ b/crates/theme_importer/src/main.rs @@ -9,6 +9,7 @@ use std::path::PathBuf; use std::process::Command; use std::str::FromStr; +use any_ascii::any_ascii; use anyhow::{anyhow, Context, Result}; use clap::Parser; use convert_case::{Case, Casing}; @@ -187,7 +188,7 @@ fn main() -> Result<()> { let mut theme_modules = Vec::new(); for theme_family in theme_families { - let theme_family_slug = theme_family.name.to_string().to_case(Case::Snake); + let theme_family_slug = any_ascii(&theme_family.name).to_case(Case::Snake); let mut output_file = File::create(themes_output_path.join(format!("{theme_family_slug}.rs")))?; diff --git a/crates/theme_importer/src/vscode/converter.rs b/crates/theme_importer/src/vscode/converter.rs index 8ade493731..41534d0d0e 100644 --- a/crates/theme_importer/src/vscode/converter.rs +++ b/crates/theme_importer/src/vscode/converter.rs @@ -56,7 +56,7 @@ impl VsCodeThemeConverter { let syntax_theme = self.convert_syntax_theme()?; Ok(UserTheme { - name: self.theme_metadata.name.into(), + name: self.theme_metadata.name, appearance, styles: UserThemeStylesRefinement { colors: theme_colors_refinements,