-
Notifications
You must be signed in to change notification settings - Fork 588
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[YAML] Everything is "String" colored now #3288
Comments
It may actually be related to this and require a similar update to |
This scope naming change has been made by intent to get inline with how JSON keys are scoped for years now. |
And coming back to this now, even the built-in Monokai didn't get updated. Well enough, I think I can customise the UI, was just surprising all of a sudden |
See sublimehq/sublime_text#3590 for built-in color schemes, which has lasted for years as well. The point is, what you see in YAML is "state of the art" in JSON for years. |
There's also the following statement about it: https://discord.com/channels/280102180189634562/280102180189634562/956253218034315304 |
Fair enough. I'll leave the same fix here as is in the issue I linked in case someone stumbles on this rather than those and is in the discord which worked for Monokai: {
"name": "Mapping Key Names",
"scope": "meta.mapping.key string",
"foreground": "var(red2)"
}
|
Thanks for the help and confirmation! :) |
For anyone wondering where to apply the fix mentioned by @lirossarvet: Just call Preferences => Customize Color Scheme and add this between the square brackets under "rules":
This will color everything like it used to be. Really weird change, by the way. Clearly a regression if you ask me. The syntax highlighting is almost useless without this. I thought it was broken before I found this issue. |
I copied the |
It's your color scheme, which needs to be tweaked. Syntax definition won't be reverted. YAML applies the same scopes to keys as JSON has done for ages. Everyone how complains about how YAML looks should have noticed it for JSON long before. |
There is a significant difference between JSON and YAML. The first format was created with love for machines and hate for people. The second is the opposite. |
This is true but absolutely unrelated. Both represent structured key-value pairs. YAML is even a super-set of JSON. As such, both now use the same scopes for The point is: JSON already looking pretty plain without any color scheme tweaks. So fixing color scheme rules for YAML fixes JSON or vice versa as scoping is now consistent accross the two. |
Yeah this really looks like a bug, came here to find a solution for the broken syntax highlighting. |
Also this broken appearance just happened yesterday for me with update to the new Sublime release, not before? |
from the command palette
It first happened on Mar 24, 2022 as you can see in this thread. However, that's a dev build. If you use a stable build, it happens yesterday. |
Ah I see thanks, I'm using following for the railscasts theme: {
"name": "Mapping Key Names",
"scope": "meta.mapping.key string",
"foreground": "#FFC66D"
} |
If you want you can directly edit your <dict>
<key>name</key>
<string>Mapping Key Names</string>
<key>scope</key>
<string>meta.mapping.key.yaml string</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#FFC66D</string>
</dict>
</dict> |
It's a bit confusing since all the built-in color schemes seem to have 'broken' (even if they're not 'broken', YAML is incredibly hard to parse now, where it was not before, at least using Cobalt and testing on a couple other built-in color schemes). |
Updates requests for default color schemes are still pending (sublimehq/sublime_text#3590). |
It was harmonised with JSON: sublimehq/Packages#3288
What happened?
As of updating to the latest sublimeText, it seems like even
keys
of Hashes/Dictionaries are now highlighted as if they were regular strings. Before, they used to be differentiated (pink vs green in my specific color scheme) making it easier to identify key/value pairings. I would guess this is related to #3272, but I can't be sure as I've never dug through the syntax highlighting code before.The text was updated successfully, but these errors were encountered: