From 2ef395470018e068147f92cc97f62a8d80fc13a9 Mon Sep 17 00:00:00 2001 From: Marshall Bowers Date: Fri, 8 Dec 2023 16:04:58 -0500 Subject: [PATCH 1/2] Fix function colors in Gruvbox themes --- crates/theme2/src/themes/gruvbox.rs | 12 ++++++------ crates/theme_importer/src/vscode/syntax.rs | 6 +++++- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/crates/theme2/src/themes/gruvbox.rs b/crates/theme2/src/themes/gruvbox.rs index 6d0851bbee..9e1a2d86e8 100644 --- a/crates/theme2/src/themes/gruvbox.rs +++ b/crates/theme2/src/themes/gruvbox.rs @@ -124,7 +124,7 @@ pub fn gruvbox() -> UserThemeFamily { ( "function".into(), UserHighlightStyle { - color: Some(rgba(0xfabd2fff).into()), + color: Some(rgba(0x8ec07cff).into()), ..Default::default() }, ), @@ -410,7 +410,7 @@ pub fn gruvbox() -> UserThemeFamily { ( "function".into(), UserHighlightStyle { - color: Some(rgba(0xfabd2fff).into()), + color: Some(rgba(0x8ec07cff).into()), ..Default::default() }, ), @@ -696,7 +696,7 @@ pub fn gruvbox() -> UserThemeFamily { ( "function".into(), UserHighlightStyle { - color: Some(rgba(0xfabd2fff).into()), + color: Some(rgba(0x8ec07cff).into()), ..Default::default() }, ), @@ -982,7 +982,7 @@ pub fn gruvbox() -> UserThemeFamily { ( "function".into(), UserHighlightStyle { - color: Some(rgba(0xb57614ff).into()), + color: Some(rgba(0x427b58ff).into()), ..Default::default() }, ), @@ -1268,7 +1268,7 @@ pub fn gruvbox() -> UserThemeFamily { ( "function".into(), UserHighlightStyle { - color: Some(rgba(0xb57614ff).into()), + color: Some(rgba(0x427b58ff).into()), ..Default::default() }, ), @@ -1554,7 +1554,7 @@ pub fn gruvbox() -> UserThemeFamily { ( "function".into(), UserHighlightStyle { - color: Some(rgba(0xb57614ff).into()), + color: Some(rgba(0x427b58ff).into()), ..Default::default() }, ), diff --git a/crates/theme_importer/src/vscode/syntax.rs b/crates/theme_importer/src/vscode/syntax.rs index f055fc3551..fb64048431 100644 --- a/crates/theme_importer/src/vscode/syntax.rs +++ b/crates/theme_importer/src/vscode/syntax.rs @@ -202,7 +202,11 @@ impl ZedSyntaxToken { "markup.bold markup.italic", ], ZedSyntaxToken::Enum => vec!["support.type.enum"], - ZedSyntaxToken::Function => vec!["entity.name.function", "variable.function"], + ZedSyntaxToken::Function => vec![ + "entity.function", + "entity.name.function", + "variable.function", + ], ZedSyntaxToken::Hint => vec![], ZedSyntaxToken::Keyword => vec![ "keyword", From 2517b1017b66af2321d0481214b7f4d009514d06 Mon Sep 17 00:00:00 2001 From: Marshall Bowers Date: Fri, 8 Dec 2023 16:35:54 -0500 Subject: [PATCH 2/2] Weight scope matches to improve results --- crates/theme2/src/themes/andromeda.rs | 4 +- crates/theme2/src/themes/ayu.rs | 30 +++++------ crates/theme2/src/themes/gruvbox.rs | 60 +++++++++++----------- crates/theme2/src/themes/night_owl.rs | 26 +++++++--- crates/theme2/src/themes/noctis.rs | 22 ++++---- crates/theme2/src/themes/nord.rs | 2 +- crates/theme2/src/themes/palenight.rs | 36 ++++++------- crates/theme2/src/themes/rose_pine.rs | 45 ++++++++-------- crates/theme2/src/themes/solarized.rs | 14 ++--- crates/theme2/src/themes/synthwave_84.rs | 3 +- crates/theme_importer/src/vscode/syntax.rs | 16 ++++-- 11 files changed, 141 insertions(+), 117 deletions(-) diff --git a/crates/theme2/src/themes/andromeda.rs b/crates/theme2/src/themes/andromeda.rs index 031dd51025..b71e02d0f5 100644 --- a/crates/theme2/src/themes/andromeda.rs +++ b/crates/theme2/src/themes/andromeda.rs @@ -198,7 +198,7 @@ pub fn andromeda() -> UserThemeFamily { ( "type".into(), UserHighlightStyle { - color: Some(rgba(0xee5d43ff).into()), + color: Some(rgba(0xffe66dff).into()), ..Default::default() }, ), @@ -404,7 +404,7 @@ pub fn andromeda() -> UserThemeFamily { ( "type".into(), UserHighlightStyle { - color: Some(rgba(0xee5d43ff).into()), + color: Some(rgba(0xffe66dff).into()), ..Default::default() }, ), diff --git a/crates/theme2/src/themes/ayu.rs b/crates/theme2/src/themes/ayu.rs index 1d6bb1634c..80f1280359 100644 --- a/crates/theme2/src/themes/ayu.rs +++ b/crates/theme2/src/themes/ayu.rs @@ -152,7 +152,7 @@ pub fn ayu() -> UserThemeFamily { ( "keyword".into(), UserHighlightStyle { - color: Some(rgba(0x55b4d4ff).into()), + color: Some(rgba(0xfa8d3eff).into()), ..Default::default() }, ), @@ -194,14 +194,14 @@ pub fn ayu() -> UserThemeFamily { ( "property".into(), UserHighlightStyle { - color: Some(rgba(0x55b4d4ff).into()), + color: Some(rgba(0xf07171ff).into()), ..Default::default() }, ), ( "punctuation".into(), UserHighlightStyle { - color: Some(rgba(0x55b4d480).into()), + color: Some(rgba(0x5c6166ff).into()), ..Default::default() }, ), @@ -229,7 +229,7 @@ pub fn ayu() -> UserThemeFamily { ( "punctuation.special".into(), UserHighlightStyle { - color: Some(rgba(0x55b4d480).into()), + color: Some(rgba(0x5c6166ff).into()), ..Default::default() }, ), @@ -306,7 +306,7 @@ pub fn ayu() -> UserThemeFamily { ( "variable.special".into(), UserHighlightStyle { - color: Some(rgba(0xf2ae49ff).into()), + color: Some(rgba(0xf07171ff).into()), ..Default::default() }, ), @@ -452,7 +452,7 @@ pub fn ayu() -> UserThemeFamily { ( "keyword".into(), UserHighlightStyle { - color: Some(rgba(0x5ccfe6ff).into()), + color: Some(rgba(0xffad66ff).into()), ..Default::default() }, ), @@ -494,14 +494,14 @@ pub fn ayu() -> UserThemeFamily { ( "property".into(), UserHighlightStyle { - color: Some(rgba(0x5ccfe6ff).into()), + color: Some(rgba(0xf28779ff).into()), ..Default::default() }, ), ( "punctuation".into(), UserHighlightStyle { - color: Some(rgba(0x5ccfe680).into()), + color: Some(rgba(0xcccac2ff).into()), ..Default::default() }, ), @@ -529,7 +529,7 @@ pub fn ayu() -> UserThemeFamily { ( "punctuation.special".into(), UserHighlightStyle { - color: Some(rgba(0x5ccfe680).into()), + color: Some(rgba(0xcccac2ff).into()), ..Default::default() }, ), @@ -606,7 +606,7 @@ pub fn ayu() -> UserThemeFamily { ( "variable.special".into(), UserHighlightStyle { - color: Some(rgba(0xffd173ff).into()), + color: Some(rgba(0xf28779ff).into()), ..Default::default() }, ), @@ -752,7 +752,7 @@ pub fn ayu() -> UserThemeFamily { ( "keyword".into(), UserHighlightStyle { - color: Some(rgba(0x39bae6ff).into()), + color: Some(rgba(0xff8f40ff).into()), ..Default::default() }, ), @@ -794,14 +794,14 @@ pub fn ayu() -> UserThemeFamily { ( "property".into(), UserHighlightStyle { - color: Some(rgba(0x39bae6ff).into()), + color: Some(rgba(0xf07178ff).into()), ..Default::default() }, ), ( "punctuation".into(), UserHighlightStyle { - color: Some(rgba(0x39bae680).into()), + color: Some(rgba(0xbfbdb6ff).into()), ..Default::default() }, ), @@ -829,7 +829,7 @@ pub fn ayu() -> UserThemeFamily { ( "punctuation.special".into(), UserHighlightStyle { - color: Some(rgba(0x39bae680).into()), + color: Some(rgba(0xbfbdb6ff).into()), ..Default::default() }, ), @@ -906,7 +906,7 @@ pub fn ayu() -> UserThemeFamily { ( "variable.special".into(), UserHighlightStyle { - color: Some(rgba(0xffb454ff).into()), + color: Some(rgba(0xf07178ff).into()), ..Default::default() }, ), diff --git a/crates/theme2/src/themes/gruvbox.rs b/crates/theme2/src/themes/gruvbox.rs index 9e1a2d86e8..cebca2a49c 100644 --- a/crates/theme2/src/themes/gruvbox.rs +++ b/crates/theme2/src/themes/gruvbox.rs @@ -187,35 +187,35 @@ pub fn gruvbox() -> UserThemeFamily { ( "punctuation".into(), UserHighlightStyle { - color: Some(rgba(0x83a598ff).into()), + color: Some(rgba(0xa89984ff).into()), ..Default::default() }, ), ( "punctuation.bracket".into(), UserHighlightStyle { - color: Some(rgba(0x83a598ff).into()), + color: Some(rgba(0xa89984ff).into()), ..Default::default() }, ), ( "punctuation.delimiter".into(), UserHighlightStyle { - color: Some(rgba(0x83a598ff).into()), + color: Some(rgba(0xa89984ff).into()), ..Default::default() }, ), ( "punctuation.list_marker".into(), UserHighlightStyle { - color: Some(rgba(0x83a598ff).into()), + color: Some(rgba(0xa89984ff).into()), ..Default::default() }, ), ( "punctuation.special".into(), UserHighlightStyle { - color: Some(rgba(0x83a598ff).into()), + color: Some(rgba(0xa89984ff).into()), ..Default::default() }, ), @@ -473,35 +473,35 @@ pub fn gruvbox() -> UserThemeFamily { ( "punctuation".into(), UserHighlightStyle { - color: Some(rgba(0x83a598ff).into()), + color: Some(rgba(0xa89984ff).into()), ..Default::default() }, ), ( "punctuation.bracket".into(), UserHighlightStyle { - color: Some(rgba(0x83a598ff).into()), + color: Some(rgba(0xa89984ff).into()), ..Default::default() }, ), ( "punctuation.delimiter".into(), UserHighlightStyle { - color: Some(rgba(0x83a598ff).into()), + color: Some(rgba(0xa89984ff).into()), ..Default::default() }, ), ( "punctuation.list_marker".into(), UserHighlightStyle { - color: Some(rgba(0x83a598ff).into()), + color: Some(rgba(0xa89984ff).into()), ..Default::default() }, ), ( "punctuation.special".into(), UserHighlightStyle { - color: Some(rgba(0x83a598ff).into()), + color: Some(rgba(0xa89984ff).into()), ..Default::default() }, ), @@ -759,35 +759,35 @@ pub fn gruvbox() -> UserThemeFamily { ( "punctuation".into(), UserHighlightStyle { - color: Some(rgba(0x83a598ff).into()), + color: Some(rgba(0xa89984ff).into()), ..Default::default() }, ), ( "punctuation.bracket".into(), UserHighlightStyle { - color: Some(rgba(0x83a598ff).into()), + color: Some(rgba(0xa89984ff).into()), ..Default::default() }, ), ( "punctuation.delimiter".into(), UserHighlightStyle { - color: Some(rgba(0x83a598ff).into()), + color: Some(rgba(0xa89984ff).into()), ..Default::default() }, ), ( "punctuation.list_marker".into(), UserHighlightStyle { - color: Some(rgba(0x83a598ff).into()), + color: Some(rgba(0xa89984ff).into()), ..Default::default() }, ), ( "punctuation.special".into(), UserHighlightStyle { - color: Some(rgba(0x83a598ff).into()), + color: Some(rgba(0xa89984ff).into()), ..Default::default() }, ), @@ -1045,35 +1045,35 @@ pub fn gruvbox() -> UserThemeFamily { ( "punctuation".into(), UserHighlightStyle { - color: Some(rgba(0x076678ff).into()), + color: Some(rgba(0x7c6f64ff).into()), ..Default::default() }, ), ( "punctuation.bracket".into(), UserHighlightStyle { - color: Some(rgba(0x076678ff).into()), + color: Some(rgba(0x7c6f64ff).into()), ..Default::default() }, ), ( "punctuation.delimiter".into(), UserHighlightStyle { - color: Some(rgba(0x076678ff).into()), + color: Some(rgba(0x7c6f64ff).into()), ..Default::default() }, ), ( "punctuation.list_marker".into(), UserHighlightStyle { - color: Some(rgba(0x076678ff).into()), + color: Some(rgba(0x7c6f64ff).into()), ..Default::default() }, ), ( "punctuation.special".into(), UserHighlightStyle { - color: Some(rgba(0x076678ff).into()), + color: Some(rgba(0x7c6f64ff).into()), ..Default::default() }, ), @@ -1331,35 +1331,35 @@ pub fn gruvbox() -> UserThemeFamily { ( "punctuation".into(), UserHighlightStyle { - color: Some(rgba(0x076678ff).into()), + color: Some(rgba(0x7c6f64ff).into()), ..Default::default() }, ), ( "punctuation.bracket".into(), UserHighlightStyle { - color: Some(rgba(0x076678ff).into()), + color: Some(rgba(0x7c6f64ff).into()), ..Default::default() }, ), ( "punctuation.delimiter".into(), UserHighlightStyle { - color: Some(rgba(0x076678ff).into()), + color: Some(rgba(0x7c6f64ff).into()), ..Default::default() }, ), ( "punctuation.list_marker".into(), UserHighlightStyle { - color: Some(rgba(0x076678ff).into()), + color: Some(rgba(0x7c6f64ff).into()), ..Default::default() }, ), ( "punctuation.special".into(), UserHighlightStyle { - color: Some(rgba(0x076678ff).into()), + color: Some(rgba(0x7c6f64ff).into()), ..Default::default() }, ), @@ -1617,35 +1617,35 @@ pub fn gruvbox() -> UserThemeFamily { ( "punctuation".into(), UserHighlightStyle { - color: Some(rgba(0x076678ff).into()), + color: Some(rgba(0x7c6f64ff).into()), ..Default::default() }, ), ( "punctuation.bracket".into(), UserHighlightStyle { - color: Some(rgba(0x076678ff).into()), + color: Some(rgba(0x7c6f64ff).into()), ..Default::default() }, ), ( "punctuation.delimiter".into(), UserHighlightStyle { - color: Some(rgba(0x076678ff).into()), + color: Some(rgba(0x7c6f64ff).into()), ..Default::default() }, ), ( "punctuation.list_marker".into(), UserHighlightStyle { - color: Some(rgba(0x076678ff).into()), + color: Some(rgba(0x7c6f64ff).into()), ..Default::default() }, ), ( "punctuation.special".into(), UserHighlightStyle { - color: Some(rgba(0x076678ff).into()), + color: Some(rgba(0x7c6f64ff).into()), ..Default::default() }, ), diff --git a/crates/theme2/src/themes/night_owl.rs b/crates/theme2/src/themes/night_owl.rs index cb4278526d..d52bc6ab4e 100644 --- a/crates/theme2/src/themes/night_owl.rs +++ b/crates/theme2/src/themes/night_owl.rs @@ -125,6 +125,7 @@ pub fn night_owl() -> UserThemeFamily { "function".into(), UserHighlightStyle { color: Some(rgba(0x82aaffff).into()), + font_style: Some(UserFontStyle::Italic), ..Default::default() }, ), @@ -160,35 +161,40 @@ pub fn night_owl() -> UserThemeFamily { ( "punctuation".into(), UserHighlightStyle { - color: Some(rgba(0x7fdbcaff).into()), + color: Some(rgba(0xc792eaff).into()), + font_style: Some(UserFontStyle::Italic), ..Default::default() }, ), ( "punctuation.bracket".into(), UserHighlightStyle { - color: Some(rgba(0x7fdbcaff).into()), + color: Some(rgba(0xc792eaff).into()), + font_style: Some(UserFontStyle::Italic), ..Default::default() }, ), ( "punctuation.delimiter".into(), UserHighlightStyle { - color: Some(rgba(0x7fdbcaff).into()), + color: Some(rgba(0xc792eaff).into()), + font_style: Some(UserFontStyle::Italic), ..Default::default() }, ), ( "punctuation.list_marker".into(), UserHighlightStyle { - color: Some(rgba(0x7fdbcaff).into()), + color: Some(rgba(0xc792eaff).into()), + font_style: Some(UserFontStyle::Italic), ..Default::default() }, ), ( "punctuation.special".into(), UserHighlightStyle { - color: Some(rgba(0x7fdbcaff).into()), + color: Some(rgba(0xc792eaff).into()), + font_style: Some(UserFontStyle::Italic), ..Default::default() }, ), @@ -251,7 +257,7 @@ pub fn night_owl() -> UserThemeFamily { ( "variable".into(), UserHighlightStyle { - color: Some(rgba(0xd7dbe0ff).into()), + color: Some(rgba(0xc5e478ff).into()), ..Default::default() }, ), @@ -374,6 +380,7 @@ pub fn night_owl() -> UserThemeFamily { "function".into(), UserHighlightStyle { color: Some(rgba(0x4876d6ff).into()), + font_style: Some(UserFontStyle::Italic), ..Default::default() }, ), @@ -410,6 +417,7 @@ pub fn night_owl() -> UserThemeFamily { "punctuation".into(), UserHighlightStyle { color: Some(rgba(0x994cc3ff).into()), + font_style: Some(UserFontStyle::Italic), ..Default::default() }, ), @@ -417,6 +425,7 @@ pub fn night_owl() -> UserThemeFamily { "punctuation.bracket".into(), UserHighlightStyle { color: Some(rgba(0x994cc3ff).into()), + font_style: Some(UserFontStyle::Italic), ..Default::default() }, ), @@ -424,6 +433,7 @@ pub fn night_owl() -> UserThemeFamily { "punctuation.delimiter".into(), UserHighlightStyle { color: Some(rgba(0x994cc3ff).into()), + font_style: Some(UserFontStyle::Italic), ..Default::default() }, ), @@ -431,6 +441,7 @@ pub fn night_owl() -> UserThemeFamily { "punctuation.list_marker".into(), UserHighlightStyle { color: Some(rgba(0x994cc3ff).into()), + font_style: Some(UserFontStyle::Italic), ..Default::default() }, ), @@ -438,6 +449,7 @@ pub fn night_owl() -> UserThemeFamily { "punctuation.special".into(), UserHighlightStyle { color: Some(rgba(0x994cc3ff).into()), + font_style: Some(UserFontStyle::Italic), ..Default::default() }, ), @@ -500,7 +512,7 @@ pub fn night_owl() -> UserThemeFamily { ( "variable".into(), UserHighlightStyle { - color: Some(rgba(0x403f53ff).into()), + color: Some(rgba(0x4876d6ff).into()), ..Default::default() }, ), diff --git a/crates/theme2/src/themes/noctis.rs b/crates/theme2/src/themes/noctis.rs index e1497f57ab..f5caf2d4ad 100644 --- a/crates/theme2/src/themes/noctis.rs +++ b/crates/theme2/src/themes/noctis.rs @@ -102,7 +102,7 @@ pub fn noctis() -> UserThemeFamily { ( "constant".into(), UserHighlightStyle { - color: Some(rgba(0x7060ebff).into()), + color: Some(rgba(0xd5971aff).into()), ..Default::default() }, ), @@ -373,7 +373,7 @@ pub fn noctis() -> UserThemeFamily { ( "constant".into(), UserHighlightStyle { - color: Some(rgba(0x7060ebff).into()), + color: Some(rgba(0xd5971aff).into()), ..Default::default() }, ), @@ -644,7 +644,7 @@ pub fn noctis() -> UserThemeFamily { ( "constant".into(), UserHighlightStyle { - color: Some(rgba(0x5842ffff).into()), + color: Some(rgba(0xa88c00ff).into()), ..Default::default() }, ), @@ -915,7 +915,7 @@ pub fn noctis() -> UserThemeFamily { ( "constant".into(), UserHighlightStyle { - color: Some(rgba(0x5842ffff).into()), + color: Some(rgba(0xa88c00ff).into()), ..Default::default() }, ), @@ -1186,7 +1186,7 @@ pub fn noctis() -> UserThemeFamily { ( "constant".into(), UserHighlightStyle { - color: Some(rgba(0x5842ffff).into()), + color: Some(rgba(0xa88c00ff).into()), ..Default::default() }, ), @@ -1457,7 +1457,7 @@ pub fn noctis() -> UserThemeFamily { ( "constant".into(), UserHighlightStyle { - color: Some(rgba(0x7068b1ff).into()), + color: Some(rgba(0xa88c00ff).into()), ..Default::default() }, ), @@ -1728,7 +1728,7 @@ pub fn noctis() -> UserThemeFamily { ( "constant".into(), UserHighlightStyle { - color: Some(rgba(0x7060ebff).into()), + color: Some(rgba(0xd5971aff).into()), ..Default::default() }, ), @@ -1999,7 +1999,7 @@ pub fn noctis() -> UserThemeFamily { ( "constant".into(), UserHighlightStyle { - color: Some(rgba(0x7060ebff).into()), + color: Some(rgba(0xd5971aff).into()), ..Default::default() }, ), @@ -2270,7 +2270,7 @@ pub fn noctis() -> UserThemeFamily { ( "constant".into(), UserHighlightStyle { - color: Some(rgba(0x7060ebff).into()), + color: Some(rgba(0xd5971aff).into()), ..Default::default() }, ), @@ -2541,7 +2541,7 @@ pub fn noctis() -> UserThemeFamily { ( "constant".into(), UserHighlightStyle { - color: Some(rgba(0x7060ebff).into()), + color: Some(rgba(0xd5971aff).into()), ..Default::default() }, ), @@ -2812,7 +2812,7 @@ pub fn noctis() -> UserThemeFamily { ( "constant".into(), UserHighlightStyle { - color: Some(rgba(0x7060ebff).into()), + color: Some(rgba(0xd5971aff).into()), ..Default::default() }, ), diff --git a/crates/theme2/src/themes/nord.rs b/crates/theme2/src/themes/nord.rs index c5634bebcf..c149c37120 100644 --- a/crates/theme2/src/themes/nord.rs +++ b/crates/theme2/src/themes/nord.rs @@ -248,7 +248,7 @@ pub fn nord() -> UserThemeFamily { ( "variable".into(), UserHighlightStyle { - color: Some(rgba(0xd8dee9ff).into()), + color: Some(rgba(0x81a1c1ff).into()), ..Default::default() }, ), diff --git a/crates/theme2/src/themes/palenight.rs b/crates/theme2/src/themes/palenight.rs index 1cebdc83e2..e12d8a1f05 100644 --- a/crates/theme2/src/themes/palenight.rs +++ b/crates/theme2/src/themes/palenight.rs @@ -188,35 +188,35 @@ pub fn palenight() -> UserThemeFamily { ( "punctuation".into(), UserHighlightStyle { - color: Some(rgba(0x89ddffff).into()), + color: Some(rgba(0xc792eaff).into()), ..Default::default() }, ), ( "punctuation.bracket".into(), UserHighlightStyle { - color: Some(rgba(0x89ddffff).into()), + color: Some(rgba(0xc792eaff).into()), ..Default::default() }, ), ( "punctuation.delimiter".into(), UserHighlightStyle { - color: Some(rgba(0x89ddffff).into()), + color: Some(rgba(0xc792eaff).into()), ..Default::default() }, ), ( "punctuation.list_marker".into(), UserHighlightStyle { - color: Some(rgba(0x89ddffff).into()), + color: Some(rgba(0xc792eaff).into()), ..Default::default() }, ), ( "punctuation.special".into(), UserHighlightStyle { - color: Some(rgba(0x89ddffff).into()), + color: Some(rgba(0xc792eaff).into()), ..Default::default() }, ), @@ -279,7 +279,7 @@ pub fn palenight() -> UserThemeFamily { ( "variable".into(), UserHighlightStyle { - color: Some(rgba(0xff5572ff).into()), + color: Some(rgba(0xffcb6bff).into()), ..Default::default() }, ), @@ -468,35 +468,35 @@ pub fn palenight() -> UserThemeFamily { ( "punctuation".into(), UserHighlightStyle { - color: Some(rgba(0x89ddffff).into()), + color: Some(rgba(0xc792eaff).into()), ..Default::default() }, ), ( "punctuation.bracket".into(), UserHighlightStyle { - color: Some(rgba(0x89ddffff).into()), + color: Some(rgba(0xc792eaff).into()), ..Default::default() }, ), ( "punctuation.delimiter".into(), UserHighlightStyle { - color: Some(rgba(0x89ddffff).into()), + color: Some(rgba(0xc792eaff).into()), ..Default::default() }, ), ( "punctuation.list_marker".into(), UserHighlightStyle { - color: Some(rgba(0x89ddffff).into()), + color: Some(rgba(0xc792eaff).into()), ..Default::default() }, ), ( "punctuation.special".into(), UserHighlightStyle { - color: Some(rgba(0x89ddffff).into()), + color: Some(rgba(0xc792eaff).into()), ..Default::default() }, ), @@ -559,7 +559,7 @@ pub fn palenight() -> UserThemeFamily { ( "variable".into(), UserHighlightStyle { - color: Some(rgba(0xff5572ff).into()), + color: Some(rgba(0xffcb6bff).into()), ..Default::default() }, ), @@ -748,35 +748,35 @@ pub fn palenight() -> UserThemeFamily { ( "punctuation".into(), UserHighlightStyle { - color: Some(rgba(0x89ddffff).into()), + color: Some(rgba(0xc792eaff).into()), ..Default::default() }, ), ( "punctuation.bracket".into(), UserHighlightStyle { - color: Some(rgba(0x89ddffff).into()), + color: Some(rgba(0xc792eaff).into()), ..Default::default() }, ), ( "punctuation.delimiter".into(), UserHighlightStyle { - color: Some(rgba(0x89ddffff).into()), + color: Some(rgba(0xc792eaff).into()), ..Default::default() }, ), ( "punctuation.list_marker".into(), UserHighlightStyle { - color: Some(rgba(0x89ddffff).into()), + color: Some(rgba(0xc792eaff).into()), ..Default::default() }, ), ( "punctuation.special".into(), UserHighlightStyle { - color: Some(rgba(0x89ddffff).into()), + color: Some(rgba(0xc792eaff).into()), ..Default::default() }, ), @@ -839,7 +839,7 @@ pub fn palenight() -> UserThemeFamily { ( "variable".into(), UserHighlightStyle { - color: Some(rgba(0xff5572ff).into()), + color: Some(rgba(0xffcb6bff).into()), ..Default::default() }, ), diff --git a/crates/theme2/src/themes/rose_pine.rs b/crates/theme2/src/themes/rose_pine.rs index 91b79821c8..b27ef55ea0 100644 --- a/crates/theme2/src/themes/rose_pine.rs +++ b/crates/theme2/src/themes/rose_pine.rs @@ -111,7 +111,7 @@ pub fn rose_pine() -> UserThemeFamily { ( "constant".into(), UserHighlightStyle { - color: Some(rgba(0xebbcbaff).into()), + color: Some(rgba(0x31748fff).into()), ..Default::default() }, ), @@ -153,35 +153,35 @@ pub fn rose_pine() -> UserThemeFamily { ( "punctuation".into(), UserHighlightStyle { - color: Some(rgba(0x6e6a86ff).into()), + color: Some(rgba(0x908caaff).into()), ..Default::default() }, ), ( "punctuation.bracket".into(), UserHighlightStyle { - color: Some(rgba(0x6e6a86ff).into()), + color: Some(rgba(0x908caaff).into()), ..Default::default() }, ), ( "punctuation.delimiter".into(), UserHighlightStyle { - color: Some(rgba(0x6e6a86ff).into()), + color: Some(rgba(0x908caaff).into()), ..Default::default() }, ), ( "punctuation.list_marker".into(), UserHighlightStyle { - color: Some(rgba(0x6e6a86ff).into()), + color: Some(rgba(0x908caaff).into()), ..Default::default() }, ), ( "punctuation.special".into(), UserHighlightStyle { - color: Some(rgba(0x6e6a86ff).into()), + color: Some(rgba(0x908caaff).into()), ..Default::default() }, ), @@ -251,7 +251,8 @@ pub fn rose_pine() -> UserThemeFamily { ( "variable".into(), UserHighlightStyle { - color: Some(rgba(0xc4a7e7ff).into()), + color: Some(rgba(0xebbcbaff).into()), + font_style: Some(UserFontStyle::Italic), ..Default::default() }, ), @@ -363,7 +364,7 @@ pub fn rose_pine() -> UserThemeFamily { ( "constant".into(), UserHighlightStyle { - color: Some(rgba(0xea9a97ff).into()), + color: Some(rgba(0x3e8fb0ff).into()), ..Default::default() }, ), @@ -405,35 +406,35 @@ pub fn rose_pine() -> UserThemeFamily { ( "punctuation".into(), UserHighlightStyle { - color: Some(rgba(0x6e6a86ff).into()), + color: Some(rgba(0x908caaff).into()), ..Default::default() }, ), ( "punctuation.bracket".into(), UserHighlightStyle { - color: Some(rgba(0x6e6a86ff).into()), + color: Some(rgba(0x908caaff).into()), ..Default::default() }, ), ( "punctuation.delimiter".into(), UserHighlightStyle { - color: Some(rgba(0x6e6a86ff).into()), + color: Some(rgba(0x908caaff).into()), ..Default::default() }, ), ( "punctuation.list_marker".into(), UserHighlightStyle { - color: Some(rgba(0x6e6a86ff).into()), + color: Some(rgba(0x908caaff).into()), ..Default::default() }, ), ( "punctuation.special".into(), UserHighlightStyle { - color: Some(rgba(0x6e6a86ff).into()), + color: Some(rgba(0x908caaff).into()), ..Default::default() }, ), @@ -503,7 +504,8 @@ pub fn rose_pine() -> UserThemeFamily { ( "variable".into(), UserHighlightStyle { - color: Some(rgba(0xc4a7e7ff).into()), + color: Some(rgba(0xea9a97ff).into()), + font_style: Some(UserFontStyle::Italic), ..Default::default() }, ), @@ -615,7 +617,7 @@ pub fn rose_pine() -> UserThemeFamily { ( "constant".into(), UserHighlightStyle { - color: Some(rgba(0xd7827eff).into()), + color: Some(rgba(0x286983ff).into()), ..Default::default() }, ), @@ -657,35 +659,35 @@ pub fn rose_pine() -> UserThemeFamily { ( "punctuation".into(), UserHighlightStyle { - color: Some(rgba(0x9893a5ff).into()), + color: Some(rgba(0x797593ff).into()), ..Default::default() }, ), ( "punctuation.bracket".into(), UserHighlightStyle { - color: Some(rgba(0x9893a5ff).into()), + color: Some(rgba(0x797593ff).into()), ..Default::default() }, ), ( "punctuation.delimiter".into(), UserHighlightStyle { - color: Some(rgba(0x9893a5ff).into()), + color: Some(rgba(0x797593ff).into()), ..Default::default() }, ), ( "punctuation.list_marker".into(), UserHighlightStyle { - color: Some(rgba(0x9893a5ff).into()), + color: Some(rgba(0x797593ff).into()), ..Default::default() }, ), ( "punctuation.special".into(), UserHighlightStyle { - color: Some(rgba(0x9893a5ff).into()), + color: Some(rgba(0x797593ff).into()), ..Default::default() }, ), @@ -755,7 +757,8 @@ pub fn rose_pine() -> UserThemeFamily { ( "variable".into(), UserHighlightStyle { - color: Some(rgba(0x907aa9ff).into()), + color: Some(rgba(0xd7827eff).into()), + font_style: Some(UserFontStyle::Italic), ..Default::default() }, ), diff --git a/crates/theme2/src/themes/solarized.rs b/crates/theme2/src/themes/solarized.rs index ae2ad90051..a9d7e0699c 100644 --- a/crates/theme2/src/themes/solarized.rs +++ b/crates/theme2/src/themes/solarized.rs @@ -103,7 +103,7 @@ pub fn solarized() -> UserThemeFamily { ( "constant".into(), UserHighlightStyle { - color: Some(rgba(0xcb4b16ff).into()), + color: Some(rgba(0xb58900ff).into()), ..Default::default() }, ), @@ -145,7 +145,7 @@ pub fn solarized() -> UserThemeFamily { ( "keyword".into(), UserHighlightStyle { - color: Some(rgba(0x268bd2ff).into()), + color: Some(rgba(0x859900ff).into()), ..Default::default() }, ), @@ -257,14 +257,14 @@ pub fn solarized() -> UserThemeFamily { ( "type".into(), UserHighlightStyle { - color: Some(rgba(0x859900ff).into()), + color: Some(rgba(0xb58900ff).into()), ..Default::default() }, ), ( "variable".into(), UserHighlightStyle { - color: Some(rgba(0x839496ff).into()), + color: Some(rgba(0x268bd2ff).into()), ..Default::default() }, ), @@ -365,7 +365,7 @@ pub fn solarized() -> UserThemeFamily { ( "constant".into(), UserHighlightStyle { - color: Some(rgba(0xcb4b16ff).into()), + color: Some(rgba(0xb58900ff).into()), ..Default::default() }, ), @@ -407,7 +407,7 @@ pub fn solarized() -> UserThemeFamily { ( "keyword".into(), UserHighlightStyle { - color: Some(rgba(0x268bd2ff).into()), + color: Some(rgba(0x859900ff).into()), ..Default::default() }, ), @@ -484,7 +484,7 @@ pub fn solarized() -> UserThemeFamily { ( "type".into(), UserHighlightStyle { - color: Some(rgba(0x859900ff).into()), + color: Some(rgba(0xb58900ff).into()), ..Default::default() }, ), diff --git a/crates/theme2/src/themes/synthwave_84.rs b/crates/theme2/src/themes/synthwave_84.rs index 48d1870147..3d0dbd5651 100644 --- a/crates/theme2/src/themes/synthwave_84.rs +++ b/crates/theme2/src/themes/synthwave_84.rs @@ -221,8 +221,7 @@ pub fn synthwave_84() -> UserThemeFamily { ( "variable".into(), UserHighlightStyle { - color: Some(rgba(0xfe4450ff).into()), - font_weight: Some(UserFontWeight(700.0)), + color: Some(rgba(0xff7edbff).into()), ..Default::default() }, ), diff --git a/crates/theme_importer/src/vscode/syntax.rs b/crates/theme_importer/src/vscode/syntax.rs index fb64048431..1a8df535bb 100644 --- a/crates/theme_importer/src/vscode/syntax.rs +++ b/crates/theme_importer/src/vscode/syntax.rs @@ -153,11 +153,20 @@ impl ZedSyntaxToken { .map(|scope| scope.as_str()) .collect::>(); + let scopes_to_match = self.to_vscode(); + let number_of_scopes_to_match = scopes_to_match.len(); + let mut matches = 0; - for scope in self.to_vscode() { + for (ix, scope) in scopes_to_match.into_iter().enumerate() { + // Assign each entry a weight that is inversely proportional to its + // position in the list. + // + // Entries towards the front are weighted higher than those towards the end. + let weight = (number_of_scopes_to_match - ix) as u32; + if candidate_scopes.contains(&scope) { - matches += 1; + matches += 1 + weight; } } @@ -210,9 +219,10 @@ impl ZedSyntaxToken { ZedSyntaxToken::Hint => vec![], ZedSyntaxToken::Keyword => vec![ "keyword", + "keyword.other.fn.rust", "keyword.control", "keyword.control.fun", - "keyword.other.fn.rust", + "keyword.control.class", "punctuation.accessor", "entity.name.tag", ],