You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When passing a function prop to a component that uses typescript, typescript will show an extra suggestion as an autocomplete for the method as it would do for normal TS objects but this doesn't make sense for Svelte components.
Note that this extra suggestion only shows up if you start typing without first manually popping the suggestions up (pressing CTRL + Space).
Describe the proposed solution
I was wondering if there is anyway to change this to either show a proper autocomplete suggestion for Svelte components like:
Or to not show that default typescript extra suggestion at all.
I wouldn't mind writing an extra property like I did in the top image, but what annoys me is that extra typescript suggestion which makes the suggestions look like this:
I'm not aware if this default behavior of typescript can be disabled or not, but since its used pretty often during development it can be a bit annoying.
Importance
nice to have
The text was updated successfully, but these errors were encountered:
I tried it and it is possible to rewrite it to an inline handler. But I am not really sure if it is useful enough or if it is more of an extra noise and we should just filter it out.
This isn't always suggested due to some problem with the source mapping of generated code. Some people might rarely see it because of how they usually type out the attribute.
Arrow function can have various forms. Different use cases and preferences can lead to very different results. Is it really useful enough to have it? Like sometimes I might not care about the parameter or don't want a block for the arrow function body. Removing the stuff I don't want might cause the same time as typing out the whole thing by hand.
You have a point there. One other thing I noticed is that unless you can detect if the typescript suggestion is being shown for the component itself and not a variable that is assigned the component's props type in the script tag, removing the suggestion entirely also doesn't make sense. In other words, users might like that default suggestion when they are creating their props with typescript.
In the above case, typescript's suggestion makes sense.
Describe the problem
When passing a function prop to a component that uses typescript, typescript will show an extra suggestion as an autocomplete for the method as it would do for normal TS objects but this doesn't make sense for Svelte components.
Note that this extra suggestion only shows up if you start typing without first manually popping the suggestions up (pressing CTRL + Space).
Describe the proposed solution
I was wondering if there is anyway to change this to either show a proper autocomplete suggestion for Svelte components like:
Or to not show that default typescript extra suggestion at all.
I wouldn't mind writing an extra property like I did in the top image, but what annoys me is that extra typescript suggestion which makes the suggestions look like this:
I'm not aware if this default behavior of typescript can be disabled or not, but since its used pretty often during development it can be a bit annoying.
Importance
nice to have
The text was updated successfully, but these errors were encountered: