idea 快捷键live temple 自定义模板引用参数失败问题,设置了live temple 自定义模板,tab键后却引用不出来,引用参数那里为null。
解决方案:
模板/**改为*,
因为和idea自带文档注释冲突。
param引用参数那里,groove脚本里要定义对应名称。
使用/*tab
就可以了
例如:Edit variables 中 return
groovyScript("def returnType = \"${_1}\"; if (returnType == 'void') { return ''; } else { return returnType ; }", methodReturnType())
这里def returnType 有时候不生效,是因为$returnType$这里要与def returnType对应。
有时候不对应也没事。懂了groovy再来。