Improve matching for constant tokens further

Marshall Bowers created

Change summary

crates/theme2/src/themes/andromeda.rs      | 14 ++++++++
crates/theme2/src/themes/dracula.rs        |  7 ++++
crates/theme2/src/themes/gruvbox.rs        | 42 ++++++++++++++++++++++++
crates/theme_importer/src/vscode/syntax.rs |  2 
4 files changed, 64 insertions(+), 1 deletion(-)

Detailed changes

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

@@ -88,6 +88,13 @@ pub fn andromeda() -> UserThemeFamily {
                                     ..Default::default()
                                 },
                             ),
+                            (
+                                "constant".into(),
+                                UserHighlightStyle {
+                                    color: Some(rgba(0xee5d43ff).into()),
+                                    ..Default::default()
+                                },
+                            ),
                             (
                                 "emphasis".into(),
                                 UserHighlightStyle {
@@ -278,6 +285,13 @@ pub fn andromeda() -> UserThemeFamily {
                                     ..Default::default()
                                 },
                             ),
+                            (
+                                "constant".into(),
+                                UserHighlightStyle {
+                                    color: Some(rgba(0xee5d43ff).into()),
+                                    ..Default::default()
+                                },
+                            ),
                             (
                                 "emphasis".into(),
                                 UserHighlightStyle {

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

@@ -94,6 +94,13 @@ pub fn dracula() -> UserThemeFamily {
                                 ..Default::default()
                             },
                         ),
+                        (
+                            "constant".into(),
+                            UserHighlightStyle {
+                                color: Some(rgba(0xbd93f9ff).into()),
+                                ..Default::default()
+                            },
+                        ),
                         (
                             "emphasis".into(),
                             UserHighlightStyle {

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

@@ -91,6 +91,13 @@ pub fn gruvbox() -> UserThemeFamily {
                                     ..Default::default()
                                 },
                             ),
+                            (
+                                "constant".into(),
+                                UserHighlightStyle {
+                                    color: Some(rgba(0xd3869bff).into()),
+                                    ..Default::default()
+                                },
+                            ),
                             (
                                 "emphasis.strong".into(),
                                 UserHighlightStyle {
@@ -348,6 +355,13 @@ pub fn gruvbox() -> UserThemeFamily {
                                     ..Default::default()
                                 },
                             ),
+                            (
+                                "constant".into(),
+                                UserHighlightStyle {
+                                    color: Some(rgba(0xd3869bff).into()),
+                                    ..Default::default()
+                                },
+                            ),
                             (
                                 "emphasis.strong".into(),
                                 UserHighlightStyle {
@@ -605,6 +619,13 @@ pub fn gruvbox() -> UserThemeFamily {
                                     ..Default::default()
                                 },
                             ),
+                            (
+                                "constant".into(),
+                                UserHighlightStyle {
+                                    color: Some(rgba(0xd3869bff).into()),
+                                    ..Default::default()
+                                },
+                            ),
                             (
                                 "emphasis.strong".into(),
                                 UserHighlightStyle {
@@ -862,6 +883,13 @@ pub fn gruvbox() -> UserThemeFamily {
                                     ..Default::default()
                                 },
                             ),
+                            (
+                                "constant".into(),
+                                UserHighlightStyle {
+                                    color: Some(rgba(0x8f3f71ff).into()),
+                                    ..Default::default()
+                                },
+                            ),
                             (
                                 "emphasis.strong".into(),
                                 UserHighlightStyle {
@@ -1119,6 +1147,13 @@ pub fn gruvbox() -> UserThemeFamily {
                                     ..Default::default()
                                 },
                             ),
+                            (
+                                "constant".into(),
+                                UserHighlightStyle {
+                                    color: Some(rgba(0x8f3f71ff).into()),
+                                    ..Default::default()
+                                },
+                            ),
                             (
                                 "emphasis.strong".into(),
                                 UserHighlightStyle {
@@ -1376,6 +1411,13 @@ pub fn gruvbox() -> UserThemeFamily {
                                     ..Default::default()
                                 },
                             ),
+                            (
+                                "constant".into(),
+                                UserHighlightStyle {
+                                    color: Some(rgba(0x8f3f71ff).into()),
+                                    ..Default::default()
+                                },
+                            ),
                             (
                                 "emphasis.strong".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.language", "constant.character"],
+            ZedSyntaxToken::Constant => vec!["constant", "constant.language", "constant.character"],
             ZedSyntaxToken::Constructor => {
                 vec!["entity.name.function.definition.special.constructor"]
             }