Closed sergeichestakov closed 6 months ago
I wasn't aware you could use destructured parameters in function type signatures. That's a lot of ambiguity for little use, but indeed, it looks like TypeScript parses it. Attached patch adds support to @lezer/javascript.
Describe the issue
It seems the TypeScript language parser breaks down and fails to correctly apply syntax highlighting in certain documents that contain JSX and a templated string.
Here is a screenshot of a minimal example that showcases this:
Strangely, when you remove just one line (line 6 which contains the last destructured variable) the above example no longer reproduces:
Not entirely sure what causes this and in exactly which scenarios but this reproduces pretty consistently for documents like the above.
Browser and platform
latest MacOS, Firefox (but should repro in all)
Reproduction link
https://replit.com/@SergeiChestakov/cm-tsx-highlight-bug