IDE should let me add member declarations to top of class

Topics: General
Oct 22, 2013 at 5:20 AM
If I'm working away in the middle of the class, and I add some new code that references a previously undeclared member variable, I should be able to click on something that will quickly add the declaration to the top of the class.

This is fairly common functionality nowadays. IntelliJ and Resharper do things like that. Is there a way to do this now? Maybe I'm missing something.

This is currently causing me pain because I'm porting some existing JavaScript code into TypeScript and now I have to very tediously go through all of my code and add the member variable declarations.
Oct 22, 2013 at 7:03 PM
The feature you're describing is generally called something like 'Generate From Usage' in Visual Studio. TypeScript doesn't support this at the moment. Feel free to create a work item for the suggestion that others can upvote.