Skip to content
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

Object's fields have suspicious color #176

Closed
YuriGor opened this issue Oct 11, 2018 · 5 comments
Closed

Object's fields have suspicious color #176

YuriGor opened this issue Oct 11, 2018 · 5 comments

Comments

@YuriGor
Copy link

YuriGor commented Oct 11, 2018

test code:

var obj = {
  hi:"there",
  count:0,
  really:true,
  mean:undefined,
  nono:null,
  method:function(){}
};

first lets look at native JS syntax
monokai:
image
candyman:
image
field names are nearly white, let's say it's a basic text color
And this is Naomi
monokai:
image
candyman:
image
in monokai it same as string constants
in candyman I am not sure what does this color mean.
Was this made intentionally?
In monokai this looks not very good with large objects filled with strings:
image
everything is yellow, not very readable.

@YuriGor
Copy link
Author

YuriGor commented Oct 11, 2018

Also I found same issue in the babel repo:
babel/babel-sublime#352
and with marianna scheme there is same problem
native js:
image
Naomi:
image

@borela
Copy link
Owner

borela commented Oct 11, 2018

This was intentionally, Naomi marks then as:

meta.object-literal.js.fjsx15
meta.block.js.fjsx15
meta.object-literal.key.js.fjsx15
string.unquoted.js.fjsx15

While the native syntax only does:

meta.object-literal.js
meta.object-literal.key.js

This was intentional in Naomi because it keeps the syntax compatible with most color schemes that like Candyman gives a different color to object literal keys, in fact, on the build system's branch I changed the keys colors to a light brown to distinguish better the key from types in code that has a lot of Flow annotations:

image

The way the native syntax scopes the keys, makes it imposible to color it without affecting other key types.

@borela
Copy link
Owner

borela commented Oct 11, 2018

If you add a rule to your color scheme targeting the scopes:

meta.object-literal.key
string.unquoted

You'll be able to use any color in there without the risk of affecting the values.

@YuriGor
Copy link
Author

YuriGor commented Oct 12, 2018

So it's more like monokai's issue.
I added scope as you suggested, it works, thank you.

@borela
Copy link
Owner

borela commented Oct 15, 2018

No problem, if you have any questions, feel free to open new issue reports :D

@borela borela closed this as completed Oct 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants