zoukankan      html  css  js  c++  java
  • 【IDEA】IDEA自定义注解无法自动识别入参和出参

    IDEA自定义注解无法自动识别入参和出参

    原因:使用方法错误 直接使用名字是无法触发的

    官方要求:/* + 自定义注释名 + 触发键

    这里建议使用:

    /* + * + Enter方式触发

    image-20211012171758541

    这里推荐一种模板格式(就是这样 不要另外加 /*会冗余 这样写刚好符合javadoc格式):

    *
     * @author      : DengSchoo
     * @description : TODO
     * @dateTime    : $DATE$ $TIME$
     * @params
     $params$
     * @return      : $return$
     */
    

    使用:

    /** + Enter/Tab

    image-20211012181302086

    我的params参数变量对应groovy脚本:

    groovyScript("def result=''; 
    def types="${_2}".replaceAll('[\\[|\\]|\\s]', '').split(',').toList(); 
    def params="${_1}".replaceAll('[\\[|\\]|\\s]', '').split(',').toList(); for(i = 0; i < params.size(); i++) {
    	result+= '\t* @param' + i + '	: ' + params[i] + '	[' + types[i] + ((i < params.size() - 1) ? ']\n' : ']')}; 
    	return result", methodParameters(), methodParameterTypes()) 
    
  • 相关阅读:
    NOI2021游记-记最后一段日子
    7.20 ZROI-Day7模拟赛
    7.19 ZROI-Day6模拟赛
    7.18 ZROI-Day5模拟赛
    7.17 ZROI-Day4模拟赛
    7.16 ZROI-DAY3 模拟赛
    7.15 ZROI-DAY2 模拟赛
    7.13 ZROI-DAY1赛后总结
    7.9模拟赛赛后总结
    7.7模拟赛赛后总结
  • 原文地址:https://www.cnblogs.com/DengSchoo/p/15398702.html
Copyright © 2011-2022 走看看