Skip to content

Commit

Permalink
Add blade templates support
Browse files Browse the repository at this point in the history
  • Loading branch information
lelgenio committed Feb 28, 2024
1 parent 3cdf30b commit e74a553
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 0 deletions.
1 change: 1 addition & 0 deletions book/src/generated/lang-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
| beancount || | | |
| bibtex || | | `texlab` |
| bicep || | | `bicep-langserver` |
| blade || | | |
| blueprint || | | `blueprint-compiler` |
| c |||| `clangd` |
| c-sharp ||| | `OmniSharp` |
Expand Down
11 changes: 11 additions & 0 deletions languages.toml
Original file line number Diff line number Diff line change
Expand Up @@ -942,6 +942,17 @@ roots = ["composer.json", "index.php"]
name = "php-only"
source = { git = "https://github.com/tree-sitter/tree-sitter-php", rev = "cf1f4a0f1c01c705c1d6cf992b104028d5df0b53", subpath = "php_only" }

[[language]]
name = "blade"
scope = "source.blade.php"
file-types = [{ glob = "*.blade.php" }, "blade"]
injection-regex = "blade"
roots = ["composer.json", "index.php"]

[[grammar]]
name = "blade"
source = { git = "https://github.com/EmranMR/tree-sitter-blade", rev = "4c66efe1e05c639c555ee70092021b8223d2f440" }

[[language]]
name = "twig"
scope = "source.twig"
Expand Down
8 changes: 8 additions & 0 deletions runtime/queries/blade/folds.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
((directive_start) @start
(directive_end) @end.after
(#set! role block))


((bracket_start) @start
(bracket_end) @end
(#set! role block))
4 changes: 4 additions & 0 deletions runtime/queries/blade/highlights.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
(directive) @tag
(directive_start) @tag
(directive_end) @tag
(comment) @comment
16 changes: 16 additions & 0 deletions runtime/queries/blade/injections.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
((text) @injection.content
(#set! injection.combined)
(#set! injection.language php))

; could be bash or zsh
; or whatever tree-sitter grammar you have.
((text) @injection.content
(#set! injection.combined)
(#set! injection.language bash))


((php_only) @injection.content
(#set! injection.language php-only))
((parameter) @injection.content
(#set! injection.language php-only))

0 comments on commit e74a553

Please sign in to comment.