readyou / jsdoc-toolkit

Automatically exported from code.google.com/p/jsdoc-toolkit
0 stars 0 forks source link

Can't document Prototype library style class declarations #233

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Run jsdoc-toolkit against the attached file. The command line options I used 
were -a -d=out, 
but I don't think it will matter.
2. Observe warning messages:
>> WARNING: The symbol 'TheClass' is documented more than once.
>> WARNING: Overwriting symbol documentation for: TheClass.

What is the expected output? What do you see instead?
I'd like to be able to document the constructor/initialiser for the class.

What version of the product are you using? On what operating system?
2.3.0 running on Mac OS X 10.5.8.

Original issue reported on code.google.com by jwmetrocat@gmail.com on 19 Aug 2009 at 5:58

Attachments:

GoogleCodeExporter commented 9 years ago
The @constructs tag is redundant when used with the @class tag for TheClass, 
see the docs: 
http://code.google.com/p/jsdoc-toolkit/wiki/TagConstructs

This should work...

TheClass = Class.create(
    /** @lends TheClass.prototype */
    {
        /** @constructs
            @description This is the constructor!
            @param {Number} a
            @param {String} b
         */
        initialize: function(a, b)
        {
        }

    }
);

Original comment by micmath on 21 Aug 2009 at 2:07

GoogleCodeExporter commented 9 years ago
Ah, sorry. I was still in the 1.x mode of thinking which required both the 
@class and @constructs. Thanks.

It's isn't entirely clear from the documentation for the @constructs tag that 
@class isn't required.

Original comment by jwmetrocat@gmail.com on 21 Aug 2009 at 6:16

GoogleCodeExporter commented 9 years ago
Thanks for pointing that out, I've updated the wiki to make this point more 
clear.

Original comment by micmath on 22 Aug 2009 at 5:21