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

Operators like in and of are not colored properly with one-light-syntax #405

Closed
j-f1 opened this issue Aug 24, 2017 · 1 comment
Closed

Comments

@j-f1
Copy link

j-f1 commented Aug 24, 2017

The code here matches the operators:

gandm/language-babel/grammars/Babel Language.json lines 1197–1200

{
  "match": "(?<!\\.)\\s*+\\b(delete|in|instanceof|new|of|typeof|void|with)\\b",
  "captures": {
    "1": { "name": "keyword.operator.js" }
  }
},

However, one-light-syntax only colors certain keywords from blue to purple:

atom/one-light-syntax/styles/syntax/javascript.less lines 2–16

.syntax--keyword.syntax--operator {
  color: @hue-1;

  // keywords are definded in https://github.com/atom/language-javascript/blob/master/grammars/javascript.cson
  // search "instanceof" for location
  &.syntax--delete,
  // ...snip...
  &.syntax--void {
    color: @hue-3;
  }
}

In language-javascript, the name of the operator is added as a scope:

atom/language-javascript/grammars/javascript.cson lines 960–963

{
  'match': '(?<!\\.)\\b(delete|in|of|instanceof|new|typeof|void)(?!\\s*:)\\b'
  'name': 'keyword.operator.$1.js'
}

Could this behavior be replicated in language-babel?

gandm pushed a commit that referenced this issue Aug 25, 2017
@gandm
Copy link
Owner

gandm commented Aug 26, 2017

Try 2.73.0

@gandm gandm closed this as completed Aug 26, 2017
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