- The grammar has been pretty much rewritten from the ground up.
tree-sitter-blade now inherits
html
and takes control of thehtml
tree structure as well - The grammar is way more semantic, leaner and much faster, like lightening fast (10x) thanks to the drastically improved performance
- Please read the
v0.12.0
Release Note for the Upgrade Guide, if you have any questions, feel free to start a discussion or raise an issue
This project aims to write the tree-sitter grammar for Laravel Blade.
This grammar can be used in any editor or service that support Tree-Sitter. Such as, but not limited to:
- Neovim
- Zed
- Nova
Simply install the Laravel Suite Extension from the Extension Library. That includes:
- Language Injections
- Autocompletion
- Folding
- Syntax Highlighting
- Auto Indentation
Simply use the nvim-treesitter plugin and install the blade
grammar.
Simply download the extension from zed Extension marketplace
Note
Your editor or service might use a different capture group name or
predicates than the queries in the queries/
folder. Consequently, you
will need to find out how to approach queries or where they are stored and
used in your editor's documentation. For example Nova does not use
anything in this folder and uses its own Queries
folder instead.
Here's an example of all the various languages that are injected:
And here's an example of folding in action:
If something does not look right please raise an issue with a detailed examples of what you are trying to achieve. Add any of the following if necessary:
- Code Excerpts (allows me to test)
- Photo of the issue
- Parse Tree (if inspectable by your editor)
If you need help with anything else or would like to share tips and tricks for your fellow devs, feel free to use the discussion tab and create a discussion!
See the contribution guidelines for more details, as well as
in depth info about the grammar
itself.