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

Distinguish between builtin filters/tests/globals/vars (fix #5 and #6) #9

Closed ROpdebee closed 4 years ago

ROpdebee commented 4 years ago

This commit fixes #5 by marking applied filters/tests as functions or support functions, depending on whether they're builtin. In addition, it marks built-in global functions (e.g., namespace) and built-in variables (for now, loop) as support. Simultaneously, this commit fixes #6 by greedily matching applied tests and scoping them appropriately.

New test cases added to verify correct behaviour.

Fixes: #5 and #6

In addition, this fixes the identifier naming scheme s.t. identifiers containing digits are allowed (e.g., dict2items). Identifiers starting with a digit are still illegal.

UltraInstinct05 commented 4 years ago

Looks good to me. Thanks for your work on this !