Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explore Zed languages and themes #23

Open
leandrocp opened this issue Apr 11, 2024 · 0 comments
Open

Explore Zed languages and themes #23

leandrocp opened this issue Apr 11, 2024 · 0 comments

Comments

@leandrocp
Copy link
Owner

leandrocp commented Apr 11, 2024

For syntax highlight to work, it must load a language grammar that defines all scopes for each source code token that matches a class in the CSS theme file.

Currently we rely on Helix language definitions and themes which means we depend on Helix's project to maintain those files in order to generate the right colors at the end of the day.

For example the Elixir grammar defines a @namespace scope even though the official grammar doesn't define such scope. That means all themes must consider that scope to highlight Elixir code properly, otherwise Autumn fallbacks to the foreground color. For example the Dracula theme doesn't define that scope and will render a white text where you'd expect to see some color (module names), see https://autumn-30n.pages.dev/elixir_dracula

This approach saves a bunch of time but on the other hand brings the problem explained above. The fix to this problem could be:

  • Fix the language/theme upstream (helix repo)
  • Use the official tree-sitter grammar instead of Helix's - some languages take this approach but it causes mismatches with the themes in Helix
  • Fork languages/themes in Autumn to apply specific fixes

While those fixes are doable, another approach is loading Zed languages and themes since those seems to be more updated and renders colors more accurately. The downside is that Zed doesn't support all languages we need at this moment, in special Swift that we use at https://dockyard.com/blog

To conclude, we would benefit having a mixed approach using Zed as the main source for languages/themes and fallback to Helix, until we can eventually drop Helix at all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant