joshpeng / Sublime-Babel-VSCode

Sublime Text's babel-sublime grammar in VS Code.
MIT License
49 stars 16 forks source link

Optional chaining operator inside backtick string breaks highlighting #41

Closed LandGod closed 3 years ago

LandGod commented 3 years ago

Here is an example that illustrates the issue. If you drop this code into a blank JS file with this extension enabled, the highlighting breaks. It's not a huge issue and can be fixed on a case-by-case basis via comments, but I figured I'd make it known. Thanks for the extension :)

const x = {};

// Syntax highlighting is good here
const test = `${x?.someThing}`; 

// Now the syntax highlighting is messed up
const someVar = "Value"; 

// Adding a single backtick somewhere seems to fix it `
// Now we're okay.

const someOtherVar = "Another Value";
LandGod commented 3 years ago

Oops, I just realized this issue has already been posted. My apologies.