如何在JS eclipse模板中获取函数名和函数参数?

时间:2016-08-04 16:04:14

标签: javascript eclipse templates eclipse-templates

我一直在尝试在eclipse中为JavaScript代码生成自定义注释。为此我使用模板。我想在我的评论中获得以下函数名称和参数。

这是我的模板代码:

/** @method [@public|@private|@protected] [return-type] ${enclosing_method} ${enclosing_method_arguments}
 * @brief
 * @param ${enclosing_method_arguments}
 * @retval ${return_type}
 */

当我尝试为方法生成模板时,这是我的输出:

/** @method [@public|@private|@protected] [return-type] enclosing_method enclosing_method_arguments
 * @brief
 * @param ${enclosing_method_arguments}
 * @retval ${return_type}
 */
 function sub(a,b){
    c=a+b;
    return c;
 }

这就是我想要的:

/** @method [@public|@private|@protected] int sub(a,b)
 * @brief
 * @param a
 * @param b
 * @retval c
 */
 function sub(a,b){
    c=a+b;
    return c;
 }

任何帮助将不胜感激:)

提前致谢。

0 个答案:

没有答案