Netbeans 8 auto add author to method comment

1.2k views Asked by At

When I type a methods and generate comments via /** enter. It generates comment like this.

/**
* @param int $weight
* @return \KT_Forbes_Theme_Model
*/

Is the a possibility to auto add @author ?

/**
* @author A good guy
* @param int $weight
* @return \KT_Forbes_Theme_Model
*/

I have to add the @autor manualy for all the method, it is really anoing.

2

There are 2 answers

0
Adrian Hernandez-Lopez On BEST ANSWER

It seems that it is not possible in current NetBeans versions as reported in https://netbeans.org/bugzilla/show_bug.cgi?id=251426. Also there are some related posts about this issue Modify command / template for function commenting in NetBeans. Triggering with "/** + Enter key" or Edit Comment Template in Netbeans PHP 6.8 (this last one does not solve the issue - at least in NetBeans 8.1).

I'm currently fighting with the IDE to include the auto comments with some data cause the comment added looks like:

/**
 *
 */

whitout any info included.

0
Isabel On

This output is given typically for void methods, with no parameters.
i.e. public void parameterMapping()

For methods that have parameters and a return value should look like this:

/**
 *
 * @param parameter
 * @return
 */
private ASTNode recursiveParameterParser(ASTNode parameter)