tejassavaliya / jsdoc-toolkit

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

Undocumented symbols with documented members should be assumed to be namespaces or classes #183

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Currently, if I attempt to document a symbol as a member of an undocumented
symbol, JsDoc Toolkit issues a warning and fails to document that symbol.

This is quite a nuisance, especially in the case where I'm documenting
extensions to an external library, e.g. jQuery. At the moment I have to add
spurious documentation comments like:

/** @class
 * @name jQuery */

It would be much better if JsDoc Toolkit simply assumed that the parent
symbol exists. If only static members are documented, it should assume the
parent symbol should be treated as a namespace. Otherwise, it should assume
the parent symbol should be treated as a class.

Original issue reported on code.google.com by lezek...@gmail.com on 28 Oct 2008 at 3:23

GoogleCodeExporter commented 8 years ago
I'm going to study this to see if it's a good idea or not, but I'm tentatively 
accepting it.

Original comment by micmath on 8 Nov 2008 at 10:18

GoogleCodeExporter commented 8 years ago

Original comment by micmath on 8 Nov 2008 at 10:18

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
What do you do if there are sub-components to this class?  I.e., if you want to
document additions to myUtilSet.DOMUtils?  The spurious documentation comment 
above
doesn't seem to work on something like myUtilSet.DOMUtils.  But maybe that's the
wrong form for this sort of thing.

Original comment by rpgold...@gmail.com on 6 Mar 2009 at 5:45

GoogleCodeExporter commented 8 years ago
To get around this limitation I experimented for a bit as I was needing to 
overcome the fact that window is not a Built-In Namespace as I was providing so 
extension to it.  As luck would have it I discovered a work around.

/**
* @namespace
* @name window
* @description supplimental window methods.  
*/

// By declaring the namespace above I was able to assign the field below to the 
window namespace

        /**
        * @memberOf window
        * @name isinited
        * @description holds whether the apicalls can continue when referencing elements.
        */

// Likewise I was able to add a child to the namespace
    /**
    * @memberOf window
    * @namespace
    * @description adds queryString as a property of window inspired by Adam Vandenberg
    */
    window.queryString = {};

Original comment by abyss...@gmail.com on 5 Jul 2010 at 12:37