-
-
Notifications
You must be signed in to change notification settings - Fork 168
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
Keys inside javascript objects are hard to read when they have an string as a value #352
Comments
Try JS Custom. Out of the box, it's a drop-in replacement for Babel, but it's customizable — you can turn nonstandard features like JSX and Flow on and off, or even have several versions for different projects. The setting you want is |
@ellipticaldoor If you are still using https://github.com/borela/naomi, add the rule |
@Thom1729 but I don't want to turn it off, just want to change it to other color |
@borela but where I do make that change? |
@ellipticaldoor Which color scheme are you using? |
Im using Mariana, the one that comes with sublime |
@ellipticaldoor If you turn off Try this modified color scheme. I've taken Mariana and added highlighting for JavaScript unquoted object keys. You can customize the color if you like (the new rule is at the bottom). To use this color scheme, save it to your User package directory. This color scheme should work with either the core JavaScript syntax or with JS Custom (with |
@ellipticaldoor Thom's gist will not work in this case as the key will continue to be highlighted as a string, you need two rules for it to work on any syntax so I modified his gist to fix it.
The line https://gist.github.com/borela/512ecb9215e46953f53599023fae332a#file-mariana-modified-object-literal-key-sublime-color-scheme-L53 contains the rules I was talking about, you can change the color there. |
wow, thanks @borela I will try it on the weekend |
@ellipticaldoor I have just learned that the new Save the following at {
"rules": [
{
"name": "JavaScript unquoted object literal key",
"scope": "meta.object-literal.key, meta.object-literal.key string.unquoted",
"foreground": "var(white2)"
}
]
} This incorporates @borela's change, which applies this rule in JS Custom when |
@Thom1729 Nice to know sublime supports extending color schemes, is there any documentation on the subject? As of now I am only discovering some amazing features sublime has through forum posts :/ |
Unfortunately, there is no documentation yet for the |
@borela it works with naomi and JSCustom but not with babel-sublime, how I can make it work with babel-sublime? |
@ellipticaldoor JS Custom is intended to be a drop-in replacement for babel-sublime. babel-sublime is abandoned; it suffers from numerous unfixed bugs and from incompatibility with tools designed for the core JavaScript syntax. At the moment, my top priority with JS Custom is ensuring that it can totally replace babel-sublime. If you find that for any reason JS Custom doesn't do that for you, then please let me know and I will fix it immediately (tonight or tomorrow). |
@ellipticaldoor Then maybe it's a bug in the syntax itself Babel sublime has many issues specially with the newer JS features. I would say to create an issue with the sample that reproduces the bug but babel sublime is not being maintained anymore which is why I created Naomi, the biggest issue with my package is that It can't be used with other editors(VSCode, Atom...) like babel sublime and I don't plan to support them due to limitations in the tmLanguage borela/naomi#21. |
Okay! I found some bugs on CustomJS and also babel-sublime looks better for my taste. Im going to leave here some feedback https://github.com/Thom1729/Sublime-JS-Custom/issues Also babel-sublime is the only package that doesn't break vue components. |
@ellipticaldoor
<dict>
<key>name</key>
<string>Object keys</string>
<key>scope</key>
<string>constant.other.object.key string.unquoted.label</string>
<key>settings</key>
<dict>
<key>foreground</key>
<string>#61676C</string>
</dict>
</dict> |
Can I change the color of the object key color? When the value is an string is very hard to read.
The text was updated successfully, but these errors were encountered: