tomblachut / svelte-intellij

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

destructuring reactive declaration highlighted as wrong #231

Closed ghost closed 3 years ago

ghost commented 3 years ago

Hey @tomblachut, we like your IntelliJ-Plugin and have an issue that might come from it or another source inside of IntelliJ IDE.

Background

My team and me are working with svelte recently and found an issue and are wondering if the issue actually comes from your plugin or IntelliJ itself.

The Problem

The case is, that we have a component that has one property with many values in it. This component gets updated every 2 seconds and needs to be very reactive.

As you can see, if i declare the values from the component the first 3 are working properly. But as soon as the 4th variable is reached, each of them are marked as wrong with the hint "Element is not exported". image

Svelte itself does compile this code and it works also properly on runtime. As i said, we are not aware if this issue comes from your plugin, IntelliJ or our usage of both in combination.

We would be glad to get some help with this issue. I will also open a ticket on IntelliJ to see if we can find a solution there. Link will be posted here if i have opened a ticket.

Have a nice day and stay healthy, Pascâl

ghost commented 3 years ago

Here is the corresponding IntelliJ issue: https://youtrack.jetbrains.com/issue/IDEA-271850 I think you can just see it, if you're registered.

tomblachut commented 3 years ago

Hello, this is a problem with the plugin, because if you remove $: and paste the rest to normal JS it is actually not a destructuring declaration but an assignment. Plugin does not override this behavior yet.

as a workaround you may declare those variables with let, for example on the line above $:

Duplicate of #181