HerringtonDarkholme / yats.vim

Yet Another TypeScript Syntax: The most advanced TypeScript Syntax Highlighting in Vim
Vim License
651 stars 68 forks source link

Issue with template literals (not JSX related) #131

Open steelsojka opened 5 years ago

steelsojka commented 5 years ago

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 commented 5 years ago

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

joshtch commented 4 years ago

<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.

steelsojka commented 4 years ago

This is a TS file not a TSX file.