cecco974 / jsdoc-toolkit

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

two methods with same name but different number of parameters #188

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
If you download log4js from http://log4js.berlios.de there is a code
sequence like:

<code>
[...]
/** 
 * Debug messages 
 * @param message {Object} message to be logged
 */
debug: function(message) {
 [...]
},
/**
 * Debug messages 
 * @param {Object} message  message to be logged
 * @param {Throwable} throwable 
 */
debug: function(message, throwable) {
 [...]
},  

</code>

For these lines I get warnings like: 
>> WARNING: The symbol 'Log4js.Logger#debug' is documented more than once.
>> WARNING: Overwriting symbol documentation for: Log4js.Logger#debug

I would expect to get both methods in my jsDoc.

What version of the product are you using? On what operating system?
I use jsdoc-toolkit 2.1.0b on Windows XP.

Original issue reported on code.google.com by Stephan....@gmail.com on 17 Dec 2008 at 3:48

GoogleCodeExporter commented 8 years ago
This has been discussed before, see:

http://groups.google.com/group/jsdoc-2/browse_thread/thread/7de514659ab91cd9/

 Basically it isn't possible, because the name is the primary key for the symbol, not the name and the parameter list (in 
other words: the 'signature' in Java).

You could fake it by doing something like this (while excluding the -a option):

/** 
 * Debug messages 
 * @param message {Object} message to be logged
 */
debug: function(message) {
}

/**
 * Debug messages another way.
 * @name debug^2
 * @function
 * @param {Object} message  message to be logged
 * @param {Throwable} throwable 
 */
debug: function(message, throwable) {
}   

Perhaps tweaking the template to show ^n as <sub>n</sub>?

Original comment by micmath on 29 Dec 2008 at 1:14