theme_importer: Define more colors in VsCodeTheme (#6960)

This PR extends the `VsCodeTheme` struct with more of the colors
available on a VS Code theme.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2024-01-28 21:55:40 -05:00 committed by GitHub
parent 331b6e7e6e
commit 5d0c144ce7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 118 additions and 1626 deletions

86
Cargo.lock generated
View File

@ -493,7 +493,7 @@ checksum = "5fd55a5ba1179988837d24ab4c7cc8ed6efdeff578ede0416b4225a5fca35bd0"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.37",
"syn 2.0.48",
]
[[package]]
@ -541,7 +541,7 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.37",
"syn 2.0.48",
]
[[package]]
@ -585,7 +585,7 @@ checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.37",
"syn 2.0.48",
]
[[package]]
@ -854,7 +854,7 @@ dependencies = [
"regex",
"rustc-hash",
"shlex",
"syn 2.0.37",
"syn 2.0.48",
"which",
]
@ -1308,7 +1308,7 @@ dependencies = [
"heck 0.4.1",
"proc-macro2",
"quote",
"syn 2.0.37",
"syn 2.0.48",
]
[[package]]
@ -1950,7 +1950,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "30d2b3721e861707777e3195b0158f950ae6dc4a27e4d02ff9f67e3eb3de199e"
dependencies = [
"quote",
"syn 2.0.37",
"syn 2.0.48",
]
[[package]]
@ -2678,7 +2678,7 @@ checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.37",
"syn 2.0.48",
]
[[package]]
@ -2880,7 +2880,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.37",
"syn 2.0.48",
]
[[package]]
@ -3506,7 +3506,7 @@ checksum = "ce243b1bfa62ffc028f1cc3b6034ec63d649f3031bc8a4fbbb004e1ac17d1f68"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.37",
"syn 2.0.48",
]
[[package]]
@ -3949,7 +3949,7 @@ checksum = "ba125974b109d512fccbc6c0244e7580143e460895dfd6ea7f8bbb692fd94396"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.37",
"syn 2.0.48",
]
[[package]]
@ -4848,7 +4848,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.37",
"syn 2.0.48",
]
[[package]]
@ -4914,7 +4914,7 @@ dependencies = [
"proc-macro-error",
"proc-macro2",
"quote",
"syn 2.0.37",
"syn 2.0.48",
]
[[package]]
@ -4963,7 +4963,7 @@ checksum = "b7db010ec5ff3d4385e4f133916faacd9dad0f6a09394c92d825b3aed310fa0a"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.37",
"syn 2.0.48",
]
[[package]]
@ -5171,7 +5171,7 @@ dependencies = [
"phf_shared",
"proc-macro2",
"quote",
"syn 2.0.37",
"syn 2.0.48",
]
[[package]]
@ -5224,7 +5224,7 @@ checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.37",
"syn 2.0.48",
]
[[package]]
@ -5428,7 +5428,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ae005bd773ab59b4725093fd7df83fd7892f7d8eafb48dbd7de6e024e4215f9d"
dependencies = [
"proc-macro2",
"syn 2.0.37",
"syn 2.0.48",
]
[[package]]
@ -5476,9 +5476,9 @@ dependencies = [
[[package]]
name = "proc-macro2"
version = "1.0.67"
version = "1.0.78"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3d433d9f1a3e8c1263d9456598b16fec66f4acc9a74dacffd35c7bb09b3a1328"
checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae"
dependencies = [
"unicode-ident",
]
@ -5764,9 +5764,9 @@ dependencies = [
[[package]]
name = "quote"
version = "1.0.33"
version = "1.0.35"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae"
checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef"
dependencies = [
"proc-macro2",
]
@ -6310,7 +6310,7 @@ dependencies = [
"proc-macro2",
"quote",
"rust-embed-utils",
"syn 2.0.37",
"syn 2.0.48",
"walkdir",
]
@ -6595,7 +6595,7 @@ dependencies = [
"proc-macro-error",
"proc-macro2",
"quote",
"syn 2.0.37",
"syn 2.0.48",
]
[[package]]
@ -6636,7 +6636,7 @@ dependencies = [
"proc-macro2",
"quote",
"sea-bae",
"syn 2.0.37",
"syn 2.0.48",
"unicode-ident",
]
@ -6797,22 +6797,22 @@ checksum = "5a9f47faea3cad316faa914d013d24f471cd90bfca1a0c70f05a3f42c6441e99"
[[package]]
name = "serde"
version = "1.0.188"
version = "1.0.196"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e"
checksum = "870026e60fa08c69f064aa766c10f10b1d62db9ccd4d0abb206472bee0ce3b32"
dependencies = [
"serde_derive",
]
[[package]]
name = "serde_derive"
version = "1.0.188"
version = "1.0.196"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2"
checksum = "33c85360c95e7d137454dc81d9a4ed2b8efd8fbe19cee57357b32b9771fccb67"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.37",
"syn 2.0.48",
]
[[package]]
@ -6867,7 +6867,7 @@ checksum = "8725e1dfadb3a50f7e5ce0b1a540466f6ed3fe7a0fca2ac2b8b831d31316bd00"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.37",
"syn 2.0.48",
]
[[package]]
@ -7537,7 +7537,7 @@ dependencies = [
"proc-macro2",
"quote",
"rustversion",
"syn 2.0.37",
"syn 2.0.48",
]
[[package]]
@ -7664,9 +7664,9 @@ dependencies = [
[[package]]
name = "syn"
version = "2.0.37"
version = "2.0.48"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7303ef2c05cd654186cb250d29049a24840ca25d2747c25c0381c8d9e2f582e8"
checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f"
dependencies = [
"proc-macro2",
"quote",
@ -7891,6 +7891,7 @@ dependencies = [
"strum",
"theme",
"uuid 1.4.1",
"vscode_theme",
]
[[package]]
@ -7932,7 +7933,7 @@ checksum = "49922ecae66cc8a249b77e68d1d0623c1b2c514f0060c27cdc68bd62a1219d35"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.37",
"syn 2.0.48",
]
[[package]]
@ -8095,7 +8096,7 @@ checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.37",
"syn 2.0.48",
]
[[package]]
@ -8289,7 +8290,7 @@ checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.37",
"syn 2.0.48",
]
[[package]]
@ -9038,6 +9039,15 @@ dependencies = [
"zed_actions",
]
[[package]]
name = "vscode_theme"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8b3666211944f2e6ba2c359bc9efc1891157e910b1b11c3900892ea9f18179d2"
dependencies = [
"serde",
]
[[package]]
name = "vte"
version = "0.13.0"
@ -9120,7 +9130,7 @@ dependencies = [
"once_cell",
"proc-macro2",
"quote",
"syn 2.0.37",
"syn 2.0.48",
"wasm-bindgen-shared",
]
@ -9154,7 +9164,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.37",
"syn 2.0.48",
"wasm-bindgen-backend",
"wasm-bindgen-shared",
]
@ -9797,7 +9807,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.37",
"syn 2.0.48",
]
[[package]]

View File

@ -25,3 +25,4 @@ simplelog = "0.9"
strum = { version = "0.25.0", features = ["derive"] }
theme = { path = "../theme" }
uuid.workspace = true
vscode_theme = "0.2.0"

View File

@ -74,31 +74,34 @@ impl VsCodeThemeConverter {
Ok(StatusColorsContent {
conflict: vscode_colors
.git_decoration_conflicting_resource_foreground
.git_decoration
.conflicting_resource_foreground
.clone(),
created: vscode_colors.editor_gutter_added_background.clone(),
deleted: vscode_colors.editor_gutter_deleted_background.clone(),
error: vscode_colors.editor_error_foreground.clone(),
error_background: vscode_colors.editor_error_background.clone(),
error_border: vscode_colors.editor_error_border.clone(),
hidden: vscode_colors.tab_inactive_foreground.clone(),
created: vscode_colors.editor_gutter.added_background.clone(),
deleted: vscode_colors.editor_gutter.deleted_background.clone(),
error: vscode_colors.editor_error.foreground.clone(),
error_background: vscode_colors.editor_error.background.clone(),
error_border: vscode_colors.editor_error.border.clone(),
hidden: vscode_colors.tab.inactive_foreground.clone(),
hint: vscode_colors
.editor_inlay_hint_foreground
.editor_inlay_hint
.foreground
.clone()
.or(vscode_base_status_colors.hint),
hint_border: vscode_colors.editor_hint_border.clone(),
hint_border: vscode_colors.editor_hint.border.clone(),
ignored: vscode_colors
.git_decoration_ignored_resource_foreground
.git_decoration
.ignored_resource_foreground
.clone(),
info: vscode_colors.editor_info_foreground.clone(),
info_background: vscode_colors.editor_info_background.clone(),
info_border: vscode_colors.editor_info_border.clone(),
modified: vscode_colors.editor_gutter_modified_background.clone(),
info: vscode_colors.editor_info.foreground.clone(),
info_background: vscode_colors.editor_info.background.clone(),
info_border: vscode_colors.editor_info.border.clone(),
modified: vscode_colors.editor_gutter.modified_background.clone(),
// renamed: None,
// success: None,
warning: vscode_colors.editor_warning_foreground.clone(),
warning_background: vscode_colors.editor_warning_background.clone(),
warning_border: vscode_colors.editor_warning_border.clone(),
warning: vscode_colors.editor_warning.foreground.clone(),
warning_background: vscode_colors.editor_warning.background.clone(),
warning_border: vscode_colors.editor_warning.border.clone(),
..Default::default()
})
}
@ -106,11 +109,11 @@ impl VsCodeThemeConverter {
fn convert_theme_colors(&self) -> Result<ThemeColorsContent> {
let vscode_colors = &self.theme.colors;
let vscode_panel_border = vscode_colors.panel_border.clone();
let vscode_tab_inactive_background = vscode_colors.tab_inactive_background.clone();
let vscode_editor_foreground = vscode_colors.editor_foreground.clone();
let vscode_editor_background = vscode_colors.editor_background.clone();
let vscode_scrollbar_slider_background = vscode_colors.scrollbar_slider_background.clone();
let vscode_panel_border = vscode_colors.panel.border.clone();
let vscode_tab_inactive_background = vscode_colors.tab.inactive_background.clone();
let vscode_editor_foreground = vscode_colors.editor.foreground.clone();
let vscode_editor_background = vscode_colors.editor.background.clone();
let vscode_scrollbar_slider_background = vscode_colors.scrollbar_slider.background.clone();
let vscode_token_colors_foreground = self
.theme
.token_colors
@ -126,68 +129,71 @@ impl VsCodeThemeConverter {
border_selected: vscode_panel_border.clone(),
border_transparent: vscode_panel_border.clone(),
border_disabled: vscode_panel_border.clone(),
elevated_surface_background: vscode_colors.dropdown_background.clone(),
surface_background: vscode_colors.panel_background.clone(),
elevated_surface_background: vscode_colors.dropdown.background.clone(),
surface_background: vscode_colors.panel.background.clone(),
background: vscode_editor_background.clone(),
element_background: vscode_colors.button_background.clone(),
element_hover: vscode_colors.list_hover_background.clone(),
element_selected: vscode_colors.list_active_selection_background.clone(),
drop_target_background: vscode_colors.list_drop_background.clone(),
ghost_element_hover: vscode_colors.list_hover_background.clone(),
ghost_element_selected: vscode_colors.list_active_selection_background.clone(),
element_background: vscode_colors.button.background.clone(),
element_hover: vscode_colors.list.hover_background.clone(),
element_selected: vscode_colors.list.active_selection_background.clone(),
drop_target_background: vscode_colors.list.drop_background.clone(),
ghost_element_hover: vscode_colors.list.hover_background.clone(),
ghost_element_selected: vscode_colors.list.active_selection_background.clone(),
text: vscode_colors
.foreground
.clone()
.or(vscode_token_colors_foreground.clone()),
text_muted: vscode_colors.tab_inactive_foreground.clone(),
status_bar_background: vscode_colors.status_bar_background.clone(),
title_bar_background: vscode_colors.title_bar_active_background.clone(),
text_muted: vscode_colors.tab.inactive_foreground.clone(),
status_bar_background: vscode_colors.status_bar.background.clone(),
title_bar_background: vscode_colors.title_bar.active_background.clone(),
toolbar_background: vscode_colors
.breadcrumb_background
.breadcrumb
.background
.clone()
.or(vscode_editor_background.clone()),
tab_bar_background: vscode_colors.editor_group_header_tabs_background.clone(),
tab_bar_background: vscode_colors.editor_group_header.tabs_background.clone(),
tab_inactive_background: vscode_tab_inactive_background.clone(),
tab_active_background: vscode_colors
.tab_active_background
.tab
.active_background
.clone()
.or(vscode_tab_inactive_background.clone()),
panel_background: vscode_colors.panel_background.clone(),
panel_background: vscode_colors.panel.background.clone(),
scrollbar_thumb_background: vscode_scrollbar_slider_background.clone(),
scrollbar_thumb_hover_background: vscode_colors
.scrollbar_slider_hover_background
.scrollbar_slider
.hover_background
.clone(),
scrollbar_thumb_border: vscode_scrollbar_slider_background.clone(),
scrollbar_track_background: vscode_editor_background.clone(),
scrollbar_track_border: vscode_colors.editor_overview_ruler_border.clone(),
scrollbar_track_border: vscode_colors.editor_overview_ruler.border.clone(),
editor_foreground: vscode_editor_foreground
.clone()
.or(vscode_token_colors_foreground.clone()),
editor_background: vscode_editor_background.clone(),
editor_gutter_background: vscode_editor_background.clone(),
editor_active_line_background: vscode_colors.editor_line_highlight_background.clone(),
editor_line_number: vscode_colors.editor_line_number_foreground.clone(),
editor_active_line_number: vscode_colors.editor_foreground.clone(),
editor_active_line_background: vscode_colors.editor.line_highlight_background.clone(),
editor_line_number: vscode_colors.editor_line_number.foreground.clone(),
editor_active_line_number: vscode_colors.editor.foreground.clone(),
editor_wrap_guide: vscode_panel_border.clone(),
editor_active_wrap_guide: vscode_panel_border.clone(),
terminal_background: vscode_colors.terminal_background.clone(),
terminal_ansi_black: vscode_colors.terminal_ansi_black.clone(),
terminal_ansi_bright_black: vscode_colors.terminal_ansi_bright_black.clone(),
terminal_ansi_red: vscode_colors.terminal_ansi_red.clone(),
terminal_ansi_bright_red: vscode_colors.terminal_ansi_bright_red.clone(),
terminal_ansi_green: vscode_colors.terminal_ansi_green.clone(),
terminal_ansi_bright_green: vscode_colors.terminal_ansi_bright_green.clone(),
terminal_ansi_yellow: vscode_colors.terminal_ansi_yellow.clone(),
terminal_ansi_bright_yellow: vscode_colors.terminal_ansi_bright_yellow.clone(),
terminal_ansi_blue: vscode_colors.terminal_ansi_blue.clone(),
terminal_ansi_bright_blue: vscode_colors.terminal_ansi_bright_blue.clone(),
terminal_ansi_magenta: vscode_colors.terminal_ansi_magenta.clone(),
terminal_ansi_bright_magenta: vscode_colors.terminal_ansi_bright_magenta.clone(),
terminal_ansi_cyan: vscode_colors.terminal_ansi_cyan.clone(),
terminal_ansi_bright_cyan: vscode_colors.terminal_ansi_bright_cyan.clone(),
terminal_ansi_white: vscode_colors.terminal_ansi_white.clone(),
terminal_ansi_bright_white: vscode_colors.terminal_ansi_bright_white.clone(),
link_text_hover: vscode_colors.text_link_active_foreground.clone(),
terminal_background: vscode_colors.terminal.background.clone(),
terminal_ansi_black: vscode_colors.terminal.ansi_black.clone(),
terminal_ansi_bright_black: vscode_colors.terminal.ansi_bright_black.clone(),
terminal_ansi_red: vscode_colors.terminal.ansi_red.clone(),
terminal_ansi_bright_red: vscode_colors.terminal.ansi_bright_red.clone(),
terminal_ansi_green: vscode_colors.terminal.ansi_green.clone(),
terminal_ansi_bright_green: vscode_colors.terminal.ansi_bright_green.clone(),
terminal_ansi_yellow: vscode_colors.terminal.ansi_yellow.clone(),
terminal_ansi_bright_yellow: vscode_colors.terminal.ansi_bright_yellow.clone(),
terminal_ansi_blue: vscode_colors.terminal.ansi_blue.clone(),
terminal_ansi_bright_blue: vscode_colors.terminal.ansi_bright_blue.clone(),
terminal_ansi_magenta: vscode_colors.terminal.ansi_magenta.clone(),
terminal_ansi_bright_magenta: vscode_colors.terminal.ansi_bright_magenta.clone(),
terminal_ansi_cyan: vscode_colors.terminal.ansi_cyan.clone(),
terminal_ansi_bright_cyan: vscode_colors.terminal.ansi_bright_cyan.clone(),
terminal_ansi_white: vscode_colors.terminal.ansi_white.clone(),
terminal_ansi_bright_white: vscode_colors.terminal.ansi_bright_white.clone(),
link_text_hover: vscode_colors.text_link.active_foreground.clone(),
..Default::default()
})
}

File diff suppressed because it is too large Load Diff