Idea generation and efficient integration of various
Rapid generation method method comment
Configuration
- Open Idea ---> Settings, live search
- Right click the + sign to create a set of templates Template Group, after re-create the template Live Template, the template name *
* Here we use as a template name, and the use of non-indented * as the first line of content in the template. Convenient method we use when creating the / * and then tab to create a method comment. So we do not need to change operating practices. Is not it feel more convenient!
- Template reads as follows:
*
* 功能:
* $VAR1$
$params$
* @return $returns$
* @author Keats
* @date $date$ $time$
*/
After using the variable name $ $ define variables in the template, you can edit the contents of the variables in the right side of the Edit Variables
Here the method name are the words too literally, I do not too much to explain, script code param variables are as follows:
groovyScript("def result=''; def params=\"${_1}\".replaceAll('[\\\\[|\\\\]|\\\\s]', '').split(',').toList(); for(i = 0; i < params.size(); i++) {result+=' * @param ' + params[i] + '\\t' + ((i < params.size() - 1) ? '\\n' : '')}; return result", methodParameters())
Paste this code into the input box, after confirming press Enter, OK save.
- Finally, set the template is valid EveryWhere