Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Pull editor inlay hints from VS Code themes
Marshall Bowersfa223e0c6f51
diff --git a/crates/theme2/src/themes/andromeda.rs b/crates/theme2/src/themes/andromeda.rsindex 2a3c67c4b5a..16b2fa96326 100644--- a/crates/theme2/src/themes/andromeda.rs+++ b/crates/theme2/src/themes/andromeda.rs@@ -58,6 +58,7 @@ pub fn andromeda() -> UserThemeFamily {deleted: Some(rgba(0xfc634cff).into()),error: Some(rgba(0xfc634cff).into()),hidden: Some(rgba(0x746f77ff).into()),+ hint: Some(rgba(0x969696ff).into()),..Default::default()},syntax: Some(UserSyntaxTheme {@@ -201,6 +202,7 @@ pub fn andromeda() -> UserThemeFamily {deleted: Some(rgba(0xfc634cff).into()),error: Some(rgba(0xfc634cff).into()),hidden: Some(rgba(0x746f77ff).into()),+ hint: Some(rgba(0x969696ff).into()),..Default::default()},syntax: Some(UserSyntaxTheme {diff --git a/crates/theme2/src/themes/ayu.rs b/crates/theme2/src/themes/ayu.rsindex e83abc97a5d..8651ee20284 100644--- a/crates/theme2/src/themes/ayu.rs+++ b/crates/theme2/src/themes/ayu.rs@@ -62,6 +62,7 @@ pub fn ayu() -> UserThemeFamily {deleted: Some(rgba(0xe65050ff).into()),error: Some(rgba(0xe65050ff).into()),hidden: Some(rgba(0x8a9199ff).into()),+ hint: Some(rgba(0x969696ff).into()),..Default::default()},syntax: Some(UserSyntaxTheme {@@ -324,6 +325,7 @@ pub fn ayu() -> UserThemeFamily {deleted: Some(rgba(0xff6565ff).into()),error: Some(rgba(0xff6565ff).into()),hidden: Some(rgba(0x707a8cff).into()),+ hint: Some(rgba(0x969696ff).into()),..Default::default()},syntax: Some(UserSyntaxTheme {@@ -586,6 +588,7 @@ pub fn ayu() -> UserThemeFamily {deleted: Some(rgba(0xd95757ff).into()),error: Some(rgba(0xd95757ff).into()),hidden: Some(rgba(0x565b66ff).into()),+ hint: Some(rgba(0x969696ff).into()),..Default::default()},syntax: Some(UserSyntaxTheme {diff --git a/crates/theme2/src/themes/dracula.rs b/crates/theme2/src/themes/dracula.rsindex 7ff1250e49b..b5cf0e879f8 100644--- a/crates/theme2/src/themes/dracula.rs+++ b/crates/theme2/src/themes/dracula.rs@@ -62,6 +62,7 @@ pub fn dracula() -> UserThemeFamily {deleted: Some(rgba(0xff5555ff).into()),error: Some(rgba(0xff5555ff).into()),hidden: Some(rgba(0x6272a4ff).into()),+ hint: Some(rgba(0x969696ff).into()),warning: Some(rgba(0xffb76bff).into()),..Default::default()},diff --git a/crates/theme2/src/themes/gruvbox.rs b/crates/theme2/src/themes/gruvbox.rsindex c538e7c8404..16957b3597f 100644--- a/crates/theme2/src/themes/gruvbox.rs+++ b/crates/theme2/src/themes/gruvbox.rs@@ -61,6 +61,7 @@ pub fn gruvbox() -> UserThemeFamily {deleted: Some(rgba(0xfb4833ff).into()),error: Some(rgba(0xfb4833ff).into()),hidden: Some(rgba(0xa89984ff).into()),+ hint: Some(rgba(0x969696ff).into()),..Default::default()},syntax: Some(UserSyntaxTheme {@@ -251,6 +252,7 @@ pub fn gruvbox() -> UserThemeFamily {deleted: Some(rgba(0xfb4833ff).into()),error: Some(rgba(0xfb4833ff).into()),hidden: Some(rgba(0xa89984ff).into()),+ hint: Some(rgba(0x969696ff).into()),..Default::default()},syntax: Some(UserSyntaxTheme {@@ -441,6 +443,7 @@ pub fn gruvbox() -> UserThemeFamily {deleted: Some(rgba(0xfb4833ff).into()),error: Some(rgba(0xfb4833ff).into()),hidden: Some(rgba(0xa89984ff).into()),+ hint: Some(rgba(0x969696ff).into()),..Default::default()},syntax: Some(UserSyntaxTheme {@@ -631,6 +634,7 @@ pub fn gruvbox() -> UserThemeFamily {deleted: Some(rgba(0x9d0006ff).into()),error: Some(rgba(0x9d0006ff).into()),hidden: Some(rgba(0x7c6f64ff).into()),+ hint: Some(rgba(0x969696ff).into()),..Default::default()},syntax: Some(UserSyntaxTheme {@@ -821,6 +825,7 @@ pub fn gruvbox() -> UserThemeFamily {deleted: Some(rgba(0x9d0006ff).into()),error: Some(rgba(0x9d0006ff).into()),hidden: Some(rgba(0x7c6f64ff).into()),+ hint: Some(rgba(0x969696ff).into()),..Default::default()},syntax: Some(UserSyntaxTheme {@@ -1011,6 +1016,7 @@ pub fn gruvbox() -> UserThemeFamily {deleted: Some(rgba(0x9d0006ff).into()),error: Some(rgba(0x9d0006ff).into()),hidden: Some(rgba(0x7c6f64ff).into()),+ hint: Some(rgba(0x969696ff).into()),..Default::default()},syntax: Some(UserSyntaxTheme {diff --git a/crates/theme2/src/themes/night_owl.rs b/crates/theme2/src/themes/night_owl.rsindex 8a737cd2820..c84ea7ed091 100644--- a/crates/theme2/src/themes/night_owl.rs+++ b/crates/theme2/src/themes/night_owl.rs@@ -62,6 +62,7 @@ pub fn night_owl() -> UserThemeFamily {deleted: Some(rgba(0xef524fff).into()),error: Some(rgba(0xef524fff).into()),hidden: Some(rgba(0x5f7e97ff).into()),+ hint: Some(rgba(0x969696ff).into()),..Default::default()},syntax: Some(UserSyntaxTheme {@@ -242,6 +243,7 @@ pub fn night_owl() -> UserThemeFamily {deleted: Some(rgba(0x403f53ff).into()),error: Some(rgba(0x403f53ff).into()),hidden: Some(rgba(0x403f53ff).into()),+ hint: Some(rgba(0x969696ff).into()),warning: Some(rgba(0xdaa900ff).into()),..Default::default()},diff --git a/crates/theme2/src/themes/noctis.rs b/crates/theme2/src/themes/noctis.rsindex 442c86ad55a..416907c305c 100644--- a/crates/theme2/src/themes/noctis.rs+++ b/crates/theme2/src/themes/noctis.rs@@ -63,6 +63,7 @@ pub fn noctis() -> UserThemeFamily {deleted: Some(rgba(0xe34d1bff).into()),error: Some(rgba(0xe34d1bff).into()),hidden: Some(rgba(0x9fb6c6ff).into()),+ hint: Some(rgba(0x969696ff).into()),warning: Some(rgba(0xffa857ff).into()),..Default::default()},@@ -282,6 +283,7 @@ pub fn noctis() -> UserThemeFamily {deleted: Some(rgba(0xe34d1bff).into()),error: Some(rgba(0xe34d1bff).into()),hidden: Some(rgba(0xbbaab0ff).into()),+ hint: Some(rgba(0x969696ff).into()),warning: Some(rgba(0xffa857ff).into()),..Default::default()},@@ -501,6 +503,7 @@ pub fn noctis() -> UserThemeFamily {deleted: Some(rgba(0xff3f00ff).into()),error: Some(rgba(0xff3f00ff).into()),hidden: Some(rgba(0x70838dff).into()),+ hint: Some(rgba(0x969696ff).into()),warning: Some(rgba(0xe07a52ff).into()),..Default::default()},@@ -720,6 +723,7 @@ pub fn noctis() -> UserThemeFamily {deleted: Some(rgba(0xff3f00ff).into()),error: Some(rgba(0xff3f00ff).into()),hidden: Some(rgba(0x74708dff).into()),+ hint: Some(rgba(0x969696ff).into()),warning: Some(rgba(0xe07a52ff).into()),..Default::default()},@@ -939,6 +943,7 @@ pub fn noctis() -> UserThemeFamily {deleted: Some(rgba(0xff3f00ff).into()),error: Some(rgba(0xff3f00ff).into()),hidden: Some(rgba(0x878476ff).into()),+ hint: Some(rgba(0x969696ff).into()),warning: Some(rgba(0xe07a52ff).into()),..Default::default()},@@ -1158,6 +1163,7 @@ pub fn noctis() -> UserThemeFamily {deleted: Some(rgba(0xb96245ff).into()),error: Some(rgba(0xb96245ff).into()),hidden: Some(rgba(0x96a8b6ff).into()),+ hint: Some(rgba(0x969696ff).into()),warning: Some(rgba(0xffa857ff).into()),..Default::default()},@@ -1377,6 +1383,7 @@ pub fn noctis() -> UserThemeFamily {deleted: Some(rgba(0xe34d1bff).into()),error: Some(rgba(0xe34d1bff).into()),hidden: Some(rgba(0x87a7abff).into()),+ hint: Some(rgba(0x969696ff).into()),warning: Some(rgba(0xffa487ff).into()),..Default::default()},@@ -1596,6 +1603,7 @@ pub fn noctis() -> UserThemeFamily {deleted: Some(rgba(0xe34d1bff).into()),error: Some(rgba(0xe34d1bff).into()),hidden: Some(rgba(0x87a7abff).into()),+ hint: Some(rgba(0x969696ff).into()),warning: Some(rgba(0xffa487ff).into()),..Default::default()},@@ -1815,6 +1823,7 @@ pub fn noctis() -> UserThemeFamily {deleted: Some(rgba(0xe34d1bff).into()),error: Some(rgba(0xe34d1bff).into()),hidden: Some(rgba(0x87a7abff).into()),+ hint: Some(rgba(0x969696ff).into()),warning: Some(rgba(0xffa487ff).into()),..Default::default()},@@ -2034,6 +2043,7 @@ pub fn noctis() -> UserThemeFamily {deleted: Some(rgba(0xe34d1bff).into()),error: Some(rgba(0xe34d1bff).into()),hidden: Some(rgba(0xa9a5c0ff).into()),+ hint: Some(rgba(0x969696ff).into()),warning: Some(rgba(0xffa857ff).into()),..Default::default()},@@ -2253,6 +2263,7 @@ pub fn noctis() -> UserThemeFamily {deleted: Some(rgba(0xe34d1bff).into()),error: Some(rgba(0xe34d1bff).into()),hidden: Some(rgba(0xb3a5c0ff).into()),+ hint: Some(rgba(0x969696ff).into()),warning: Some(rgba(0xffa857ff).into()),..Default::default()},diff --git a/crates/theme2/src/themes/nord.rs b/crates/theme2/src/themes/nord.rsindex 093456b0297..0c40275617b 100644--- a/crates/theme2/src/themes/nord.rs+++ b/crates/theme2/src/themes/nord.rs@@ -62,6 +62,7 @@ pub fn nord() -> UserThemeFamily {deleted: Some(rgba(0xbf616aff).into()),error: Some(rgba(0xbf616aff).into()),hidden: Some(rgba(0xd8dee966).into()),+ hint: Some(rgba(0xd8dee9ff).into()),warning: Some(rgba(0xebcb8bff).into()),..Default::default()},diff --git a/crates/theme2/src/themes/palenight.rs b/crates/theme2/src/themes/palenight.rsindex 49428cd3679..f0f8e4f170d 100644--- a/crates/theme2/src/themes/palenight.rs+++ b/crates/theme2/src/themes/palenight.rs@@ -62,6 +62,7 @@ pub fn palenight() -> UserThemeFamily {deleted: Some(rgba(0xef524fff).into()),error: Some(rgba(0xef524fff).into()),hidden: Some(rgba(0x9199c8ff).into()),+ hint: Some(rgba(0x969696ff).into()),..Default::default()},syntax: Some(UserSyntaxTheme {@@ -268,6 +269,7 @@ pub fn palenight() -> UserThemeFamily {deleted: Some(rgba(0xef524fff).into()),error: Some(rgba(0xef524fff).into()),hidden: Some(rgba(0x9199c8ff).into()),+ hint: Some(rgba(0x969696ff).into()),..Default::default()},syntax: Some(UserSyntaxTheme {@@ -474,6 +476,7 @@ pub fn palenight() -> UserThemeFamily {deleted: Some(rgba(0xef524fff).into()),error: Some(rgba(0xef524fff).into()),hidden: Some(rgba(0x9199c8ff).into()),+ hint: Some(rgba(0x969696ff).into()),..Default::default()},syntax: Some(UserSyntaxTheme {diff --git a/crates/theme2/src/themes/rose_pine.rs b/crates/theme2/src/themes/rose_pine.rsindex 6898246d091..42f0b50524f 100644--- a/crates/theme2/src/themes/rose_pine.rs+++ b/crates/theme2/src/themes/rose_pine.rs@@ -62,6 +62,7 @@ pub fn rose_pine() -> UserThemeFamily {deleted: Some(rgba(0xeb6f92ff).into()),error: Some(rgba(0xeb6f92ff).into()),hidden: Some(rgba(0x908caaff).into()),+ hint: Some(rgba(0x908caaff).into()),warning: Some(rgba(0xf5c177ff).into()),..Default::default()},@@ -228,6 +229,7 @@ pub fn rose_pine() -> UserThemeFamily {deleted: Some(rgba(0xeb6f92ff).into()),error: Some(rgba(0xeb6f92ff).into()),hidden: Some(rgba(0x908caaff).into()),+ hint: Some(rgba(0x908caaff).into()),warning: Some(rgba(0xf5c177ff).into()),..Default::default()},@@ -394,6 +396,7 @@ pub fn rose_pine() -> UserThemeFamily {deleted: Some(rgba(0xb3627aff).into()),error: Some(rgba(0xb3627aff).into()),hidden: Some(rgba(0x797593ff).into()),+ hint: Some(rgba(0x797593ff).into()),warning: Some(rgba(0xea9d34ff).into()),..Default::default()},diff --git a/crates/theme2/src/themes/solarized.rs b/crates/theme2/src/themes/solarized.rsindex 65411dbe20d..87221b4a853 100644--- a/crates/theme2/src/themes/solarized.rs+++ b/crates/theme2/src/themes/solarized.rs@@ -59,6 +59,7 @@ pub fn solarized() -> UserThemeFamily {deleted: Some(rgba(0xffeaeaff).into()),error: Some(rgba(0xffeaeaff).into()),hidden: Some(rgba(0x93a1a1ff).into()),+ hint: Some(rgba(0x969696ff).into()),..Default::default()},syntax: Some(UserSyntaxTheme {@@ -243,6 +244,7 @@ pub fn solarized() -> UserThemeFamily {},status: StatusColorsRefinement {hidden: Some(rgba(0x586e75ff).into()),+ hint: Some(rgba(0x969696ff).into()),..Default::default()},syntax: Some(UserSyntaxTheme {diff --git a/crates/theme2/src/themes/synthwave_84.rs b/crates/theme2/src/themes/synthwave_84.rsindex 0751e9466d8..fc006a7c5a2 100644--- a/crates/theme2/src/themes/synthwave_84.rs+++ b/crates/theme2/src/themes/synthwave_84.rs@@ -47,6 +47,7 @@ pub fn synthwave_84() -> UserThemeFamily {status: StatusColorsRefinement {deleted: Some(rgba(0xfe444fff).into()),error: Some(rgba(0xfe444fff).into()),+ hint: Some(rgba(0x969696ff).into()),warning: Some(rgba(0x71f1b7bb).into()),..Default::default()},diff --git a/crates/theme_importer/src/theme_printer.rs b/crates/theme_importer/src/theme_printer.rsindex 9664d843dce..dae98d313c4 100644--- a/crates/theme_importer/src/theme_printer.rs+++ b/crates/theme_importer/src/theme_printer.rs@@ -283,11 +283,14 @@ impl<'a> Debug for StatusColorsRefinementPrinter<'a> {("deleted", self.0.deleted),("error", self.0.error),("hidden", self.0.hidden),+ ("hint", self.0.hint),("ignored", self.0.ignored),("info", self.0.info),("modified", self.0.modified),+ ("predictive", self.0.predictive),("renamed", self.0.renamed),("success", self.0.success),+ ("unreachable", self.0.unreachable),("warning", self.0.warning),];diff --git a/crates/theme_importer/src/vscode/converter.rs b/crates/theme_importer/src/vscode/converter.rsindex 3a2c920f7be..83558b874a4 100644--- a/crates/theme_importer/src/vscode/converter.rs+++ b/crates/theme_importer/src/vscode/converter.rs@@ -1,5 +1,5 @@use anyhow::Result;-use gpui::{Hsla, Rgba};+use gpui::{rgba, Hsla, Rgba};use indexmap::IndexMap;use strum::IntoEnumIterator;use theme::{@@ -66,6 +66,11 @@ impl VsCodeThemeConverter {fn convert_status_colors(&self) -> Result<StatusColorsRefinement> {let vscode_colors = &self.theme.colors;+ let vscode_base_status_colors = StatusColorsRefinement {+ hint: Some(rgba(0x969696ff).into()),+ ..Default::default()+ };+Ok(StatusColorsRefinement {// conflict: None,// created: None,@@ -81,6 +86,11 @@ impl VsCodeThemeConverter {.tab_inactive_foreground.as_ref().traverse(|color| try_parse_color(&color))?,+ hint: vscode_colors+ .editor_inlay_hint_foreground+ .as_ref()+ .traverse(|color| try_parse_color(&color))?+ .or(vscode_base_status_colors.hint),// ignored: None,// info: None,// modified: None,diff --git a/crates/theme_importer/src/vscode/theme.rs b/crates/theme_importer/src/vscode/theme.rsindex 76e3c02b34a..d2c1136d7b4 100644--- a/crates/theme_importer/src/vscode/theme.rs+++ b/crates/theme_importer/src/vscode/theme.rs@@ -163,6 +163,18 @@ pub struct VsCodeColors {pub editor_foreground: Option<String>,#[serde(rename = "editor.background")]pub editor_background: Option<String>,+ #[serde(rename = "editorInlayHint.foreground")]+ pub editor_inlay_hint_foreground: Option<String>,+ #[serde(rename = "editorInlayHint.background")]+ pub editor_inlay_hint_background: Option<String>,+ #[serde(rename = "editorInlayHint.parameterForeground")]+ pub editor_inlay_hint_parameter_foreground: Option<String>,+ #[serde(rename = "editorInlayHint.parameterBackground")]+ pub editor_inlay_hint_parameter_background: Option<String>,+ #[serde(rename = "editorInlayHint.typForeground")]+ pub editor_inlay_hint_typ_foreground: Option<String>,+ #[serde(rename = "editorInlayHint.typBackground")]+ pub editor_inlay_hint_typ_background: Option<String>,#[serde(rename = "editorLineNumber.foreground")]pub editor_line_number_foreground: Option<String>,#[serde(rename = "editor.selectionBackground")]