michaelgmcd / vscode-language-babel

VSCode syntax highlighting for today's JavaScript
https://marketplace.visualstudio.com/items?itemName=mgmcdermott.vscode-language-babel
MIT License
131 stars 17 forks source link

Ternary operator expressions show Incorrect highlighting. #81

Closed BannerBomb closed 2 months ago

BannerBomb commented 3 years ago

Describe the issue When using ternary operators the expression values can show incorrect syntax colors. Such as with Infinity, -Infinity, NaN and global builtin functions being white but for the second expressions shows the proper highlighting.

And with numbers with the thousands being separated with an underscore shows as red for the rest of the number. But with bigints the rest of the number shows as white.

Screenshot of Current Behavior image

Sample Code to Reproduce

const a = true ? Infinity : Infinity;
const a = true ? -Infinity : -Infinity;
const a = true ? NaN : NaN;
const a = 1_000;
const a = 1_000n;
const a = true ? isNaN : isNaN;

Update

._ also is highlighted as a numeric. image