1. Jindent plug-in

2. Customize a comment template

Plug-ins please understand, not discussed here.Copy the code

This set of template advantages

Parameters can be obtained outside the method (based on the Grovy script)

Support prompt fixed-point editing: After typing, press Enter will automatically jump to the position of the content to be edited [skip if defined setting]

Class comment template

When you create a class, you are prompted to enter the description of the class

Part III Code

#if (${PACKAGE_NAME} && ${PACKAGE_NAME} ! = "")package ${PACKAGE_NAME}; #end #parse("File Header.java") /** *@program: ${PROJECT_NAME} *@description: ${description} *@author: Clover *@created: ${YEAR}/${MONTH}/${DAY} ${HOUR}:${MINUTE} */ public class ${NAME} { }Copy the code

rendering

Method comment template

Create a template group 2. Create a template item 3. Modify the combination key 4. 6. Apply - > OKCopy the code

Edit variables

The template

*
 * @Description: $description$
 * $params$
 * @return: $return$* *@Creator: $creator$
 * @Date: $CreateDate$ $CreateTime$
 *
 * @Modify: $modify$
 * @Date: $ModifyDate$ $ModifyTime$
 *
 */
Copy the code

Description Generates a script

groovyScript("Def result=' please enter method description here '; return result")
Copy the code

Parameter obtaining script

groovyScript("def result=''; def params=\"${_1}\".replaceAll('[\\\\[|\\\\]|\\\\s]', '').split(',').toList(); for(i = 0; i < params.size(); i++) {result+='@param ' + params[i] + ((i < params.size() - 1) ? '\ \ 0' : ')}; return result", methodParameters()) 
Copy the code

rendering