tomblachut / svelte-intellij

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

"Unexpected token" error when using a keyed each loop with an index and whitespace #273

Closed dennisjlee closed 1 year ago

dennisjlee commented 2 years ago

I discovered an edge case where the Svelte intellij plugin sees a syntax error for a line that is valid Svelte. To trigger the issue, I used an each loop while binding both the loop variable and an index variable, and also added a key clause, like this.

{#each things as thing, index (thing.id) }

Here's a REPL showing the code. https://svelte.dev/repl/9e7975b7aad741d98d0a620247005332?version=3.46.4

The Svelte IntelliJ plugin highlights the closing } as an unexpected token. image

tomblachut commented 2 years ago

Looks like space between ) & } is unsupported. Thanks for reporting!

tomblachut commented 1 year ago

Migrated to WEB-61824 Svelte: fix parser issues