当前位置:网站首页>Idea annotation settings

Idea annotation settings

2022-06-11 08:19:00 Scarecrow 0.0

IDEA Note settings

1、 Class notes

open setting

 Insert picture description here

/** * @desc * @auth llp * @date ${YEAR} year ${MONTH} month ${DAY} Japan  ${TIME} */

2、 Method notes

open setting, newly build Template Group , The name is userDefind.

 Insert picture description here

Click on userDefind , newly build Live Template

 Insert picture description here

Abbreviation by *, Description by Method notes , Expand with The Settings for Enter , Template text by :

*
 * @desc 
 * @auth llp
 * @date $date$ $time$$param$ $return$
 */

Click on Edit variables Set the value

 Insert picture description here

1、 date The value of is :date()

2、 time The value of is :time()

3、 param The value of is :

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

4、 return The value of is :

groovyScript("return \"${_1}\" == 'void'?null:'\\r\\n * @return ' + \"${_1}\"", methodReturnType())
原网站

版权声明
本文为[Scarecrow 0.0]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/03/202203020513167363.html