microsoft / TypeScript-TmLanguage

TextMate grammar files for TypeScript for VS Code, Sublime Text, and Atom.
MIT License
414 stars 128 forks source link

Absence of color when using "in" keyword in terinary operators (JS) #869

Open Yash-Singh1 opened 3 years ago

Yash-Singh1 commented 3 years ago

Steps to Reproduce:

  1. Enter the following code:
    hello = type in _typeIs ? type : 'any'
  2. Notice the absence of color in some tokens (variables and string) Screen Shot 2021-04-05 at 11 04 54 AM

However, when removing in _typeIs, we get:

Screen Shot 2021-04-05 at 11 06 52 AM

Does this issue occur when all extensions are disabled?: Yes Theme: Dark+ (default dark)

aeschli commented 3 years ago

I can reproduce. Looks like the TS grammar doesn't work here (see last part of the hover)

image

Yash-Singh1 commented 3 years ago

Another thing to note is that the problem only occurs if the terinary operator is not in an initialization. Also, the problem won't occur if it is wrapped in parenthisis:

Variable Declarations:

Screen Shot 2021-04-07 at 3 40 05 PM

Hello Declaration cases:

Screen Shot 2021-04-07 at 3 40 41 PM Screen Shot 2021-04-07 at 3 40 54 PM Screen Shot 2021-04-07 at 3 41 08 PM