TypeScript typing autocompletion

One of the features I love most about WebStorm is its type inferences for TypeScript.  This is great when I'm working with a new library and am uncertain what the return type of something should be, like this d3 selection that takes four generic type arguments.

What I would love is if there was a way to have WebStorm simply insert that inferred type for me into my code, like an autocompletion, rather than making me type it all back out again by hand.  This is especially problematic with longer types like this, because as soon as I start writing out my own typing, WebStorm's suggestion disappears and that means that I have to remember what that whole typing was so that I can reproduce it (or take screenshots, or delete what I've already typed to make it reappear, etc.).  Bonus points for being able to automatically insert all inferred typings for an entire file with a single command.

If that's not a currently supported feature, how do I request it?  Thanks!

0
5 comments

There is Specify type explicitly intention available on Alt+Enter:

 

0

Perfect, thanks so much!

0

Is there a way to bind that specific intention to a keyboard shortcut?

0

No, there is no way to assign shortcuts to specific intentions; a request for adding this feature (https://youtrack.jetbrains.com/issue/IDEA-91566) has been declined

0

Okay, thank you.

 

0

Please sign in to leave a comment.