IntelliJ IDEA注释

File-Settings-Editor
在File and Code Templates-Includes下,设置File Header的注释(用于类注释)
/**

* author: giserDev
*/

在Live Templates下选择右侧+号,添加Template Group,命名为giser;
选择右侧+号,添加Live Template,在Abbreviation中设置快捷键,在Description中设置描述信息,
在Template text中设置注释格式,如下:
/**
 * @note  
 * $params$
 * @return $return$
 * Created By giser on $date$
 */
 点击Edit variables,编辑模板变量,设置对应的值
 其中params变量设置为: 

params: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())


    return变量设置为methodReturnType()
    date变量设置为date()
保存应用即可

发布了11 篇原创文章 · 获赞 9 · 访问量 1万+

猜你喜欢

转载自blog.csdn.net/SUNBOYmxbsH/article/details/103984981
今日推荐