microsoft / TypeScript-TmLanguage

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

Ampersand (`&`) is highlighted red when used in JSX string literal #924

Closed srmagura closed 1 year ago

srmagura commented 1 year ago

TS and JS Grammar Extension version: 0.0.55 / latest <------ this is a broken link in the issue template

Testing using VS Code Insiders:

Version: 1.70.0-insider (Universal)
Commit: f3528d481b366b24321c382d5e5849f4c7d65248

Code

render(<Section title="Voice & Video" />)

image

It makes sense to highlight the ampersand red — but only when it is used without double quotes. The screenshot shows that it is highlighted red whenever used inside a JSX expression, even if it is quoted.

Presumably this is the line of code that causes the red highlighting: https://github.com/microsoft/TypeScript-TmLanguage/blob/0dfae8cc4807fecfbf8f1add095d9817df824c95/TypeScriptReact.tmLanguage#L9994

sheetalkamat commented 1 year ago

Fixed by 2a56f0b