yats.vim icon indicating copy to clipboard operation
yats.vim copied to clipboard

Issue with template literals (not JSX related)

Open steelsojka opened this issue 5 years ago • 3 comments

Highlighting breaks most lines after a template literal statement.

Screenshot_2019-09-07_06-39-56

When I comment out that line the highlighting works correcty.

Screenshot_2019-09-07_06-40-24

This issue is related but dismissed as a JSX issue, but I don't believe it is. https://github.com/HerringtonDarkholme/yats.vim/issues/47

steelsojka avatar Sep 07 '19 11:09 steelsojka

After further investigation it looks like it is the typecast that is causing the problem. Changing it to this causes the problem.

Screenshot_2019-09-07_06-58-40

Might be related to this issue https://github.com/HerringtonDarkholme/yats.vim/issues/122

steelsojka avatar Sep 07 '19 11:09 steelsojka

<Provider>provider should be provider as Provider? Only the latter syntax is legal in JSX/TSX. Otherwise, the parser can't tell between JSX with forgotten closing tag and a type cast/assertion. See this section of the Typescript manual on type assertions.

joshtch avatar May 12 '20 15:05 joshtch

This is a TS file not a TSX file.

steelsojka avatar May 13 '20 10:05 steelsojka