diff options
| author | Caleb White <cdwhite3@pm.me> | 2025-03-12 12:47:19 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-03-12 18:47:19 +0100 |
| commit | 548ed98f8a0af738d095ef1be5961f41061ed743 (patch) | |
| tree | 15bd578cc5c08d5175fbdf3113c46d9649c9050e | |
| parent | feat(tact): update parser and queries (#7731) (diff) | |
| download | nvim-treesitter-548ed98f8a0af738d095ef1be5961f41061ed743.tar nvim-treesitter-548ed98f8a0af738d095ef1be5961f41061ed743.tar.gz nvim-treesitter-548ed98f8a0af738d095ef1be5961f41061ed743.tar.bz2 nvim-treesitter-548ed98f8a0af738d095ef1be5961f41061ed743.tar.lz nvim-treesitter-548ed98f8a0af738d095ef1be5961f41061ed743.tar.xz nvim-treesitter-548ed98f8a0af738d095ef1be5961f41061ed743.tar.zst nvim-treesitter-548ed98f8a0af738d095ef1be5961f41061ed743.zip | |
feat(blade): add laravel blade parser and queries (#7693)
| -rw-r--r-- | README.md | 1 | ||||
| -rw-r--r-- | lockfile.json | 3 | ||||
| -rw-r--r-- | lua/nvim-treesitter/parsers.lua | 8 | ||||
| -rw-r--r-- | queries/blade/folds.scm | 14 | ||||
| -rw-r--r-- | queries/blade/highlights.scm | 15 | ||||
| -rw-r--r-- | queries/blade/indents.scm | 3 | ||||
| -rw-r--r-- | queries/blade/injections.scm | 15 |
7 files changed, 59 insertions, 0 deletions
@@ -188,6 +188,7 @@ We are looking for maintainers to add more parsers and to write query files for - [x] [bibtex](https://github.com/latex-lsp/tree-sitter-bibtex) (maintained by @theHamsta, @clason) - [x] [bicep](https://github.com/amaanq/tree-sitter-bicep) (maintained by @amaanq) - [x] [bitbake](https://github.com/amaanq/tree-sitter-bitbake) (maintained by @amaanq) +- [x] [blade](https://github.com/EmranMR/tree-sitter-blade) (maintained by @calebdw) - [x] [blueprint](https://gitlab.com/gabmus/tree-sitter-blueprint.git) (experimental, maintained by @gabmus) - [x] [bp](https://github.com/ambroisie/tree-sitter-bp) (maintained by @ambroisie) - [x] [c](https://github.com/tree-sitter/tree-sitter-c) (maintained by @amaanq) diff --git a/lockfile.json b/lockfile.json index 6d404d243..9ae24ea03 100644 --- a/lockfile.json +++ b/lockfile.json @@ -44,6 +44,9 @@ "bitbake": { "revision": "a5d04fdb5a69a02b8fa8eb5525a60dfb5309b73b" }, + "blade": { + "revision": "bcdc4b01827cac21205f7453e9be02f906943128" + }, "blueprint": { "revision": "60ba73739c6083c693d86a1a7cf039c07eb4ed59" }, diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 9eeb40019..c73225f9d 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -191,6 +191,14 @@ list.bitbake = { maintainers = { "@amaanq" }, } +list.blade = { + install_info = { + url = "https://github.com/EmranMR/tree-sitter-blade", + files = { "src/parser.c" }, + }, + maintainers = { "@calebdw" }, +} + list.blueprint = { install_info = { url = "https://gitlab.com/gabmus/tree-sitter-blueprint.git", diff --git a/queries/blade/folds.scm b/queries/blade/folds.scm new file mode 100644 index 000000000..cc081a754 --- /dev/null +++ b/queries/blade/folds.scm @@ -0,0 +1,14 @@ +[ + (authorization) + (conditional) + (envoy) + (fragment) + (livewire) + (loop) + (once) + (php_statement) + (section) + (stack) + (switch) + (verbatim) +] @fold diff --git a/queries/blade/highlights.scm b/queries/blade/highlights.scm new file mode 100644 index 000000000..c05d2845f --- /dev/null +++ b/queries/blade/highlights.scm @@ -0,0 +1,15 @@ +([ + (directive) + (directive_start) + (directive_end) +] @tag + (#set! priority 101)) + +([ + (bracket_start) + (bracket_end) +] @tag.delimiter + (#set! priority 101)) + +((comment) @comment @spell + (#set! priority 101)) diff --git a/queries/blade/indents.scm b/queries/blade/indents.scm new file mode 100644 index 000000000..bd3e84d16 --- /dev/null +++ b/queries/blade/indents.scm @@ -0,0 +1,3 @@ +(directive_start) @indent.begin + +(directive_end) @indent.end diff --git a/queries/blade/injections.scm b/queries/blade/injections.scm new file mode 100644 index 000000000..4f5234e31 --- /dev/null +++ b/queries/blade/injections.scm @@ -0,0 +1,15 @@ +((text) @injection.content + (#set! injection.combined) + (#set! injection.language php)) + +((text) @injection.content + (#has-ancestor? @injection.content "envoy") + (#set! injection.combined) + (#set! injection.language bash)) + +((php_only) @injection.content + (#set! injection.combined) + (#set! injection.language php_only)) + +((parameter) @injection.content + (#set! injection.language php_only)) |
