You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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, otherwiseAutumn
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_draculaThis approach saves a bunch of time but on the other hand brings the problem explained above. The fix to this problem could be:
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.
The text was updated successfully, but these errors were encountered: