mryozo16 / jsdoc-toolkit

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

Multiple methods within a static namespce #128

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Build a closure
2. Create 2 separate base classes name the first Callback, name the second 
CONFIG
3. Create 3 test methods for the Callback class and two test methods in the 
CONFIG class
4. Generate documentation.

What is the expected output? What do you see instead?
When you generate the documentation not all the methods of the first class are 
generated, only 
the first method. Strange enough if you change the name of the Callback class 
to CONFIG2 only 
the first method is not created.

The code I used is attached to this ticket.

What version of the product are you using? On what operating system?
jsdoc_toolkit-2.0.beta2.3 on Mac OS X 10.4.11

Please provide any additional information below.
Try to change the class name of Callback to something different produces very 
strange results. 
Creating one processor instruction over all the methods with @memberOf API 
creates all the 
methods but doesn't place them in the correct namespace in the documentation.

If you would like to know more you can contact me at 
marijn.huizendveld@gmail.com

Thanks for a great product by the way

Original issue reported on code.google.com by marijn.huizendveld@gmail.com on 19 Apr 2008 at 3:26

GoogleCodeExporter commented 8 years ago
I'm sorry, this issue has been posted twice accidentally.

Original comment by marijn.huizendveld@gmail.com on 19 Apr 2008 at 3:28

GoogleCodeExporter commented 8 years ago
Only the second issue had the attached file. Just to make sure that you have an 
example I'll add it again here. 
Sorry for all the extra messages.

Original comment by marijn.huizendveld@gmail.com on 19 Apr 2008 at 5:05

Attachments:

GoogleCodeExporter commented 8 years ago
Before I accept this I'd like you to correct a few errors first, in case those 
are
causing the issue.

1) @scope tag (a synonym for @lends) must immediately precede an object literal 
in
your code.
see http://www.jsdoctoolkit.org/wiki/index.php?page=lends

2) @class and @namespace cannot be combined.
see http://www.jsdoctoolkit.org/wiki/index.php?page=namespace

3) This metatag syntax isn't correct:
  /**
   * #@-
see http://www.jsdoctoolkit.org/wiki/index.php?page=Meta%20Tags

If you can send me a corrected version I'll have a look again. 

Original comment by micmath on 19 Apr 2008 at 5:13

GoogleCodeExporter commented 8 years ago
Hi micmath,

It took me a little while but I can now provide you with an example that 
demonstrates the bug more clearly.

See the attached file for the source and generate the documentation with the 
following directive:

  $ java -jar jsrun.jar app/run.js -a -p -t=templates/jsdoc API.js

You will get 4 warnings about the methods API.Callback.unRegister, 
API.Callback.register, API.Callback._assertMethod and 
API.Callback._assertCallbackID that cannot be documented as members of 
API.Callback (the warning message shows them without 
API.Callback)

API.Callback.invoke is documented as expected and so is API.CONFIG, 
API.CONFIG.SET and API.CONFIG.GET.

If you change the name of API.Callback to API.CONFIG2 3 methods are documented: 
API.CONFIG2.register, API.CONFIG2.unRegister 
and API.CONFIG2._assertMethod.

Something other that I noted:scroll to the bottom of the file and remove the 
multiline comment around the 6 if statements that define 
console.
Regenerate the documentation and now 7 errors appear, this only happens when 
the -a switch is used in the cli.

I am sorry for posting code hear before that didn't use the directives correct 
but the readme file on your google group was so 
explicit that I felt I needed to post it here. Should I ask first in the google 
groups next time?

Thanks,

Marijn

Original comment by marijn.huizendveld@gmail.com on 19 Apr 2008 at 8:49

GoogleCodeExporter commented 8 years ago
Damn, I keep forgetting to attach those files :-D

Sorry

Original comment by marijn.huizendveld@gmail.com on 19 Apr 2008 at 8:50

Attachments:

GoogleCodeExporter commented 8 years ago
This is the correct place to post, but the new file still has many errors of 
the same
type as I pointed out in my last message. In hopes of speeding this along I'll 
try to
fix them myself but it's a big file and I'm not sure what you are wishing to
accomplish with your docs so, of the two of us, I'm not the best one to do that 
work.

Original comment by micmath on 19 Apr 2008 at 9:24

GoogleCodeExporter commented 8 years ago
I've been playing around with your doclets a while and I think the problem (for 
JsDoc
Toolkit) is the fact that you are declaring the problem symbols as inner 
members of
an anonymous function, for example:

new function() { // anonymous function
    function foo() { // inner function
    }
}

This makes it very difficult for the JsDoc parser to use the code to determine 
the
full name and membership of the symbol "foo". And even if you say it's a 
"@memberOf
bar", it looks like you're saying that the anonymous function, of which foo is a
private, inner method is a member of bar. You need a way of saying, "just the 
foo is
a memberOf ..." and that sort of statement isn't supported by JsDoc Toolkit 
(yet).

However an easier way exists. If, instead of forcing the poor parser to try to 
figure
the name out, you use @name tags in each of your doclets, things become much 
more
obvious to everyone. For example:

/**
 * @name bar
 * @namespace
 */

new function() {
    /**
     * @name bar-foo
     * @function
     */
    function foo() {
    }
}

This is more explicit and so more verbose, but it is guaranteed to get the name
right, and should only be required in this particular case of inner members of
anonymous functions.

If you believe this answers your report properly, I'll leave issue 128 open as a
request to add implicit support for the pattern you are using.

Original comment by micmath on 19 Apr 2008 at 11:28

GoogleCodeExporter commented 8 years ago
There has been no feedback on this issue so I am closing.

Original comment by micmath on 27 May 2008 at 6:36