-
-
Notifications
You must be signed in to change notification settings - Fork 14
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 not working very well? #11
Comments
sublimehq/sublime_text#3590 has an example of what rule needs to be added for this. |
Ah so this is a Sublime Text issue. Closing. |
I don't think it's a Sublime Text issue—it's an issue with Sublime Text's default color schemes, that Catppuccin also suffers from. I'll take a stab at it. (Edit: not right now but at some point if I remember.) |
I'm not sure what the best path forward is so I'm going to post a bunch of screenshots and ask in the Catppuccin Discord for thoughts. Ideally we don't want to mess up JS that much, so I've got JS as a control on the right, next to JSON and YAML. The scopes that Sublime applies are totally different from VSCode. The weird part in my opinion is that in JSON and YAML, there's a "string" scope applied after (with more specificity) than the meta.mapping.key scope, so you have to target it explicitly or it gets highlighted as a string. I prefer Option 1, because it's more consistent and more semantic when programming. It makes keys everywhere blue. Option 2 kind of highlights the quoted keys in YAML and JSON, which some people might like. Code block for both options// Option 1:
{
"name": "awdawd",
"scope": "meta.mapping.key string, meta.mapping.key",
"foreground": "var(blue)"
},
{
"scope": "meta.mapping.key punctuation.definition.string.begin, meta.mapping.key punctuation.definition.string.end",
"foreground": "var(overlay2)"
},
// Option 2:
{
"name": "awdawd",
"scope": "meta.mapping.key, meta.mapping.key.json string, meta.mapping.key string.unquoted",
"foreground": "var(blue)"
},
{
"scope": "meta.mapping.key punctuation.definition.string.begin.json, meta.mapping.key punctuation.definition.string.end.json",
"foreground": "var(overlay2)"
} |
Hey @MatthiasPortzel, sorry meant to reply officially to this. I believe @ghostx31 and I agree that Option 2 would be the way forward here as it seems to match VSCode the most under the various files. Little bit odd that |
Yep Option 2 is much better since we have to try to be as close as possible to VSCode. Sublime's texmate engine has some limitations so there's nothing that we can do about it so it's cool to match VSCode as much as we can. |
We can also match VSCode exactly. There are no Sublime limitations here. (The limitations in Sublime's engine come up in edge cases like JS arrow function definitions that have been split over multiple lines. And Sublime's engine, although backward-compatible with TextMate's, has become a lot more sophisticated.) The difference between Sublime and VSCode is just how things are scoped. VSCode applies different scopes and scope precedences to things than Sublime does. So VSCode's coloring is natural in VSCode-land by just coloring "keys" as blue, and VSCode doesn't scope keys in JS objects as keys. Sublime does scope keys in JS objects as keys and so if we want them to not be colored, we need an extra rule to re-color keys in JS as text. I can put up a PR today to match VSCode and we can see what it looks like. |
Tried installing this on Sublime Text 4. It does not handle YAML very well:
The text was updated successfully, but these errors were encountered: