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] bool is not highlighted when used in dict literal #12

Closed Jackenmen closed 5 months ago

Jackenmen commented 2 years ago

Summary

false and true are not highlighted when used in dict literal.

Expected Behaviour

I expected false and true to be highlighted as they do when used in other places in the template.

Actual Behaviour

false and true are not highlighted: image

How to Reproduce

  1. Copy paste the Jinja2 template from below.
  2. Set syntax to Jinja.

Problematic Jinja2 template.

{{
    lookup('file', item, errors='ignore') or {}
    | from_json
    | combine({'openAtLogin': false})
    | to_json(sort_keys=true)
}}

Environment

Additional context

The old Jinja2 package highlighted this properly.

UltraInstinct05 commented 2 years ago

Thanks for the report. I plan to eventually make a bunch of improvements done to BetterJinja to align with the improvements made in BetterTwig but I don't have a specific timeline for it

UltraInstinct05 commented 2 years ago

Can you check to see how it looks with the latest update v1.1.0 ? It doesn't seem to happen.

image

Jackenmen commented 2 years ago

Seems like it's fixed, yeah. I'm not entirely sure why sort_keys keyword argument is no longer highlighted though. errors keyword argument in the call above still gets properly highlighted.

For comparison, Python syntax highlighting (which Jinja's mini-language is based on) highlights it like this: image

UltraInstinct05 commented 2 years ago

Thanks. I believe I understand what the issue is. I'll have this fixed (along with a number of syntax inconsistencies) in v1.2.0