Tree-sitter grammar for the Astro web framework.
If the syntax highlighting doesn't work for embedded CSS/JSX, make sure you have all of the following tree-sitter parsers installed:
css
(for CSS instyle
elements)typescript
(for the frontmatter)tsx
(for interpolations)
If you're using the lazy.nvim
plugin manager, do not use the opts
key for the nvim-treesitter plugin (it won't work, as nvim-treesitter doesn't have a .config()
function). Use require('nvim-treesitter.configs').setup(opts)
instead. For more information, take a look at #16.
This parser just uses the general idea that the document looks like
---
{typescript}
---
{html}
and is essentially tree-sitter-html plus two snazzy ways to write <script>
tags.