Sublime-Instincts / BetterJinja

A Sublime Text package that provides enhanced syntax highlighting, completions, snippets & more for Jinja templates.
https://packagecontrol.io/packages/Jinja2
MIT License
15 stars 4 forks source link

[BUG] Builtin tests and filters don't get a special scope. #5

Closed ROpdebee closed 4 years ago

ROpdebee commented 4 years ago

Summary

The built-in filters, tests, and globals should probably be scoped as support.

Expected Behaviour

Screenshot 2020-08-22 at 21 52 31
   {{ poetry_bin_path | default('/usr/local/bin/poetry') }}
##                      ^^^^^^^ support.function.jinja

Actual Behaviour

Screenshot 2020-08-22 at 21 52 44
   {{ poetry_bin_path | default('/usr/local/bin/poetry') }}
##                      ^^^^^^^ variable.function.jinja

How to Reproduce

See above.

Problematic Jinja2 template.

{{ poetry_bin_path | default('/usr/local/bin/poetry') }}

Environment

Same as earlier.

Additional context

Scoping the built-ins as support. will also lead to more varied highlighting on some color schemes, which IMO looks better.

Used in screenshots: Theme - Spacegray, Base16 Ocean color scheme from Base16, Source Code Pro as font.