diff options
| author | Robert Muir <rcmuir@apache.org> | 2025-07-21 11:49:54 -0400 |
|---|---|---|
| committer | Christian Clason <ch.clason+github@icloud.com> | 2025-08-05 20:06:49 +0200 |
| commit | a4fa3e2d187ad98eb74d27c566ab3c330397ed75 (patch) | |
| tree | 2358ae637205e0b1a5b3f14714224d8ef44a4008 | |
| parent | feat(systemverilog)!: update parser and queries (diff) | |
| download | nvim-treesitter-a4fa3e2d187ad98eb74d27c566ab3c330397ed75.tar nvim-treesitter-a4fa3e2d187ad98eb74d27c566ab3c330397ed75.tar.gz nvim-treesitter-a4fa3e2d187ad98eb74d27c566ab3c330397ed75.tar.bz2 nvim-treesitter-a4fa3e2d187ad98eb74d27c566ab3c330397ed75.tar.lz nvim-treesitter-a4fa3e2d187ad98eb74d27c566ab3c330397ed75.tar.xz nvim-treesitter-a4fa3e2d187ad98eb74d27c566ab3c330397ed75.tar.zst nvim-treesitter-a4fa3e2d187ad98eb74d27c566ab3c330397ed75.zip | |
Revert "fix(jinja): remove crashing pattern"
This reverts commit 8c8742871a1489afd7878bfee4bc40465f4a116a.
| -rw-r--r-- | runtime/queries/jinja_inline/highlights.scm | 16 | ||||
| -rw-r--r-- | tests/query/highlights/jinja/filters.jinja | 19 |
2 files changed, 27 insertions, 8 deletions
diff --git a/runtime/queries/jinja_inline/highlights.scm b/runtime/queries/jinja_inline/highlights.scm index c072eea66..3a9660471 100644 --- a/runtime/queries/jinja_inline/highlights.scm +++ b/runtime/queries/jinja_inline/highlights.scm @@ -125,14 +125,14 @@ "." (identifier)+ @variable.member) -; crashes parser: https://github.com/cathaysia/tree-sitter-jinja/issues/37 -; ; jinja filters -; (binary_expression -; (binary_operator -; "|") -; (unary_expression -; (primary_expression -; (identifier) @function.call))) +; jinja filters +(binary_expression + (binary_operator + "|") + (unary_expression + (primary_expression + (identifier) @function.call))) + (inline_trans "_" @function.builtin) diff --git a/tests/query/highlights/jinja/filters.jinja b/tests/query/highlights/jinja/filters.jinja new file mode 100644 index 000000000..a084cdc1a --- /dev/null +++ b/tests/query/highlights/jinja/filters.jinja @@ -0,0 +1,19 @@ +{{ name|striptags|title }} +{# ^^^^ @variable #} +{# ^^^^^ @function.call #} +{# ^^^^^ @function.call #} + +{{ listx|join(', ') }} +{# ^^^^^ @variable #} +{# ^^^^ @function.call #} +{# ^^^^ @string #} + +{{ listx|join(str) }} +{# ^^^^^ @variable #} +{# ^^^^ @function.call #} +{# ^^^ @variable.parameter #} + +{{ foo.bar|random }} +{# ^^^ @variable #} +{# ^^^ @variable.member #} +{# ^^^^^^ @function.call #} |
