tomblachut / svelte-intellij

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

Support for resolving reactive declarations #117

Closed josdejong closed 4 years ago

josdejong commented 4 years ago

Thanks for building this Webstorm plugin Tomasz! It works quite nicely.

It would be great if the plugin would also be able to resolve reactive declarations since this is such a core element of Svelte. I'm not sure if this is what is already discussed in #4. Currently Webstorm says "Unresolved variable or type ".

afbeelding

Here the code (straight from the Svelte tutorial https://svelte.dev/tutorial/reactive-declarations):

<script>
  let count = 0;
  $: doubled = count * 2;

  function handleClick() {
    count += 1;
  }
</script>

<button on:click={handleClick}>
  Clicked {count} {count === 1 ? 'time' : 'times'}
</button>

<p>{count} doubled is {doubled}</p>
tomblachut commented 4 years ago

I know I know. This is core feature but it's really tricky to pull of because it changes core semantics of JS.

97 is a work in progress support of this but is blocked by #100... and updates to WebStorm.

Also, duplicate of #7

josdejong commented 4 years ago

👍 I can indeed imagine that this is tricky to pull off, I hope that it will work out!