tomblachut / svelte-intellij

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

Reactive labels #97

Closed tomblachut closed 3 years ago

tomblachut commented 4 years ago

Resolves #7

anstarovoyt commented 4 years ago

is it really necessary to introduce a new PSI element for labels? Maybe it is better just suppress the error using the corresponding EP?

shirotech commented 4 years ago
Screen Shot 2020-08-09 at 3 22 13 pm

Probably I should report it here, when importing a store and using it with $, doesn't seem to recognize it as such.

tomblachut commented 4 years ago

is it really necessary to introduce a new PSI element for labels? Maybe it is better just suppress the error using the corresponding EP?

This is not new PSI element, PR changes the parser so it treats label as normal var statement. I did it like that so resolving works with JSReferenceExpressionResolver without writing complicated rules about walking up the tree etc.

Downside is that there are inspections that require actual let and const keywords, IDK if this is correct approach.

Alternatively, there was great work performed by @unlocomqx in #43, it contains some edge case bugs though.

(Woah, that year certainly flew by)

anstarovoyt commented 4 years ago

Downside is that there are inspections that require actual let and const keywords, IDK if this is correct approach.

We have fields and parameters that extend almost the same interfaces and don't have any keywords so, in general, I think such solution is ok.

tomblachut commented 3 years ago

163 contains alternative approach