virchau13 / tree-sitter-astro

Tree-sitter grammar for the Astro web framework
MIT License
98 stars 9 forks source link

SASS-based style tags aren't highlighted properly #22

Open Jarmos-san opened 11 months ago

Jarmos-san commented 11 months ago

I noticed the syntax highlighting breaks when writing SASS-based code (see screenshot for reference). I believe it might be the same for the other CSS Preprocessors like Less, Stylus and such that Astro supports.

Proper syntax highlighting for CSS code image

No syntax highlighting for SASS code image

Weirdly enough, the highlighting works when lang="scss".

virchau13 commented 11 months ago

This is because in order to support a custom language injection, there needs to be a tree-sitter parser for that language. There already exists a tree-sitter parser for SCSS, which is why SCSS is already supported, but there aren't any tree-sitter parsers for SASS, Less, or Stylus.

If you are willing to write a tree-sitter parser and/or one pops up, then I can add it. Otherwise, unfortunately, this will stay open.