wenchun / jsdoc-toolkit

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

Consts not documented? #85

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Create a new const and apply a documentation tag to it (I tried @desc)
2. Run the documentation generator
3. Look at the output

What is the expected output? What do you see instead?
I expect to see my const described in the documentation. Instead, I see
nothing.

What version of the product are you using? On what operating system?
1.4.0, Windows XP, Java SE 6 update 4

Please provide any additional information below.
Here's a short sample of what I tried in my code:
/** @desc Represents the first tab */
const TAB_I = 0;

Original issue reported on code.google.com by lord2800@gmail.com on 22 Feb 2008 at 3:50

GoogleCodeExporter commented 8 years ago
try this...

/**
    Represents the first tab
    @name TAB_I
*/
const TAB_I = 0;

Original comment by micmath on 22 Feb 2008 at 7:54

GoogleCodeExporter commented 8 years ago
That worked, but why wasn't it picking it up in the first place? The 
documentation
example required only the description.

Original comment by lord2800@gmail.com on 23 Feb 2008 at 8:18

GoogleCodeExporter commented 8 years ago
@name essentially tells the parser to ignore the code and use the given name, so
there's no doubt that it will find TAB_I with that method. Why wasn't it working
before? Because "const" isn't recognized by the parser (var would have worked). 
You
can use this workaround too:

const 
/**
    Represents the first tab.
*/
TAB_I = 0;

or I could add support for "const".

Original comment by micmath on 23 Feb 2008 at 9:28

GoogleCodeExporter commented 8 years ago
Makes sense. Support for const would be nice, since I tend to use it all over 
the
place in my code.

Wonderful tool, by the way. Sorry about the unnecessary report, I just didn't 
see
anywhere that mentioned why this wouldn't work.

Original comment by lord2800@gmail.com on 23 Feb 2008 at 11:56

GoogleCodeExporter commented 8 years ago
I've added support for "const" in the latest revision of Version 2. You can now 
write:

/**
    Represents the first tab
    @constant
    @default 0
*/
const TAB_I = 0;

Original comment by micmath on 24 Feb 2008 at 9:12