WebStorm JSDoc properties of an external property

I have a namespace that I use for all of my Global variables.  One of the properties of the namespace is an object and contains properties that I would like to document.  The object is returned via JSON so I do not actually have the definition with the JavaScript code.  I'm attempting to use the JSDoc @property tag, but it doesn't seem to work properly.  Any ideas on how I can do this without creating a doc stub for each property?

Here is the code style I'm trying to use:

 
/**
* Testing
* @namespace parentObj
*/

/**
* This is how I want to doc it
*
* @property level2 The lower level's property
* @name parentObj#level1
*/


console.log(parentObj.level1.level2);

///Below sample shows the expected behavior for documenation on the level2b property

/**
* Testing
* @namespace parentObj2
*/

/**
* Subproperty
*
* @name parentObj2#level1b
*/

/**
* Lowest level
* @name parentObj2#level1b#level2b
*/


console
.log(parentObj2.level1b.level2b);
2 comments
Comment actions Permalink

Please try

/**
* Testing
* @namespace parentObj2
*/

/**
* Subproperty
* @property {object} level1b
* @property {string} level1b.level2b
* @name parentObj2#level1b
*/

/**
* Lowest level
* @name parentObj2#level1b#level2b
*/


console.log(parentObj2.level1b.level2b);



works in both WebStorm and jSDoc

0
Comment actions Permalink

That's not working for me if I do not include the separate doc for the lowest level (which I do not want to do).
Here is what I used:

 
/**
* Testing
* @namespace parentObj
*/

/**
* This is how I want to doc it
*
* @property {object} level1
* @property {string} level1.level2
* @name parentObj2#level1

*/


console.log(parentObj.level1.level2); // WebStorm says level2 is unresolved.
 

Note: I'm using WebStorm 9.0.3

0

Please sign in to leave a comment.