-
Notifications
You must be signed in to change notification settings - Fork 235
Conversation
@@ -461,7 +463,7 @@ | |||
} | |||
{ | |||
'match': '(?<!\\.)\\b(delete|in|of|instanceof|new|typeof|void)(?!\\s*:)\\b' | |||
'name': 'keyword.operator.js' | |||
'name': 'keyword.operator.$1.js' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can I have your reasoning behind this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It makes possible to change highlighting for each of these operators.
Should I revert 'keyword.operator.arithmetic' -> 'keyword.operator' for |
@MaximSokolov That sounds like a good idea. We can't be sure that a |
@MaximSokolov I'd suggest to change it as well. |
Is |
Sounds better to me 😆. |
As a (self proclaimed) language designer, compound is more correct (as you are joining two distinct operators into a new operator, now composed of two parts). People started calling it augmented with scripting languages (C, Java, etc. always called it compound). |
'name': 'keyword.operator.bitwise.js' | ||
} | ||
{ | ||
'match': '\\?|\\:' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
: doesn't need to be escaped
'name': 'keyword.operator.assignment.js' | ||
} | ||
{ | ||
'match': '\\-\\-' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-- doesn't need to be escaped
@@ -857,8 +859,43 @@ | |||
'operators': | |||
'patterns': [ | |||
{ | |||
'match': '!=|!==|<=|>=|<<=|>>=|>>>=|\\*=|(?<!\\()/=|%=|\\+=|\\-=|&=|\\^=|!|%|&|\\*|/|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|<>|<|>|!|&&|\\|\\||\\?|\\:|\\^' | |||
'comment': 'match 2-character operator first' | |||
'match': '%=|\\+=|\\-=|\\*=|(?<!\\()/=' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Final nit: The - here doesn't need to be escaped either.
Woo! |
👍 |
Closes #188
Supersedes and closes #222
It's not correct for some cases:Has been reverted