Add Comment
To add comments to the Java code in IntelliJ idea, you first need to configure the comment template, and then use the template shortcut to generate the comment.
The following sections are described in [configuration template], [template use]
--------------------------------------------Gorgeous split-line--------------------------------------------
Configure templates
First find the place to configure the template preperences->live Templates
The next thing to do is create a template.
1 click [Right Plus] Select second item, create Group, group name MyGroup
2 Click [Right Plus] Select the first item, add the template to the group, add
Template content
Template Text fill in the following content
/** * * $params $* @Author: tianminghai* @Date: $time $ $date $ */
Click Edit variables to configure the variable
Params Configuration Expression Code snippet
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)? ' \\n\\b ': ')}; return result ", Methodparameters ())
This is the template creation complete
--------------------------------------------Gorgeous split-line--------------------------------------------
Template use
Enter add inside the function or outside the class, and then click Tab (Note that the Add input location is within the method and the parameter is displayed)
The effect is as follows
PS: The upper margin just can input method introduction
IntelliJ idea for MAC shortcut set rollup