Closed ROpdebee closed 5 months ago
Thanks. This is a mistake on my part. However, after going over a couple syntax definitions, I still not certain what third level scope name, it can be assigned to. (apart from the base keyword.control
)
keyword.control.flow.cs
keyword.control.flow.for.in.python
keyword.control.loop.lua
And I believe in all 3 of them, in
has the same meaning, i.e. iterating over the elements of an iterable.
I guess I can assign it to keyword.control.flow.for.in.jinja
though this can be discussed further.
Since Jinja2 is inspired by the Python syntax, it makes sense to me to use the python one. Note however that the Python scopes have been updated in a newer build: https://github.com/sublimehq/Packages/commit/797164cbb4772ccf0d2af33fa05f63b014b44cea#diff-62db422a04a96e067da114ba6ed7d6e9R214
So I'd recommend using keyword.control.loop.for.in.jinja
for consistency.
Scopes for keywords like as
or in
are not currently standardized or consistent across syntax definitions.
With a look at most common meanings keyword.operator
is most suitable.
as
is a kind of alias assignment keyword, so keyword.operator.assignment.as
is a candidate which can be used in most (or even all) situationsin
is either used as
for
loops to return items of a sequence one by oneBoth use cases include iterating through a variable, so keyword.operator.iteration
seems suitable. It is an operator as it operates on a sequence operand to return items.
Summary
The
in
in afor..in
is scoped as an operator, while it's technically more of a keyword.Expected Behaviour
Actual Behaviour
How to Reproduce
See above.
Problematic Jinja2 template.
Environment
[The environment you experienced this bug in.]
Additional context
N/A