Skip to content

EmranMR/tree-sitter-blade

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tree-Sitter-Blade 🌳


⚠️v0.12.0 Upgrade Guide ✨

  • The grammar has been pretty much rewritten from the ground up. tree-sitter-blade now inherits html and takes control of the html 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

Introduction (feel free to skip)

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

php injection

Common Editors Set Up 💻

alt text Nova

Simply install the Laravel Suite Extension from the Extension Library. That includes:

  1. Language Injections
  2. Autocompletion
  3. Folding
  4. Syntax Highlighting
  5. Auto Indentation

alt texteoVim

Simply use the nvim-treesitter plugin and install the blade grammar.

alt text Zed

Simply download the extension from zed Extension marketplace

Queries

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:

php injection

And here's an example of folding in action:

php injection

Issues

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!

👥 Contributing

See the contribution guidelines for more details, as well as in depth info about the grammar itself.

Anyone said coffee? ☕

Buy Me A Coffee

About

tree-sitter grammar for Laravel blade files

Resources

License

Contributing

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Contributors 5