Goannogolang 自动生成函数注释插件
Goanno 是 goland 的一个插件,这个插件为 golang 提供了自动生成注释的功能。
How to install
- goland 插件市场(搜索 Goanno)
- 下载 release jar(goland install from disk) goanno.jar
How to use
- .control + commond + / (for windows: control + alt + /)
- Right click -> Generate -> Goanno
- Edit comment template
- Select "Tools - Goanno Setting"
- Edit template
Template
Args | Desc |
---|---|
${todo} | Blank Placeholder |
${receiver} | function receiver name or type |
${params} | function params name or type |
${return_types} | function output name or type |
${function_name} | function name |
${date} | yyyy-MM-dd HH🇲🇲ss |
V2.1.0
Args | Desc |
---|---|
${todo} | Blank Placeholder |
${receiver} | function receiver name or type |
${params} | function params name or type |
${return_types} | function output name or type |
${function_name} | function name |
${param_name} | function params name |
${param_type} | function params type |
${param_name_type} | function params name and type |
${receiver_name} | function receiver name |
${receiver_type} | function receiver type |
${receiver_name_type} | function receiver name and type |
${ret} | function output name or type, equals to ${return_types} |
${ret_name} | function output name |
${ret_type} | function output type |
${ret_name_type} | return name and type |
${note} | previous comments (NOT SUPPORT, dev...) |
V3.0.0
New Config Support
Args | Desc |
---|---|
${interface_name} | Name of Interface |
${struct_name} | Name of Struct |
${struct_field_name} | Name of Struct Field |
${package_name} | Name of Package |
Suggest Templates
java style(default)
/*
* @Description: ${todo}
* @receiver ${receiver}
* @param ${params}
* @return ${return_types}
*/
golang style
//
// @Description: ${todo}
// @receiver ${receiver}
// @param ${params}
// @return ${return_types}
//
V2.2.0
Supports rewrite previous comments / 支持覆盖原有注释
Setting: "Tools - Goanno Setting - Select Checkbox"
How to build
Project SDK: IntelliJ IDEA Community Edition IC-202.8194.7
JDK: 1.8
IDEA Version: IntelliJ IDEA 2020.2.4 (Community Edition)
Tip: Do not use 2020.3
Test File:
resource
- test.go
- test2.go
src/org/leo/goanno/test
- GenerateTest.java
评论