tomblachut / svelte-intellij

Svelte components in WebStorm and friends
MIT License
485 stars 38 forks source link

Expressions inside title tag are parsed as plain text #210

Closed r00t3g closed 1 year ago

r00t3g commented 3 years ago

Therefore, as the variable is treated as unused, its import gets removed when running 'Reformat code' with 'Optimize imports' option. Apart from all other problems like not found usages etc.

image

tomblachut commented 3 years ago

Hi. It should work in latest release. What version of plugin and IDE are you running? Also, what "SUBJ" means? Thanks

r00t3g commented 3 years ago

@tomblachut IDE is IntelliJ Idea 2020.3.3, plugin - 0.18.0.203 Removed the SUBJ, sorry :)

It looks that it breaks only when the variable usage follows some text and works OK in any other case: image

Cmd/Ctrl+Click navigation also seems not to work the variable.

tomblachut commented 3 years ago

Oh ok, I've reproduced the problem. Thanks for reporting.

This is a bug in parser. Happens specifically inside title and similar because according to MDN only text is allowed inside

tomblachut commented 3 years ago

This is actually a regression 😔 https://youtrack.jetbrains.com/issue/WEB-41745.

Related to #142

tomblachut commented 1 year ago

Migrated to WEB-61785 Svelte: properly parse title tag content