From 6f064cfc36e3efcc30e9664cfb5a21807e3f9338 Mon Sep 17 00:00:00 2001 From: Marshall Bowers Date: Fri, 8 Dec 2023 11:34:39 -0500 Subject: [PATCH] Improve matching for constructor tokens --- crates/theme2/src/themes/andromeda.rs | 14 ++++ crates/theme2/src/themes/ayu.rs | 21 ++++++ crates/theme2/src/themes/dracula.rs | 7 ++ crates/theme2/src/themes/gruvbox.rs | 42 ++++++++++++ crates/theme2/src/themes/night_owl.rs | 14 ++++ crates/theme2/src/themes/noctis.rs | 77 ++++++++++++++++++++++ crates/theme2/src/themes/nord.rs | 7 ++ crates/theme2/src/themes/palenight.rs | 21 ++++++ crates/theme2/src/themes/rose_pine.rs | 21 ++++++ crates/theme2/src/themes/solarized.rs | 14 ++++ crates/theme2/src/themes/synthwave_84.rs | 7 ++ crates/theme_importer/src/vscode/syntax.rs | 5 +- 12 files changed, 249 insertions(+), 1 deletion(-) diff --git a/crates/theme2/src/themes/andromeda.rs b/crates/theme2/src/themes/andromeda.rs index 38c859333fa49d6a1da1e9ffb250e4c601483f5b..577bbea54311025174d2e787a7ee05a51bae2ba3 100644 --- a/crates/theme2/src/themes/andromeda.rs +++ b/crates/theme2/src/themes/andromeda.rs @@ -95,6 +95,13 @@ pub fn andromeda() -> UserThemeFamily { ..Default::default() }, ), + ( + "constructor".into(), + UserHighlightStyle { + color: Some(rgba(0xf92672ff).into()), + ..Default::default() + }, + ), ( "emphasis".into(), UserHighlightStyle { @@ -292,6 +299,13 @@ pub fn andromeda() -> UserThemeFamily { ..Default::default() }, ), + ( + "constructor".into(), + UserHighlightStyle { + color: Some(rgba(0xf92672ff).into()), + ..Default::default() + }, + ), ( "emphasis".into(), UserHighlightStyle { diff --git a/crates/theme2/src/themes/ayu.rs b/crates/theme2/src/themes/ayu.rs index f4ed232ea2a812fcfe34d40485a635fe6e6cff83..10ef469490be526cf582c5dd0e7433c00d9f8c7d 100644 --- a/crates/theme2/src/themes/ayu.rs +++ b/crates/theme2/src/themes/ayu.rs @@ -108,6 +108,13 @@ pub fn ayu() -> UserThemeFamily { ..Default::default() }, ), + ( + "constructor".into(), + UserHighlightStyle { + color: Some(rgba(0x55b4d4ff).into()), + ..Default::default() + }, + ), ( "embedded".into(), UserHighlightStyle { @@ -397,6 +404,13 @@ pub fn ayu() -> UserThemeFamily { ..Default::default() }, ), + ( + "constructor".into(), + UserHighlightStyle { + color: Some(rgba(0x5ccfe6ff).into()), + ..Default::default() + }, + ), ( "embedded".into(), UserHighlightStyle { @@ -686,6 +700,13 @@ pub fn ayu() -> UserThemeFamily { ..Default::default() }, ), + ( + "constructor".into(), + UserHighlightStyle { + color: Some(rgba(0x39bae6ff).into()), + ..Default::default() + }, + ), ( "embedded".into(), UserHighlightStyle { diff --git a/crates/theme2/src/themes/dracula.rs b/crates/theme2/src/themes/dracula.rs index ae6c9ad7888e6e1176785f61d5d1927eae4046e6..19902dd79db01138bf8439252f07ebed812cc6a8 100644 --- a/crates/theme2/src/themes/dracula.rs +++ b/crates/theme2/src/themes/dracula.rs @@ -101,6 +101,13 @@ pub fn dracula() -> UserThemeFamily { ..Default::default() }, ), + ( + "constructor".into(), + UserHighlightStyle { + color: Some(rgba(0xff79c6ff).into()), + ..Default::default() + }, + ), ( "emphasis".into(), UserHighlightStyle { diff --git a/crates/theme2/src/themes/gruvbox.rs b/crates/theme2/src/themes/gruvbox.rs index 32b580442a0dcb68b409f3f55cffd8153a10af4d..43354b2d2241fefd40f4c9a8a85c14e790e57ac0 100644 --- a/crates/theme2/src/themes/gruvbox.rs +++ b/crates/theme2/src/themes/gruvbox.rs @@ -98,6 +98,13 @@ pub fn gruvbox() -> UserThemeFamily { ..Default::default() }, ), + ( + "constructor".into(), + UserHighlightStyle { + color: Some(rgba(0x8ec07cff).into()), + ..Default::default() + }, + ), ( "emphasis.strong".into(), UserHighlightStyle { @@ -362,6 +369,13 @@ pub fn gruvbox() -> UserThemeFamily { ..Default::default() }, ), + ( + "constructor".into(), + UserHighlightStyle { + color: Some(rgba(0x8ec07cff).into()), + ..Default::default() + }, + ), ( "emphasis.strong".into(), UserHighlightStyle { @@ -626,6 +640,13 @@ pub fn gruvbox() -> UserThemeFamily { ..Default::default() }, ), + ( + "constructor".into(), + UserHighlightStyle { + color: Some(rgba(0x8ec07cff).into()), + ..Default::default() + }, + ), ( "emphasis.strong".into(), UserHighlightStyle { @@ -890,6 +911,13 @@ pub fn gruvbox() -> UserThemeFamily { ..Default::default() }, ), + ( + "constructor".into(), + UserHighlightStyle { + color: Some(rgba(0x427b58ff).into()), + ..Default::default() + }, + ), ( "emphasis.strong".into(), UserHighlightStyle { @@ -1154,6 +1182,13 @@ pub fn gruvbox() -> UserThemeFamily { ..Default::default() }, ), + ( + "constructor".into(), + UserHighlightStyle { + color: Some(rgba(0x427b58ff).into()), + ..Default::default() + }, + ), ( "emphasis.strong".into(), UserHighlightStyle { @@ -1418,6 +1453,13 @@ pub fn gruvbox() -> UserThemeFamily { ..Default::default() }, ), + ( + "constructor".into(), + UserHighlightStyle { + color: Some(rgba(0x427b58ff).into()), + ..Default::default() + }, + ), ( "emphasis.strong".into(), UserHighlightStyle { diff --git a/crates/theme2/src/themes/night_owl.rs b/crates/theme2/src/themes/night_owl.rs index 33246850f40dcd5d84baf920eece7ef4a56ac4b3..09b73c10dbd980873a58fbfeb17cde70672030cd 100644 --- a/crates/theme2/src/themes/night_owl.rs +++ b/crates/theme2/src/themes/night_owl.rs @@ -109,6 +109,13 @@ pub fn night_owl() -> UserThemeFamily { ..Default::default() }, ), + ( + "constructor".into(), + UserHighlightStyle { + color: Some(rgba(0xcaece6ff).into()), + ..Default::default() + }, + ), ( "function".into(), UserHighlightStyle { @@ -350,6 +357,13 @@ pub fn night_owl() -> UserThemeFamily { ..Default::default() }, ), + ( + "constructor".into(), + UserHighlightStyle { + color: Some(rgba(0x994cc3ff).into()), + ..Default::default() + }, + ), ( "function".into(), UserHighlightStyle { diff --git a/crates/theme2/src/themes/noctis.rs b/crates/theme2/src/themes/noctis.rs index 980ea7398d83b222130c6c6871ee475fb6ebb86b..a05422300c9c3a3afdff4838e1e4b3ceae4a2023 100644 --- a/crates/theme2/src/themes/noctis.rs +++ b/crates/theme2/src/themes/noctis.rs @@ -101,6 +101,13 @@ pub fn noctis() -> UserThemeFamily { ..Default::default() }, ), + ( + "constructor".into(), + UserHighlightStyle { + color: Some(rgba(0xe66533ff).into()), + ..Default::default() + }, + ), ( "function".into(), UserHighlightStyle { @@ -360,6 +367,13 @@ pub fn noctis() -> UserThemeFamily { ..Default::default() }, ), + ( + "constructor".into(), + UserHighlightStyle { + color: Some(rgba(0xe66533ff).into()), + ..Default::default() + }, + ), ( "function".into(), UserHighlightStyle { @@ -619,6 +633,13 @@ pub fn noctis() -> UserThemeFamily { ..Default::default() }, ), + ( + "constructor".into(), + UserHighlightStyle { + color: Some(rgba(0xe64100ff).into()), + ..Default::default() + }, + ), ( "function".into(), UserHighlightStyle { @@ -878,6 +899,13 @@ pub fn noctis() -> UserThemeFamily { ..Default::default() }, ), + ( + "constructor".into(), + UserHighlightStyle { + color: Some(rgba(0xe64100ff).into()), + ..Default::default() + }, + ), ( "function".into(), UserHighlightStyle { @@ -1137,6 +1165,13 @@ pub fn noctis() -> UserThemeFamily { ..Default::default() }, ), + ( + "constructor".into(), + UserHighlightStyle { + color: Some(rgba(0xe64100ff).into()), + ..Default::default() + }, + ), ( "function".into(), UserHighlightStyle { @@ -1396,6 +1431,13 @@ pub fn noctis() -> UserThemeFamily { ..Default::default() }, ), + ( + "constructor".into(), + UserHighlightStyle { + color: Some(rgba(0xc37455ff).into()), + ..Default::default() + }, + ), ( "function".into(), UserHighlightStyle { @@ -1655,6 +1697,13 @@ pub fn noctis() -> UserThemeFamily { ..Default::default() }, ), + ( + "constructor".into(), + UserHighlightStyle { + color: Some(rgba(0xe66533ff).into()), + ..Default::default() + }, + ), ( "function".into(), UserHighlightStyle { @@ -1914,6 +1963,13 @@ pub fn noctis() -> UserThemeFamily { ..Default::default() }, ), + ( + "constructor".into(), + UserHighlightStyle { + color: Some(rgba(0xe66533ff).into()), + ..Default::default() + }, + ), ( "function".into(), UserHighlightStyle { @@ -2173,6 +2229,13 @@ pub fn noctis() -> UserThemeFamily { ..Default::default() }, ), + ( + "constructor".into(), + UserHighlightStyle { + color: Some(rgba(0xe66533ff).into()), + ..Default::default() + }, + ), ( "function".into(), UserHighlightStyle { @@ -2432,6 +2495,13 @@ pub fn noctis() -> UserThemeFamily { ..Default::default() }, ), + ( + "constructor".into(), + UserHighlightStyle { + color: Some(rgba(0xe66533ff).into()), + ..Default::default() + }, + ), ( "function".into(), UserHighlightStyle { @@ -2691,6 +2761,13 @@ pub fn noctis() -> UserThemeFamily { ..Default::default() }, ), + ( + "constructor".into(), + UserHighlightStyle { + color: Some(rgba(0xe66533ff).into()), + ..Default::default() + }, + ), ( "function".into(), UserHighlightStyle { diff --git a/crates/theme2/src/themes/nord.rs b/crates/theme2/src/themes/nord.rs index ce281f0f69d84233e055d6ad698bc98f1db30c4d..ee32e56645aa8aad4cabd142e3a3d380f8c9cb74 100644 --- a/crates/theme2/src/themes/nord.rs +++ b/crates/theme2/src/themes/nord.rs @@ -107,6 +107,13 @@ pub fn nord() -> UserThemeFamily { ..Default::default() }, ), + ( + "constructor".into(), + UserHighlightStyle { + color: Some(rgba(0x81a1c1ff).into()), + ..Default::default() + }, + ), ( "function".into(), UserHighlightStyle { diff --git a/crates/theme2/src/themes/palenight.rs b/crates/theme2/src/themes/palenight.rs index 1200802fbce1a1de97c778f6e96e13fa5a166126..0b2cfaca9978ef660cf78cad228fb2ec5aa76e44 100644 --- a/crates/theme2/src/themes/palenight.rs +++ b/crates/theme2/src/themes/palenight.rs @@ -108,6 +108,13 @@ pub fn palenight() -> UserThemeFamily { ..Default::default() }, ), + ( + "constructor".into(), + UserHighlightStyle { + color: Some(rgba(0xff5572ff).into()), + ..Default::default() + }, + ), ( "emphasis".into(), UserHighlightStyle { @@ -376,6 +383,13 @@ pub fn palenight() -> UserThemeFamily { ..Default::default() }, ), + ( + "constructor".into(), + UserHighlightStyle { + color: Some(rgba(0xff5572ff).into()), + ..Default::default() + }, + ), ( "emphasis".into(), UserHighlightStyle { @@ -644,6 +658,13 @@ pub fn palenight() -> UserThemeFamily { ..Default::default() }, ), + ( + "constructor".into(), + UserHighlightStyle { + color: Some(rgba(0xff5572ff).into()), + ..Default::default() + }, + ), ( "emphasis".into(), UserHighlightStyle { diff --git a/crates/theme2/src/themes/rose_pine.rs b/crates/theme2/src/themes/rose_pine.rs index 8bc7fe8bc006f033d368ca85fd3274bea128aaf2..460903e2e5c2e05e514df1291a83fd5f5b04a240 100644 --- a/crates/theme2/src/themes/rose_pine.rs +++ b/crates/theme2/src/themes/rose_pine.rs @@ -110,6 +110,13 @@ pub fn rose_pine() -> UserThemeFamily { ..Default::default() }, ), + ( + "constructor".into(), + UserHighlightStyle { + color: Some(rgba(0x9ccfd8ff).into()), + ..Default::default() + }, + ), ( "function".into(), UserHighlightStyle { @@ -350,6 +357,13 @@ pub fn rose_pine() -> UserThemeFamily { ..Default::default() }, ), + ( + "constructor".into(), + UserHighlightStyle { + color: Some(rgba(0x9ccfd8ff).into()), + ..Default::default() + }, + ), ( "function".into(), UserHighlightStyle { @@ -590,6 +604,13 @@ pub fn rose_pine() -> UserThemeFamily { ..Default::default() }, ), + ( + "constructor".into(), + UserHighlightStyle { + color: Some(rgba(0x56949fff).into()), + ..Default::default() + }, + ), ( "function".into(), UserHighlightStyle { diff --git a/crates/theme2/src/themes/solarized.rs b/crates/theme2/src/themes/solarized.rs index 5d43b5704af9399ae966f88102d12462ebb35ba3..81171e0fb02885b8c3d6f9ed33675aa882ec90b3 100644 --- a/crates/theme2/src/themes/solarized.rs +++ b/crates/theme2/src/themes/solarized.rs @@ -103,6 +103,13 @@ pub fn solarized() -> UserThemeFamily { ..Default::default() }, ), + ( + "constructor".into(), + UserHighlightStyle { + color: Some(rgba(0x268bd2ff).into()), + ..Default::default() + }, + ), ( "embedded".into(), UserHighlightStyle { @@ -354,6 +361,13 @@ pub fn solarized() -> UserThemeFamily { ..Default::default() }, ), + ( + "constructor".into(), + UserHighlightStyle { + color: Some(rgba(0x268bd2ff).into()), + ..Default::default() + }, + ), ( "embedded".into(), UserHighlightStyle { diff --git a/crates/theme2/src/themes/synthwave_84.rs b/crates/theme2/src/themes/synthwave_84.rs index aeca085fd5fbcdd8f4eb17ce5291511a77537cd1..90e8a9c667c6032827f0f4cadc453d5314ec5712 100644 --- a/crates/theme2/src/themes/synthwave_84.rs +++ b/crates/theme2/src/themes/synthwave_84.rs @@ -92,6 +92,13 @@ pub fn synthwave_84() -> UserThemeFamily { ..Default::default() }, ), + ( + "constructor".into(), + UserHighlightStyle { + color: Some(rgba(0x72f1b8ff).into()), + ..Default::default() + }, + ), ( "function".into(), UserHighlightStyle { diff --git a/crates/theme_importer/src/vscode/syntax.rs b/crates/theme_importer/src/vscode/syntax.rs index e97839c9fe6db77d50ce57ae86fddfbec35be1de..262bd81f775da1ff3ff4ff1d257feb632e64f8bb 100644 --- a/crates/theme_importer/src/vscode/syntax.rs +++ b/crates/theme_importer/src/vscode/syntax.rs @@ -188,7 +188,10 @@ impl ZedSyntaxToken { ZedSyntaxToken::CommentDoc => vec!["comment.block.documentation"], ZedSyntaxToken::Constant => vec!["constant", "constant.language", "constant.character"], ZedSyntaxToken::Constructor => { - vec!["entity.name.function.definition.special.constructor"] + vec![ + "entity.name.tag", + "entity.name.function.definition.special.constructor", + ] } ZedSyntaxToken::Embedded => vec!["meta.embedded"], ZedSyntaxToken::Emphasis => vec!["markup.italic"],