PS-121.322: jsdoc question
Hello.
Here's the example of a typical class pattern I use:
/** * @class */ var Class = (function () { /** * @private * @type {Number} */ var _privateVar; /** * @param {Number} value * @constructor */ function Class(value) { _privateVar = value; } function privateMethod(){} Class.prototype.publicMethod = function () {}; return Class; }());
Looks good and behaves good too (as for intellisense)... Except one thing - the constructor. When I type:
var с = new Class(
I expect constructor's parameters' info to appear, but it doesn't! Is there anything wrong in jsdoc comments or maybe something else?
Any suggestion would be way welcome!
Regards, Roman.
Please sign in to leave a comment.
Hi, Roman. I've created an issue. As a workaround now you can annotate constructor with @name tag, i.e.
Regards,
Konstantin.
Wow!!! Thank you so much!!! It works!!!
PS: Issue voted
I was kind of overoptimistic with my "Wow" in my last reply. :(
The tag @name turned out to be not doing the trick in case of multiple parameters constructor. From all of the parameters only the second one(?!) is being displayed as an autocomplete proposal.
In example let's say I've got the Color class with the constructor that looks like this:
then when I start to type its instaniation I see:
Very weird, isn't it?!