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:
Robert Muir 2025-07-17 22:12:23 -04:00 committed by Christian Clason
parent 1e3b7562c2
commit 20d77c2e5b
4 changed files with 77 additions and 6 deletions

View 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 #}