OK, So imagine you have this module which accepts another module as a parameter to one of it’s methods:
define("modules/module2", [], function() {
return {
/**
* @param {module:myNamespace/module1} SomeModule
*/
somethingElse: function(SomeModule) {
var instance = new SomeModule();
SomeModule.sayHello();
}
}
});
Notice that @param {module:myNamespace/module1} SomeModule
is JSDoc’s recommended way of annotating
module dependencies. But this is who it shows up in Webstorm:
Webstorm doesn’t recognize the module. But if I change the param
definition to:
/**
* @param SomeModule {@type module:myNamespace/module1}
*/
Webstorm starts recognizing it and offers autocomplete, etc. There is two changes: Parameter name is first,
then after {
I added @type
to make sure webstorm knows this is a module. But this is not standard in JSDoc
and I don’t want to do this.