IDEA method annotations automatically obtain return values and pass parameters

1. Setting

1. Add custom annotation shortcuts

2. Annotation content

*
 * desciption 
$params$
 * @return $returns$
 * @Author junwei
 * @Date $date$ $time$
 */

Click edit variables on the right to set the function

The following 3 contents choose the built-in function, the first params fill in the custom function

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' : '')}; return result", methodParameters())

 

Two, use

To use, write /** in the head of the method, and then press the tab key.

1, sketch / **

2. Press the tab key

Method reference floating prompt (PS: the content displayed floating, not all content will be displayed, only a few keywords such as param, return, etc. will appear)

 

Guess you like

Origin blog.csdn.net/qq_37203082/article/details/114634344