I am creating a new .sublime-color-scheme
. When I define a rule for storage.type
, some text gets highlighted that doesn’t have that scope at all.
For example, in JavaScript, consider the const
in a file containing only const foo = 'bar'
. The syntax defines it to have scopes source.js
and keyword.declaration.js
. Yet, it receives the color defined for the scope storage.type
. When adding a rule for keyword
, this can override that color, but only if that rule comes after the one for storage.type
, not before.
Why is this? Is this a bug, or am I misunderstanding how rules and scopes are applied to a syntax?