Typescript: Way to automatically add "import" statements?

Disclaimer: I am using Rubymine, but posting here because WebStorm is often a bit ahead of Rubymine in its Typescript features.

In our Typescript code, it's quite common for us to have long path hierarchies in our modules and classes. So we might have something like this:

var x = new module1.module2.Foo();

I'd rather type module1.module2 every time, and luckily Typescript lets me do this at the top of my file:

import Foo = module1.module2.Foo;

Flash Builder did two things to help me with this:
First, if I started typing "Foo", Intellisense would suggest that I meant module1.module2.Foo.
Secondly, if I accepted its Intellisense suggestion, it would automatically add an import statement at the top of the file.

Are there ways to have either of these features work in WebStorm? It would speed us up _tremendously_.
First, we wouldn't have to remember which modules our classes were in. Auto-suggest would do it for us.
Secondly, we wouldn't have to manually add imports to the top of our files.

Maybe these features already exist, or can be enabled in preferences? I'm pretty new to this, so I'm hoping I missed something.

Many thanks for any help or suggestions you can offer.

1 comment
Comment actions Permalink

Reference comment (///<reference>) can already be generated using 'Generate reference  path comment' intention (hit Alt+Enter on a reference to generate a  comment). For auto-imports, please vote for


Please sign in to leave a comment.