svelte-intellij
svelte-intellij copied to clipboard
"Unexpected token" error when using a keyed each loop with an index and whitespace
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.
Looks like space between )
& }
is unsupported.
Thanks for reporting!
Migrated to WEB-61824 Svelte: fix parser issues