Re: [Jsdoc-user] Object/Class declaration in separate file/function
Status: Inactive
Brought to you by:
mmathews
From: Gabriel R. <gab...@gm...> - 2006-01-05 21:20:51
|
On Thu, Jan 05, 2006 at 03:40:33PM -0500, mb...@we... wrote: > Thanks for the advice. It kinda worked, but here's what I found: > > My functions are defined as such: > > /** > * @member myClass > */ > A.B.C.myFunction = function() > { > } > > JSDoc doesn't seem to pick this up unless i first put a normal function > such as > > /** > * @member myClass > */ > function tmpFunction() > { > } > > If that comes first, it picks up all the others without even having to put > @member ... in their doc blocks. If the dummy function comes after the > others, the only thing it picks up is the dummy function. > > Is that a bug? Or do i just need to include a dummy function in all of my > files? I'm just realizing now (or I think I'm just realizing) that we're actually talking about functions being added to an instance, not a class. In that case, this isn't really the idea behind JSDoc, but I'm not totally sure that I'm fully comprehending the whole problem. I wouldn't really call it a bug, as the @member tag is intended for linking normally defined functions to a class, so this is actually a bit of misuse of that construct. In any case, from what I've seen of what you're doing, there's no need to define a dummy function; instead, you can just define one of the functions as a named function with the @member tag, and then bind that named function to the instance/class that you want to bind it to. If this isn't really solving the issue here (and I have a feeling that it isn't), could you post a more complete example, along with what you would like/expect to see as the output of JSDoc? Regards, Gabriel |