diff --git a/languages.toml b/languages.toml index 47fb7e316ac21..06d943cb97634 100644 --- a/languages.toml +++ b/languages.toml @@ -891,6 +891,17 @@ indent = { tab-width = 4, unit = " " } 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 = [{ suffix = ".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" diff --git a/runtime/queries/blade/folds.scm b/runtime/queries/blade/folds.scm new file mode 100644 index 0000000000000..c171148212b09 --- /dev/null +++ b/runtime/queries/blade/folds.scm @@ -0,0 +1,8 @@ +((directive_start) @start + (directive_end) @end.after + (#set! role block)) + + +((bracket_start) @start + (bracket_end) @end + (#set! role block)) \ No newline at end of file diff --git a/runtime/queries/blade/highlights.scm b/runtime/queries/blade/highlights.scm new file mode 100644 index 0000000000000..b3d442a05f630 --- /dev/null +++ b/runtime/queries/blade/highlights.scm @@ -0,0 +1,4 @@ +(directive) @tag +(directive_start) @tag +(directive_end) @tag +(comment) @comment diff --git a/runtime/queries/blade/injections.scm b/runtime/queries/blade/injections.scm new file mode 100644 index 0000000000000..b292eb916e7f1 --- /dev/null +++ b/runtime/queries/blade/injections.scm @@ -0,0 +1,18 @@ +((text) @injection.content + (#not-has-ancestor? @injection.content "envoy") + (#set! injection.combined) + (#set! injection.language php)) + +; could be bash or zsh +; or whatever tree-sitter grammar you have. +((text) @injection.content + (#has-ancestor? @injection.content "envoy") + (#set! injection.combined) + (#set! injection.language bash)) + + +((php_only) @injection.content + (#set! injection.language php-only)) +((parameter) @injection.content + (#set! injection.language php-only)) +