phpStorm and documenting JavaScript

I’m awed again and again by phpStorm‘s features. I just came across this one: When I comment my JavaScript methods/functions with the @param, all IDEs I have tried out so far, let you only set a primitive type in curly braces, e.g.:

/**
 * Some method description.
 * @param {Object} deferred dojo.Deferred
 */
someMethod: function(deferrede) {
   // ...
}

Anything else would be marked as an error. But phpStorm is a lot, lot smarter.  When I’m using dojo it recognizes all classes and I can use them as a type, e.g.:

 /**
 * Some method description.
 * @param {dojo.Deferred} deferred
 **/
someMethod: function(deferred) {
  // ...
}

Leave a comment

Your email address will not be published. Required fields are marked *