Improve matching for constant tokens

Marshall Bowers created

Change summary

crates/theme2/src/themes/ayu.rs            |  6 +++---
crates/theme2/src/themes/noctis.rs         | 22 +++++++++++-----------
crates/theme2/src/themes/nord.rs           |  2 +-
crates/theme2/src/themes/rose_pine.rs      | 21 +++++++++++++++++++++
crates/theme2/src/themes/synthwave_84.rs   |  7 +++++++
crates/theme_importer/src/vscode/syntax.rs |  2 +-
6 files changed, 44 insertions(+), 16 deletions(-)

Detailed changes

crates/theme2/src/themes/ayu.rs 🔗

@@ -104,7 +104,7 @@ pub fn ayu() -> UserThemeFamily {
                             (
                                 "constant".into(),
                                 UserHighlightStyle {
-                                    color: Some(rgba(0x4cbf99ff).into()),
+                                    color: Some(rgba(0xa37accff).into()),
                                     ..Default::default()
                                 },
                             ),
@@ -393,7 +393,7 @@ pub fn ayu() -> UserThemeFamily {
                             (
                                 "constant".into(),
                                 UserHighlightStyle {
-                                    color: Some(rgba(0x95e6cbff).into()),
+                                    color: Some(rgba(0xdfbfffff).into()),
                                     ..Default::default()
                                 },
                             ),
@@ -682,7 +682,7 @@ pub fn ayu() -> UserThemeFamily {
                             (
                                 "constant".into(),
                                 UserHighlightStyle {
-                                    color: Some(rgba(0x95e6cbff).into()),
+                                    color: Some(rgba(0xd2a6ffff).into()),
                                     ..Default::default()
                                 },
                             ),

crates/theme2/src/themes/noctis.rs 🔗

@@ -97,7 +97,7 @@ pub fn noctis() -> UserThemeFamily {
                             (
                                 "constant".into(),
                                 UserHighlightStyle {
-                                    color: Some(rgba(0xbecfdaff).into()),
+                                    color: Some(rgba(0x7060ebff).into()),
                                     ..Default::default()
                                 },
                             ),
@@ -356,7 +356,7 @@ pub fn noctis() -> UserThemeFamily {
                             (
                                 "constant".into(),
                                 UserHighlightStyle {
-                                    color: Some(rgba(0xcbbec2ff).into()),
+                                    color: Some(rgba(0x7060ebff).into()),
                                     ..Default::default()
                                 },
                             ),
@@ -615,7 +615,7 @@ pub fn noctis() -> UserThemeFamily {
                             (
                                 "constant".into(),
                                 UserHighlightStyle {
-                                    color: Some(rgba(0x004d57ff).into()),
+                                    color: Some(rgba(0x5842ffff).into()),
                                     ..Default::default()
                                 },
                             ),
@@ -874,7 +874,7 @@ pub fn noctis() -> UserThemeFamily {
                             (
                                 "constant".into(),
                                 UserHighlightStyle {
-                                    color: Some(rgba(0x0c006bff).into()),
+                                    color: Some(rgba(0x5842ffff).into()),
                                     ..Default::default()
                                 },
                             ),
@@ -1133,7 +1133,7 @@ pub fn noctis() -> UserThemeFamily {
                             (
                                 "constant".into(),
                                 UserHighlightStyle {
-                                    color: Some(rgba(0x004d57ff).into()),
+                                    color: Some(rgba(0x5842ffff).into()),
                                     ..Default::default()
                                 },
                             ),
@@ -1392,7 +1392,7 @@ pub fn noctis() -> UserThemeFamily {
                             (
                                 "constant".into(),
                                 UserHighlightStyle {
-                                    color: Some(rgba(0xc5cdd3ff).into()),
+                                    color: Some(rgba(0x7068b1ff).into()),
                                     ..Default::default()
                                 },
                             ),
@@ -1651,7 +1651,7 @@ pub fn noctis() -> UserThemeFamily {
                             (
                                 "constant".into(),
                                 UserHighlightStyle {
-                                    color: Some(rgba(0xb2cacdff).into()),
+                                    color: Some(rgba(0x7060ebff).into()),
                                     ..Default::default()
                                 },
                             ),
@@ -1910,7 +1910,7 @@ pub fn noctis() -> UserThemeFamily {
                             (
                                 "constant".into(),
                                 UserHighlightStyle {
-                                    color: Some(rgba(0xb2cacdff).into()),
+                                    color: Some(rgba(0x7060ebff).into()),
                                     ..Default::default()
                                 },
                             ),
@@ -2169,7 +2169,7 @@ pub fn noctis() -> UserThemeFamily {
                             (
                                 "constant".into(),
                                 UserHighlightStyle {
-                                    color: Some(rgba(0xb2cacdff).into()),
+                                    color: Some(rgba(0x7060ebff).into()),
                                     ..Default::default()
                                 },
                             ),
@@ -2428,7 +2428,7 @@ pub fn noctis() -> UserThemeFamily {
                             (
                                 "constant".into(),
                                 UserHighlightStyle {
-                                    color: Some(rgba(0xc5c2d6ff).into()),
+                                    color: Some(rgba(0x7060ebff).into()),
                                     ..Default::default()
                                 },
                             ),
@@ -2687,7 +2687,7 @@ pub fn noctis() -> UserThemeFamily {
                             (
                                 "constant".into(),
                                 UserHighlightStyle {
-                                    color: Some(rgba(0xccbfd9ff).into()),
+                                    color: Some(rgba(0x7060ebff).into()),
                                     ..Default::default()
                                 },
                             ),

crates/theme2/src/themes/nord.rs 🔗

@@ -103,7 +103,7 @@ pub fn nord() -> UserThemeFamily {
                         (
                             "constant".into(),
                             UserHighlightStyle {
-                                color: Some(rgba(0xebcb8bff).into()),
+                                color: Some(rgba(0x81a1c1ff).into()),
                                 ..Default::default()
                             },
                         ),

crates/theme2/src/themes/rose_pine.rs 🔗

@@ -103,6 +103,13 @@ pub fn rose_pine() -> UserThemeFamily {
                                     ..Default::default()
                                 },
                             ),
+                            (
+                                "constant".into(),
+                                UserHighlightStyle {
+                                    color: Some(rgba(0xebbcbaff).into()),
+                                    ..Default::default()
+                                },
+                            ),
                             (
                                 "function".into(),
                                 UserHighlightStyle {
@@ -336,6 +343,13 @@ pub fn rose_pine() -> UserThemeFamily {
                                     ..Default::default()
                                 },
                             ),
+                            (
+                                "constant".into(),
+                                UserHighlightStyle {
+                                    color: Some(rgba(0xea9a97ff).into()),
+                                    ..Default::default()
+                                },
+                            ),
                             (
                                 "function".into(),
                                 UserHighlightStyle {
@@ -569,6 +583,13 @@ pub fn rose_pine() -> UserThemeFamily {
                                     ..Default::default()
                                 },
                             ),
+                            (
+                                "constant".into(),
+                                UserHighlightStyle {
+                                    color: Some(rgba(0xd7827eff).into()),
+                                    ..Default::default()
+                                },
+                            ),
                             (
                                 "function".into(),
                                 UserHighlightStyle {

crates/theme2/src/themes/synthwave_84.rs 🔗

@@ -85,6 +85,13 @@ pub fn synthwave_84() -> UserThemeFamily {
                                 ..Default::default()
                             },
                         ),
+                        (
+                            "constant".into(),
+                            UserHighlightStyle {
+                                color: Some(rgba(0xf97e72ff).into()),
+                                ..Default::default()
+                            },
+                        ),
                         (
                             "function".into(),
                             UserHighlightStyle {

crates/theme_importer/src/vscode/syntax.rs 🔗

@@ -186,7 +186,7 @@ impl ZedSyntaxToken {
             ZedSyntaxToken::Boolean => vec!["constant.language"],
             ZedSyntaxToken::Comment => vec!["comment"],
             ZedSyntaxToken::CommentDoc => vec!["comment.block.documentation"],
-            ZedSyntaxToken::Constant => vec!["constant.character"],
+            ZedSyntaxToken::Constant => vec!["constant.language", "constant.character"],
             ZedSyntaxToken::Constructor => {
                 vec!["entity.name.function.definition.special.constructor"]
             }