Name your functions in Webstorm for better intellisense

Since I joined DLA TV, we have refactored our AngularJS code into an advanced and well documented structure that supports large scale development by remote teams.

We also decided on using Jetbrain's Webstorm as the IDE of our choice (although you can use anything as long as you follow the code style). I am a Sublime user myself but have also worked with Webstorm here and there.

As I was working on an Angular service the other day, I decided to name the service function instead of leaving it as annonymous.

For example:

angular.module('app.special').service('TestService', function() {  
    // Service code here
});

Turned into

angular.module('app.special').service('TestService', function TestService() {  
    // Service code here
});

Not only did the change above provide a much better call stack whenever we had to debug an error, it has proven to be quite useful in Webstorm.

Now when you inject the service above into any other file, you get code completion of all of its methods for free!

It's similar to the result of Angular Eclipse Plugin, which I recommend to anyone using Angular and Eclipse to try.

Till next time.