Commit Graph

143 Commits

Author SHA1 Message Date
Nate Butler
9c91b65ce2 Use mostly base theme
Co-Authored-By: Marshall Bowers <1486634+maxdeviant@users.noreply.github.com>
2024-01-02 14:30:11 -05:00
Nate Butler
7ea9725125 Start using base theme in zed1 theme importer
Co-Authored-By: Marshall Bowers <1486634+maxdeviant@users.noreply.github.com>
2024-01-02 14:21:20 -05:00
Marshall Bowers
853192b059
Map suggestion colors from Zed1 themes (#3835)
This PR maps the suggestions colors from the Zed1 themes to the Zed2
themes.

Release Notes:

- N/A
2024-01-02 12:08:29 -05:00
Marshall Bowers
f5b3e473fc
theme_importer: Map drop target colors (#3830)
This PR maps the drop target background color in the `theme_importer`.

Release Notes:

- N/A
2024-01-02 10:40:24 -05:00
Nathan Sobo
02f7e681a7 Import elevated surface color from hover popover 2023-12-27 11:58:26 -07:00
Marshall Bowers
698460ea89
Style inlay hints (#3806)
This PR styles the inlay hints after the changes to the themes.

Release Notes:

- N/A
2023-12-22 23:06:30 -05:00
Marshall Bowers
e5148b4a1b
Assign player colors from the theme (#3805)
This PR updates the `theme_importer` to pull in the player colors so
that we can assign them based on the current theme.

Release Notes:

- N/A
2023-12-22 22:28:41 -05:00
Marshall Bowers
04d26353d2 Adjust muted text colors 2023-12-22 21:25:45 -05:00
Marshall Bowers
9cb613245e Adjust border colors 2023-12-22 21:18:43 -05:00
Marshall Bowers
e8a14b1971 Adjust color used for text 2023-12-22 21:10:53 -05:00
Marshall Bowers
1ebfafc03d
Map additional text colors from Zed1 themes (#3796)
This PR maps additional text colors from the Zed1 themes to the Zed2
themes.

Release Notes:

- N/A
2023-12-22 18:45:58 -05:00
Marshall Bowers
b501f4eafc
Begin porting Zed1 themes to Zed2 (#3793)
This PR is a first pass at porting the Zed1 themes to Zed2.

For the initial release of Zed2 we'll be shipping just the themes that
existed in Zed1, ported to Zed2. The new themes that were previously
added just in Zed2 have been removed.

Release Notes:

- N/A
2023-12-22 17:37:53 -05:00
Marshall Bowers
dc64411cca
Extend theme_importer in preparation for importing Zed1 themes (#3791)
This PR extends the `theme_importer` with the overall structure required
to support importing themes from Zed1.

Release Notes:

- N/A
2023-12-22 13:47:30 -05:00
Marshall Bowers
80143b2571
Fix names for Rosé Pine themes (#3771)
This PR fixes the names of the Rosé Pine themes.

We want to keep the Unicode "é" in the theme name, both because this is
the actual name of the theme, and also to maintain parity with Zed1.

Release Notes:

- N/A
2023-12-21 22:45:29 -05:00
Marshall Bowers
afcf6c6852 Map textLink.activeForeground from VS Code to link_text_hover 2023-12-19 18:29:27 -05:00
Marshall Bowers
912f7e6c1a
Add ability to warn on missing theme values (#3705)
This PR adds the ability to warn in the `theme_importer` when a theme is
missing values.

Providing the `--warn-on-missing` flag to the `theme_importer` will
print a warning for missing theme value when printing the theme.

```sh
cargo run -p theme_importer -- --warn-on-missing
```

Release Notes:

- N/A
2023-12-18 17:18:49 -05:00
Nate Butler
da7628cc1e Style wrap guides for imported themes 2023-12-18 11:16:22 -05:00
Marshall Bowers
292fac37bb Use editor.foreground from VS Code for the editor foreground 2023-12-14 17:30:37 -05:00
Marshall Bowers
8bac4e199d Emit editor_foreground color from theme converter 2023-12-14 17:28:45 -05:00
Marshall Bowers
3120a9cbea
theme_importer: Fall back to inactive tab background if no active tab background set (#3598)
This PR makes it so the `theme_importer` falls back to the inactive tab
background color if the theme doesn't not an active tab background
color.

This fixes the active tab color in the Synthwave 84 theme.

Release Notes:

- N/A
2023-12-11 17:39:46 -05:00
Marshall Bowers
e271bbe896 Use editorOverviewRuler.border for the scrollbar track border 2023-12-11 16:54:53 -05:00
Marshall Bowers
dfd1b5aa11 Use the editor background for the scrollbar track background 2023-12-11 16:39:26 -05:00
Marshall Bowers
41f55e4d0d
Use tab.inactiveForeground from VS Code for muted text color (#3593)
This PR updates the `theme_importer` to pull in the
`tab.inactiveForeground` color from VS Code to use as the muted text
color.

Release Notes:

- N/A
2023-12-11 15:57:47 -05:00
Marshall Bowers
fe46459982 Pull more scrollbar colors from VS Code 2023-12-11 12:59:03 -05:00
Marshall Bowers
3271cf1030 Map scrollbar colors from VS Code themes 2023-12-11 12:49:54 -05:00
Marshall Bowers
008c56a09b
Adjust which status colors we import from the VS Code theme (#3570)
This PR adjusts the status colors we import from the VS Code theme to be
the right ones.

Instead of looking at the Git status colors, we use the
`editorGutter.addedBackground`, `editorGutter.modifiedBackground`, and
`editorGutter.deletedBackground` colors for added, modified, and deleted
status colors, respectively.

Release Notes:

- N/A
2023-12-08 17:56:25 -05:00
Marshall Bowers
2517b1017b Weight scope matches to improve results 2023-12-08 16:35:54 -05:00
Marshall Bowers
2ef3954700 Fix function colors in Gruvbox themes 2023-12-08 16:04:58 -05:00
Marshall Bowers
27501d2929 Pull in colors for selected ghost elements 2023-12-08 14:19:56 -05:00
Marshall Bowers
77c8108f9b Use dropdown.background from VS Code for elevated surface background 2023-12-08 14:13:50 -05:00
Marshall Bowers
1c850f495c
Use breadcrumb.background from VS Code for toolbar background (#3559)
This PR changes the color we use for the toolbar background from the VS
Code theme to `breadcrumb.background`.

If this value isn't set then we fall back to the `editor.background`.

Release Notes:

- N/A
2023-12-08 14:03:18 -05:00
Marshall Bowers
1d35a815a6
Use editorGroupHeader.tabsBackground from VS Code as tab bar background (#3558)
This PR changes the color we use for the tab bar background from the VS
Code theme to `editorGroupHeader.tabsBackground`.

Release Notes:

- N/A
2023-12-08 13:50:56 -05:00
Marshall Bowers
62155f3a88 Add fallback to constant tokens for numbers 2023-12-08 13:20:00 -05:00
Marshall Bowers
ab5b76e943 Pull Git status colors from VS Code themes 2023-12-08 13:14:22 -05:00
Marshall Bowers
a5a0ad8b5c Add missing serde attribute to foreground 2023-12-08 13:13:19 -05:00
Marshall Bowers
9ac9532d3d Treat empty strings as None when deserializing VS Code themes 2023-12-08 13:12:09 -05:00
Marshall Bowers
6f064cfc36 Improve matching for constructor tokens 2023-12-08 11:34:39 -05:00
Marshall Bowers
6634a5e9f6 Improve matching for constant tokens further 2023-12-08 11:23:42 -05:00
Marshall Bowers
1b6721170a Improve matching for constant tokens 2023-12-08 11:21:40 -05:00
Marshall Bowers
63ce7cd407 Improve matching for preprocessor tokens 2023-12-08 11:17:05 -05:00
Marshall Bowers
40a95221ea Improve matching for string tokens 2023-12-08 11:13:28 -05:00
Marshall Bowers
a8a5b9524d Improve matching for punctuation tokens 2023-12-08 11:07:52 -05:00
Marshall Bowers
53d77b192a Don't match support.function for function 2023-12-08 10:48:27 -05:00
Marshall Bowers
7a9f764aa0
Add support for theme family-specific syntax mapping overrides (#3551)
This PR adds support for adding a specific set of mappings from Zed
syntax tokens to VS Code scopes for a particular theme family.

We can use this as a fallback when we aren't otherwise able to rely on
the mappings in the theme importer, as sometimes it isn't possible to
make a specific enough matcher that works across all of the themes.

Release Notes:

- N/A
2023-12-07 23:37:49 -05:00
Marshall Bowers
efb4ff816a Set tab bar and toolbar backgrounds 2023-12-07 22:32:41 -05:00
Marshall Bowers
a88372dc99 Set background colors for title and status bars 2023-12-07 22:24:10 -05:00
Marshall Bowers
f272881a6b
theme_importer: Improve syntax token matching (#3549)
This PR improves the approach we use to match syntax tokens between Zed
and VS Code in the `theme_importer`.

We now use the list of scopes assigned to each Zed syntax token to rank
the possible candidates in the VS Code and then pick the candidate with
the highest rank.

So far this has proved to provide better colors across the board, but
we'll continue to refine the matching over time.

Release Notes:

- N/A
2023-12-07 22:11:31 -05:00
Marshall Bowers
c7e19c0bcd
Emit accurate hex colors in generated themes (#3547)
This PR fixes an issues where the hex colors in the generated themes
were not correct.

We're using the [`palette`](https://crates.io/crates/palette) crate to
perform the conversions, as this gives us accurate hex codes that match
the VS Code source themes.

Release Notes:

- N/A
2023-12-07 18:34:03 -05:00
Marshall Bowers
fa223e0c6f Pull editor inlay hints from VS Code themes 2023-12-07 15:36:13 -05:00
Marshall Bowers
6a164db700 Rename members in ZedSyntaxToken 2023-12-07 14:35:58 -05:00
Marshall Bowers
8ed04fe798 Remove commented-out code in theme importer 2023-12-07 14:33:37 -05:00
Marshall Bowers
cb8c534dac
theme_importer: Support importing themes containing comments (#3298)
This PR updates the `theme_importer` with support for parsing theme
files containing comments.

Up until now we've been manually removing comments from the VS Code
theme files.

Release Notes:

- N/A
2023-11-09 19:22:15 -05:00
Nate Butler
024fb4f818 Remove unused import 2023-11-09 16:41:58 -05:00
Nate Butler
4cd37e6e62 Extend theme converter to allow multimatching against vscode colors 2023-11-09 16:38:48 -05:00
Nate Butler
1c6a960bbf Deal with special case where a VSCode theme doesn't have a foreground color
Co-Authored-By: Marshall Bowers <1486634+maxdeviant@users.noreply.github.com>
2023-11-09 14:53:04 -05:00
Nate Butler
54157eb99a Finish passing Syntax from VSCode themes to Zed Themes
Co-Authored-By: Marshall Bowers <1486634+maxdeviant@users.noreply.github.com>
2023-11-09 14:41:26 -05:00
Nate Butler
ff053890cf Extend UserSyntax to allow font_style and font_weight to be specified
Co-Authored-By: Marshall Bowers <1486634+maxdeviant@users.noreply.github.com>
2023-11-09 13:46:08 -05:00
Marshall Bowers
978cff8095 Use IndexMap for a deterministic order when importing syntax colors 2023-11-09 13:12:36 -05:00
Marshall Bowers
1f0fccc353 Reorganize theme_importer 2023-11-09 13:07:32 -05:00
Marshall Bowers
34e31fd489 Properly emit UserHighlightStyles 2023-11-09 12:59:20 -05:00
Marshall Bowers
ff19a0ca18 Add importing-themes feature flag to theme2 crate
When this feature is set the `themes` module won't be compiled.
This allows us to run the `theme_importer` even when the `themes` module
has compile errors in it.
2023-11-09 12:49:16 -05:00
Marshall Bowers
60eae3e50a Emit unique highlights for each syntax token 2023-11-09 12:46:37 -05:00
Nate Butler
efd1db1b09 WIP – Add Syntax themes to importer
Co-Authored-By: Marshall Bowers <1486634+maxdeviant@users.noreply.github.com>
2023-11-09 12:30:53 -05:00
Nate Butler
4b5ca3e420 Allow imported themes to refine StatusColors
Co-Authored-By: Marshall Bowers <1486634+maxdeviant@users.noreply.github.com>
2023-11-09 11:30:59 -05:00
Nate Butler
7253160b04 Add more vscode colors 2023-11-09 11:01:18 -05:00
Nate Butler
bdeb32c34b Extend VSCode theme importer 2023-11-09 01:39:31 -05:00
Marshall Bowers
b6766ba39a
Replace GitStatusColors with StatusColors (#3268)
This PR removes `GitStatusColors` in favor of just using `StatusColors`
instead.

Release Notes:

- N/A
2023-11-08 11:32:32 -05:00
Nate Butler
df84ba4222 Continue documenting theme colors 2023-11-07 14:04:09 -05:00
Nate Butler
eb5fe3a3b9 Merge branch 'main' into document-theme 2023-11-07 13:36:08 -05:00
Nate Butler
91f356a2f1 Begin documenting theme colors 2023-11-07 13:36:01 -05:00
Marshall Bowers
25876161f8
theme_importer: Format generated themes (#3255)
This PR makes the `theme_importer` format the themes that it generates
automatically.

Release Notes:

- N/A
2023-11-07 12:45:09 -05:00
Marshall Bowers
0d95410634
Rework third-party themes (#3254)
This PR reworks the way we define our third-party themes to make them
work as overlays on top of a base theme.

We introduce the concept of a `UserThemeFamily` that contains
`UserTheme`s. Rather than being an entire theme definition on their own,
a `UserTheme` just contains optional overrides for the values in a
`Theme`.

When resolving a `UserTheme`, we apply it on top of the base theme. Any
values not overridden in the `UserTheme` will fall back to the `Theme`
defaults.

Right now we are just using `UserTheme` to model third-party themes that
we distribute with the Zed binary. However, this same structure can also
be used to import arbitrary user themes (such as from a theme registry,
or even a theme blob from the settings file).

Release Notes:

- N/A
2023-11-07 11:40:07 -05:00
Marshall Bowers
74853ea55f
Rename ThemeVariant to Theme (#3252)
This PR renames the `ThemeVariant` type to `Theme`.

This better reflects its purpose, as well as matches the same name as we
had before, which should make porting crates slightly easier.

Release Notes:

- N/A
2023-11-07 10:41:36 -05:00
Marshall Bowers
01eac50fc8 Add new ThemeColors values to the theme printer 2023-11-07 08:59:37 -05:00
Antonio Scandurra
bdf6e8bcc7 Merge remote-tracking branch 'origin/main' into editor2-paint 2023-11-07 13:09:48 +01:00
Nate Butler
eac7c3cea9 Update Cargo.toml 2023-11-06 16:02:21 -05:00
Nate Butler
2931d32499 Add a README for theme_importer 2023-11-06 16:00:57 -05:00
Nate Butler
3cb72610b3 Finish up initial themes 2023-11-06 15:24:36 -05:00
Nate Butler
c47c64184c Add additional themes, update theme importer 2023-11-06 14:54:21 -05:00
Nate Butler
80f80df5cf Add Noctis Theme 2023-11-06 12:43:10 -05:00
Nate Butler
8192a52bd0 Skip .DS_Store files when scanning themes folder 2023-11-06 11:03:17 -05:00
Nate Butler
5c24c931c5 Remove unused file 2023-11-06 10:57:25 -05:00
Marshall Bowers
acc36e6dab Update emitted module import 2023-11-03 10:58:06 -04:00
Marshall Bowers
293fbe4c75 Account for colors in VS Code theme being optional 2023-11-03 10:54:12 -04:00
Nate Butler
383d9129f4 [Not compiling] Continue working on VSCode import 2023-11-02 21:49:26 -04:00
Nate Butler
0d0b6db24f Update theme importer 2023-11-02 20:15:51 -04:00
Nate Butler
2b0c959137 Add terminal colors to ThemeColors, add _background to some color names. 2023-11-02 19:53:52 -04:00
Marshall Bowers
95a0827517 Clean up unused code 2023-11-02 19:20:21 -04:00
Marshall Bowers
d1636bf16b Finish up theme printer 2023-11-02 19:14:51 -04:00
Marshall Bowers
fc376287e0 Start work on theme printer 2023-11-02 18:57:13 -04:00
Marshall Bowers
0bc51382b2 Add basic VsCodeThemeConverter 2023-11-02 18:24:38 -04:00
Marshall Bowers
e48332c81f Parse VSCode theme files 2023-11-02 18:00:55 -04:00
Nate Butler
058981350c Scaffold out new theme-importer crate
Co-Authored-By: Marshall Bowers <1486634+maxdeviant@users.noreply.github.com>
2023-11-02 17:21:11 -04:00