svelte-intellij icon indicating copy to clipboard operation
svelte-intellij copied to clipboard

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

Open dennisjlee opened this issue 2 years ago • 1 comments

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

dennisjlee avatar Feb 22 '22 15:02 dennisjlee

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

tomblachut avatar Feb 22 '22 16:02 tomblachut

Migrated to WEB-61824 Svelte: fix parser issues

tomblachut avatar Jul 04 '23 17:07 tomblachut