How can one use jsdoc for class constructors?

Hi,

This may be just a general question, but since I'm only concerned with the way it works for the webide I wanted to ask here.

I'm trying to document a class constructor in such a way that its parameters would show in a tool tip when Command+P is pressed (on a mac) inside its usage parens.

I've tried a number of ways using http://code.google.com/p/jsdoc-toolkit/wiki/TagConstructs and similar with no luck. Below is the code I have so far, notice too, that the @class tag is not technically supposed to be there, but it seems to be the only way to mark this as a class for the IDE.

     /**
      * @class nexus.ViewList
      */
     nexus.ViewList = nexus.Base.extend(
     /** @lends nexus.ViewList.prototype */
     {
          /**
           * @constructs
           * @param [collection] {nexus.Collection}
           * @param [options]
           * @param [options.view] {Object} view class constructor
           */
          construct:function (collection, options) {
          }
     });
     
     var test = new nexus.ViewList( /* press Command+P here to get the parameter hint */);


What could I be missing? Thanks!

5 comments

Hi Leo,
@lends and @constructs tags are supported only in the latest EAP, are you using it? However, there seems to be a bug with recognizing object properties([options.view]). I've created an issue about it. Also, @class tag is not required here.

Thanks for the request!
Konstantin

0

Thanks Konstantin, I'm still using the stable 4.03 version, I didn't realize there was progress in this specific area. Perhaps I will give it a try.

0

You can subscribe to our blog to get fresh view on new features;)

0

Granted, one must try very hard to make things easy for me, but I'm yet to figure out how to subscribe, even after several times trying to do this!

0

Everything was as you said in the EAP, thanks again

0

Please sign in to leave a comment.