Skip to content

Commit ca49e9a

Browse files
committed
docs: enhance README and README_zh with new features and images; remove outdated documentation
1 parent 04eeb3d commit ca49e9a

File tree

11 files changed

+121
-22
lines changed

11 files changed

+121
-22
lines changed

README.md

Lines changed: 65 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,62 @@ Go++ is a VS Code extension designed to enhance Go development workflow by impro
1111
- **Quick Run & Debug**: One-click execution and debugging for main functions with parameter support
1212
- **Code Translation**: Multi-engine comment translation for international development teams
1313

14+
![CodeLens buttons](image/README_zh/1744116598456.png)
15+
16+
Ⓖ - Generate code button
17+
Ⓘ - Interface implementation button
18+
Ⓡ - References button
19+
20+
![Generate code options](image/README_zh/1744117889827.png)
21+
22+
Click Ⓖ Generate code button to:
23+
24+
1. Generate interface methods (interface names can be 🔍 searched, unlike the official tool)
25+
2. Generate struct tags, specifying tag name and format (camelCase or snake_case)
26+
3. Generate options pattern code
27+
4. Generate unit tests
28+
29+
![Run and debug options](image/README_zh/1744116937929.png)
30+
31+
* Run - Execute directly using saved parameters
32+
* Debug - Debug directly using saved parameters
33+
* Args - Set parameters and save them for Run and Debug operations
34+
35+
Go Libraries tree view:
36+
37+
![Go Libraries tree](image/README_zh/1744117411575.png)
38+
39+
1. When navigating to source code, the relevant file automatically expands
40+
2. Cmd + click on import statements will also automatically expand the corresponding directory
41+
42+
Translation feature:
43+
44+
![Translation feature](image/README_zh/1744117722669.png)
45+
46+
1. Translate selected text (select text then click the lightbulb to choose translation)
47+
2. Automatic comment translation (useful for reading source code, with caching to conserve free translation quotas)
48+
49+
Translation configuration:
50+
51+
![Translation settings](image/README_zh/1744118698911.png)
52+
53+
Supports Tencent Translator, ByteDance Volcano Translator, Microsoft Translator (unverified), and Google Translate (unverified)
54+
55+
For bugs or feature ideas, please provide feedback.
56+
57+
Click on the bottom left -> Report Issue -> Brief description -> Authorize GitHub
58+
This will automatically submit an issue:
59+
60+
![Report issue](image/README_zh/1744118949074.png)
61+
62+
63+
The animation demonstrates the seamless navigation experience:
64+
65+
1. Starting from a struct implementation and finding which interfaces it implements
66+
2. Navigating from an interface definition to view all its implementing structs
67+
3. Jumping from a method in a struct directly to its corresponding interface method
68+
4. Finding all implementations of an interface method across different structs
69+
1470
## Usage
1571

1672
### Interface Navigation
@@ -33,16 +89,11 @@ Right-click menu supports operations like tidy, update, and source code download
3389
| ----------------------------------- | -------------------- |
3490
| Focus/Exit Go Library | Ctrl(⌘) + Shift + ' |
3591
| Reveal current dependency in editor | Ctrl(⌘) + Shift + / |
36-
| Collapse Go Library | Ctrl(⌘) + Shift + . |
37-
38-
## Code Example
39-
40-
```go
41-
// Interface definition
42-
type Greeter interface {
43-
SayHello() string
44-
SayGoodbye() string
45-
}
92+
| // Interface definition | |
93+
| type Greeter interface { | |
94+
| SayHello() string | |
95+
| SayGoodbye() string | |
96+
| } | |
4697

4798
// Implementation
4899
type EnglishGreeter struct{}
@@ -51,6 +102,7 @@ type EnglishGreeter struct{}
51102
func (g *EnglishGreeter) SayHello() string {
52103
return "Hello!"
53104
}
105+
54106
```
55107
56108
## Requirements
@@ -84,6 +136,7 @@ Go++ is built on these core technologies:
84136
## Project Structure
85137
86138
```
139+
87140
gopp/
88141
├── docs/ # Documentation
89142
├── resources/ # Icons and resources
@@ -95,6 +148,7 @@ gopp/
95148
│ ├── pkg/ # Utilities
96149
│ └── extension.ts # Entry point
97150
└── test/ # Test files
151+
98152
```
99153
100154
## Contributing
@@ -104,3 +158,4 @@ Issues and Pull Requests are welcome to improve Go++. For problem reporting, use
104158
## License
105159
106160
MIT
161+
```

README_zh.md

Lines changed: 54 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,60 @@ Go++ 是一个专为 Go 开发者打造的 VS Code 扩展,大幅提升接口
1111
- **一键运行调试**:为 main 函数提供即时运行、调试功能,支持参数保存
1212
- **代码翻译**:提供多引擎支持的代码注释翻译功能
1313

14-
## 使用方法
14+
15+
![1744116598456](image/README_zh/1744116598456.png)
16+
17+
Ⓖ - Generate code button 生成代码按钮
18+
19+
Ⓘ - Interface implementation button 接口实现按钮
20+
21+
Ⓡ - References 引用按钮
22+
23+
24+
![1744117889827](image/README_zh/1744117889827.png)
25+
26+
点击 Ⓖ 生成代码按钮
27+
28+
1. 可以生成接口方法(接口名可以🔍搜索, 官方的不支持搜索😢)
29+
2. 生成结构体标签,指定标签名,值是驼峰还是下划线。
30+
3. 生成 options 选项模式。
31+
4. 生成单元测试。
32+
33+
34+
![1744116937929](image/README_zh/1744116937929.png)
35+
36+
* Run - 直接运行,使用保存的参数
37+
* Debug - 直接调试,使用保存的参数
38+
* Args - 设置参数并保存,供 Run 和 Debug 使用
39+
40+
Go Libraries 树
41+
42+
![1744117411575](image/README_zh/1744117411575.png)
43+
44+
1. 代码跳转到源码的时候会自动展开对应的文件。
45+
2. cmd + 点击 import 的位置也会自动展开对应的目录。
46+
47+
48+
翻译功能
49+
50+
![1744117722669](image/README_zh/1744117722669.png)
51+
52+
1. 选中翻译文本(选中文本后点击小灯泡选择翻译)
53+
2. 注释自动翻译(哈哈,看源码不慌,但是翻译字符量大,小心免费额度不够用, 也做了缓存处理)
54+
55+
翻译配置
56+
57+
![1744118698911](image/README_zh/1744118698911.png)
58+
59+
支持 腾讯翻译君、字节火山翻译、微软翻译(没验证)、google 翻译(没验证)
60+
61+
有bug请反馈,有什么新点子的功能也可以留言。
62+
63+
点击左下角 -> 报告问题 -> 简单描述 -> 授权github
64+
65+
就会自动提交到 issue
66+
67+
![1744118949074](image/README_zh/1744118949074.png)
1568

1669
### 接口导航
1770

docs/项目切换.md

Lines changed: 0 additions & 9 deletions
This file was deleted.

image/README_zh/1744116598456.png

130 KB
Loading

image/README_zh/1744116937929.png

111 KB
Loading

image/README_zh/1744117411575.png

53.2 KB
Loading

image/README_zh/1744117722669.png

163 KB
Loading

image/README_zh/1744117889827.png

110 KB
Loading

image/README_zh/1744118698911.png

170 KB
Loading

image/README_zh/1744118949074.png

94.9 KB
Loading

src/provider/codelens.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ class GoCodeLensProvider implements vscode.CodeLensProvider {
6969
}, 30 * 60 * 1000); // 30分钟清理一次 (clear every 30 minutes)
7070
}
7171

72-
72+
7373

7474
// 添加防抖函数
7575
// Add debounce function
@@ -193,7 +193,7 @@ class GoCodeLensProvider implements vscode.CodeLensProvider {
193193
// 显示 r、i、g
194194
parser.onStructFunc = async (i, structName) => {
195195
const range = new vscode.Range(i, 0, i, lines[i].length);
196-
196+
197197
const structFields = parser.getStructFields(i); // 解析结构体字段
198198
G(document, i, range, this.codeLenses, structName, structFields); // 生成测试用例
199199
await I(document, structName, IToType.ToInterface, i, range, this.codeLenses); // 结构体到接口

0 commit comments

Comments
 (0)