virchau13 / tree-sitter-astro

Tree-sitter grammar for the Astro web framework

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

tree-sitter-astro

Tree-sitter grammar for the Astro web framework.

Troubleshooting

Parser dependencies

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 in style elements)
  • typescript (for the frontmatter)
  • tsx (for interpolations)

lazy.nvim

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.

Specification

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.

About

Tree-sitter grammar for the Astro web framework

License:MIT License


Languages

Language:JavaScript 34.2%Language:Rust 29.4%Language:Shell 11.8%Language:C++ 9.8%Language:Scheme 6.2%Language:Nix 4.8%Language:Python 3.8%