Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@constructor does not display #34

Open
GoogleCodeExporter opened this issue Mar 14, 2015 · 2 comments
Open

@constructor does not display #34

GoogleCodeExporter opened this issue Mar 14, 2015 · 2 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. Add the @constructor tag
2. Have no @method tags in your class
3. The constructor never appears in the output docs

What is the expected output? What do you see instead?
  I expect to see the constructor listed in the "Public Methods" section

What version of the product are you using? On what operating system?
  v1.0.131 on Windows Vista


Doing this works:
/**
 * @class My.Class
 * Description of My.Class
 * @namespace My
 * @extends Ext.util.Observable
 * @constructor
 * @param {string} myString Description of myString
 */
My.Class = function(myString){
    /**
     * @method
     */
    this.myMethod = function() {};
};


Doing this does not work (no @method defined):
/**
 * @class My.Class
 * Description of My.Class
 * @namespace My
 * @extends Ext.util.Observable
 * @constructor
 * @param {string} myString Description of myString
 */
My.Class = function(myString){
    this.myMethod = function() {};
};

Original issue reported on code.google.com by arthura...@gmail.com on 2 Jul 2009 at 6:06

@GoogleCodeExporter
Copy link
Author

If you don't have a method with annotations in your class, then @constructor 
will not
taken affect, I have a way to fix it.

Open class.xsl file in template folder, and find this line: '<!--Methods-->', 
the
following lines before '<!--Events-->' is some logic about how to process method
annotations, then you can find these lines: 
1. '</xsl:when>'
2. '<xsl:otherwise><div class="no-members">This class has no public
methods.</div></xsl:otherwise>'
3. '</xsl:choose>'. 

Then replace No.2 line with these codes below:

                <xsl:otherwise>
                    <xsl:if test="hasConstructor='true'">
                        <table cellspacing="0" class="member-table">
                            <tbody>
                                <tr>
                                    <th colspan="2" class="sig-header">Method</th>
                                    <th class="msource-header">Defined By</th>
                                </tr>
                                <xsl:call-template name="constructor"/>
                            </tbody>
                        </table>
                    </xsl:if>
                    <div class="no-members">This class has no public methods.</div>
                </xsl:otherwise>

Save this file and rebuild your docs, then you can find your constructors.

Original comment by Super...@gmail.com on 5 Aug 2009 at 6:15

@GoogleCodeExporter
Copy link
Author

This looks like a nice solution to me. Unless there's a better solution, I 
suggest 
someone actually submit this fix to source control.

Original comment by arthura...@gmail.com on 7 Aug 2009 at 8:34

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant