Sublime Forum

Scope does not exist, but text is highlighted as if

#1

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?

0 Likes

#2

Probably related https://github.com/sublimehq/sublime_text/issues/5395

2 Likes

#3

Yep, this was the most recent list of automatic selector rewriting I could find: https://discord.com/channels/280102180189634562/280102180189634562/956862318749306912

0 Likes