From 80143b2571d664b01e031f6d4a353c959cd0ddc0 Mon Sep 17 00:00:00 2001 From: Marshall Bowers Date: Thu, 21 Dec 2023 22:45:29 -0500 Subject: [PATCH] =?UTF-8?q?Fix=20names=20for=20Ros=C3=A9=20Pine=20themes?= =?UTF-8?q?=20(#3771)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR fixes the names of the Rosé Pine themes. We want to keep the Unicode "é" in the theme name, both because this is the actual name of the theme, and also to maintain parity with Zed1. Release Notes: - N/A --- Cargo.lock | 7 +++++++ assets/themes/src/vscode/rose-pine/family.json | 8 ++++---- crates/theme2/src/themes/rose_pine.rs | 8 ++++---- crates/theme_importer/Cargo.toml | 1 + crates/theme_importer/src/main.rs | 3 ++- crates/theme_importer/src/vscode/converter.rs | 2 +- 6 files changed, 19 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 82cc00bf9e65188980161fce3567cf70cbadd406..f8d8c1cc0d16f1175a4c52a271ad6fa615b76743 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 3f7b149db8bf0e9e949214e526a755aaa0f60830..517b20c6529edaec43f90da8a91a02474c882428 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 828838530f4650cce4e468437927748784d3f997..a24c7ef80d5a530cff0e335f537f554506f3856e 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 4b8641faa47eefce6438fdca04a5a3cda80232bd..23a53053cecd76a151fd29152f86c1a73a15ac67 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 a02b1ca1149529d66298c8fc637389d1c2cebeb3..01ab1915718b45a5ff988a438ee9adf65e96301e 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 8ade4937311f25c93604e70122161a06771e2304..41534d0d0e29553ef4568bd03193f020afa2dc94 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,