I’m using jsdoc for the first time and it doesn’t seem to like a bit of my syntax and I can’t find anything it does like:
(function(){ // issue #1
/**
* Creates an instance of a Cube animation
* @class
*/
function Cube(x, y, z){
...
}
/** @lends Cube.prototype */
cubeFrame.prototype = { // Issue #2
...
}
})();
Issue #1: For some reason I get an error of “WARNING: Trying to document someMethod as a member of undocumented symbol Cube.” if I leave that wrapping function in. If I comment it out, it works.
Issue #2: I’m doing something a bit odd with my classes and can’t figure out a way to get jsDoc to pay attention when I say @lends Cube.prototype in terms of applying the following object to Cube and not cubeFrame. I get a nearly identical error to #1: ” WARNING: Trying to document getVoxel as a member of undocumented symbol cubeFrame.”. I don’t want cubeFrame to be documentated, I want its prototypes to go into the Cube documentation.
I can re-write those two lines and get the documentation to generate (it’s then invalid code), but I don’t want to have to re-write code to generate documentation every time I make a change!
Use the
@nametag to let jsdoc know the name of the object, then name of the class and replace the@lendstag to right prior to the object literal. Like: