-
Notifications
You must be signed in to change notification settings - Fork 18
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
Cast object literal keys as strings or numbers for syntax highlighting #72
Comments
I agree with you that object keys are technically unquoted strings and I would love to change that, the sublime core devs even tried to that exactly that in the past but it broke many color schemes and so they had to revert the change: sublimehq/Packages#141 (comment) I would be inclined to add this as a configurable option, soon I'll have to use a build system to simplify the syntaxes and that will allow me to make the syntaxes configurable. For now, to make the keys looking like a string, a key need to be added to the color scheme, in your example: <dict>
<key>name</key>
<string>Object literal key</string>
<key>scope</key>
<string>meta.object-literal.key, meta.object-literal.key variable.other.readwrite</string>
<dict>
<key>foreground</key>
<string>#e6db74</string>
</dict>
</dict> |
I was getting a weird error "Expected element key" when trying to add that snippet to the Monokai.tmTheme file, but I ended up adding those scopes in the String entry and it works great
|
https://github.com/borela/naomi/releases/tag/v3.7.0 In your case, you probably won't need to patch the color scheme anymore. |
The latest patch was published and now the syntax will adopt babel sublime's behavior highlighting object literal keys. |
If someone want to revert this change (I mean revert to the default property name color, I mean white or whathever) :
(To get scope name, use developper tool "Show scope name") |
Similar to Babel plugin, Object keys should be strings or numbers!!
Desired (Babel) syntax highlight:
Current (Naomi) syntax highlight:
The text was updated successfully, but these errors were encountered: