mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-20 12:20:02 -04:00
fix(jinja): assign highlights to all variables and functions
The majority of jinja variables aren't assigned any highlights at all. Assign @variable to all identifiers. Jinja filters without parameters are not highlighted as functions: add a query for these. Refine the existing @variable.member to only capture identifiers instead of broader nodes.
This commit is contained in:
parent
1e3b7562c2
commit
20d77c2e5b
4 changed files with 77 additions and 6 deletions
21
tests/query/highlights/jinja/variables.jinja
Normal file
21
tests/query/highlights/jinja/variables.jinja
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
{{ foo }}
|
||||
{# ^^^ @variable #}
|
||||
|
||||
{{ foo.bar }}
|
||||
{# ^^^ @variable #}
|
||||
{# ^^^ @variable.member #}
|
||||
|
||||
{{ foo['bar'] }}
|
||||
{# ^^^ @variable #}
|
||||
{# ^^^^^ @string #}
|
||||
|
||||
{{ foo.bar.baz }}
|
||||
{# ^^^ @variable #}
|
||||
{# ^^^ @variable.member #}
|
||||
{# ^^^ @variable.member #}
|
||||
|
||||
{{ foo.bar + baz.qux }}
|
||||
{# ^^^ @variable #}
|
||||
{# ^^^ @variable.member #}
|
||||
{# ^^^ @variable #}
|
||||
{# ^^^ @variable.member #}
|
||||
Loading…
Add table
Add a link
Reference in a new issue