kristoff-it / superhtml

HTML Language Server & Templating Language Library
MIT License
172 stars 11 forks source link

Tree Sitter - SuperHTML (.shtml) Syntax Highlighting for Neovim, ... #25

Open kristoff-it opened 1 month ago

kristoff-it commented 1 month ago

In tree-sitter-superhtml there's a grammar for SuperHTML templates that can be used by any editor (or tool in general) that relies on Tree Sitter.

Unfortunately, a grammar alone is not enough to get syntax highlighting in an editor, as you also need highlighting queries, and those need to be crafted for each editor.

I've developed the current queries for Helix and they look like this:

CleanShot 2024-07-27 at 09 14 03

Notice in particular how id values of block definitions are underlined differently from other non-semantically-relevant(to the templating engine) ids.

Trying yesterday with a user to add those same queries to Neovim caused an error, which means that Neovim users at the moment cannot have syntax highlighting for .shtml files.