You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+84-4Lines changed: 84 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,7 +29,7 @@ Use it to jump from `.pb.go` symbols to `message`, `enum`, `service`, `rpc`, and
29
29
-`.proto -> Go` usage search for definitions, field types, and field names.
30
30
- Sidebar configuration for Proto roots, workspace fallback search, UI language, and Make Proto rules.
31
31
-`Compile Current Proto` command with placeholder-based shell templates.
32
-
- Dry-run command testing before running the compile rule.
32
+
- Dry-run command testing, navigation testing, output access, and rendered command preview from the sidebar.
33
33
34
34
## Highlights
35
35
@@ -41,6 +41,9 @@ Use it to jump from `.pb.go` symbols to `message`, `enum`, `service`, `rpc`, and
41
41
- Configure multiple `protoRoots` for repositories with separated Go and Proto source trees.
42
42
- Fall back to workspace search when `protoRoots` does not resolve a source file.
43
43
- Edit, test, and run a project-specific Proto compile command from the JumpProto sidebar.
44
+
- Preview the rendered Make Proto command for the active `.proto` file before running it.
45
+
- Test the current cursor's navigation result and open the `JumpProto` output channel from the sidebar.
46
+
- Cache workspace scans and support cancellable usage searches for large repositories.
44
47
- Switch JumpProto UI text between English and Chinese.
45
48
46
49
## Quick Start
@@ -57,7 +60,7 @@ Use it to jump from `.pb.go` symbols to `message`, `enum`, `service`, `rpc`, and
57
60
- From Proto, run `JumpProto: Go to Go Usage` on a `message`, `enum`, `service`, `rpc`, field type, or field name.
58
61
- From a `.proto` file, run `JumpProto: Compile Current Proto` after configuring a Make Proto rule.
59
62
- Use the status bar entry while editing Go files as a shortcut to Proto definition navigation.
60
-
- Use the JumpProto Activity Bar sidebar to manage roots, language, workspace search, and compile rules.
63
+
- Use the JumpProto Activity Bar sidebar to manage roots, language, workspace search, compile rules, navigation tests, and output logs.
61
64
62
65
When `gopls` is enabled, VS Code may show both generated Go and Proto definition candidates. Choose the `.proto` candidate when you want the source definition.
63
66
@@ -68,6 +71,9 @@ When `gopls` is enabled, VS Code may show both generated Go and Proto definition
68
71
|`JumpProto: Go to Proto Definition`| Opens the source `.proto` definition for the generated Go symbol under the cursor. |
69
72
|`JumpProto: Go to Go Usage`| Finds Go usage for the Proto symbol or field under the cursor. |
70
73
|`JumpProto: Compile Current Proto`| Runs the configured shell command template for the active `.proto` file. |
74
+
|`JumpProto: Test Navigation`| Resolves the current cursor target and writes the result to output without jumping. |
75
+
|`JumpProto: Open Output`| Opens the `JumpProto` output channel. |
76
+
|`JumpProto: Diagnose Current Symbol`| Writes detailed navigation diagnostics for the current cursor to output. |
71
77
|`JumpProto: Add Proto Root`| Adds a source `.proto` root directory. |
72
78
|`JumpProto: Remove Proto Root`| Removes a configured source `.proto` root directory. |
73
79
|`JumpProto: Toggle Search In Workspace`| Enables or disables workspace fallback search. |
@@ -121,6 +127,27 @@ Supported placeholders:
121
127
|`{relativeProtoNoExt}`| Path relative to `protoSrcRoot`, without `.proto`. |
122
128
|`{protoPackage}`| Package segment inferred from `go_package` or `package`. |
- Description: glob patterns excluded from JumpProto workspace searches.
135
+
136
+
Use this to skip generated, vendor, build, or large directories:
137
+
138
+
```json
139
+
{
140
+
"protoJump.exclude": [
141
+
"**/node_modules/**",
142
+
"**/vendor/**",
143
+
"**/out/**",
144
+
"**/dist/**",
145
+
"**/.git/**",
146
+
"**/third_party/big_generated/**"
147
+
]
148
+
}
149
+
```
150
+
124
151
### `protoJump.uiLanguage`
125
152
126
153
- Type: `"zh" | "en"`
@@ -150,6 +177,17 @@ esac
150
177
151
178
Use `Test Command` in the sidebar before compiling. It performs a shell syntax dry run and writes the rendered command to the `JumpProto` output channel.
152
179
180
+
When a `.proto` file is active, the sidebar shows the command rendered with the current file context. If the preview is unavailable, confirm the file is under `protoJump.protoRoots` or a detectable `proto_src` directory.
181
+
182
+
## Support Boundaries / Troubleshooting
183
+
184
+
- Go -> Proto depends on VS Code and `gopls` resolving the cursor symbol to a generated `.pb.go` definition first. JumpProto then reads the generated file header and follows `// source: path/to/file.proto`.
185
+
- Proto -> Go usage is static workspace search, not a full Go type-system reference query. It covers common qualified imports, import aliases, same-package bare names, field access, getters, and composite literals.
186
+
- Usage search caches Go file lists, file text, `.pb.go` headers, and inferred Go package data. The cache is cleared when Go/Proto files or `protoJump` settings change.
187
+
- Import aliases, default imports, same-package bare names, nested messages, fields, enums, services, and RPCs are supported for common generated-Go layouts, but dynamic reflection or custom wrappers may still be missed.
188
+
-`Compile Current Proto` determines `{protoSrcRoot}` from configured `protoJump.protoRoots` first, then from detectable `proto_src` ancestors with a `Makefile`.
189
+
- Use `JumpProto: Test Navigation` to check the current cursor without moving editors. Use `JumpProto: Diagnose Current Symbol` when navigation fails; it logs editor context, definition-provider results, source header resolution, proto root candidates, Go package inference, and usage-search strategy to the `JumpProto` output channel.
190
+
153
191
## Requirements
154
192
155
193
- Generated Go files should be created by `protoc-gen-go`.
@@ -166,8 +204,10 @@ Use `Test Command` in the sidebar before compiling. It performs a shell syntax d
166
204
167
205
- Go-to-Proto navigation depends on VS Code first resolving the Go symbol to a generated `.pb.go` definition.
168
206
- Proto-to-Go usage search is heuristic and capped to keep workspace scans responsive.
207
+
- Usage searches are capped at 200 references and can be cancelled from the progress notification.
169
208
- Field usage search can miss complex aliasing, reflection, generated helper wrappers, or heavily dynamic code.
170
209
- Proto compile commands run locally through `/bin/zsh`.
210
+
- Use `JumpProto: Open Output` to inspect dry-run commands, diagnostics, and navigation test results.
171
211
172
212
## Privacy
173
213
@@ -199,7 +239,7 @@ JumpProto 会把生成后的 Go 代码重新连回源 `.proto` 定义,也能
199
239
- 支持从 `.proto` 反查 Go 使用处,覆盖定义、字段类型和字段名。
200
240
- 侧边栏集中管理 Proto 根目录、工作区兜底搜索、界面语言和 Make Proto 规则。
201
241
-`Compile Current Proto` 支持基于占位符的 shell 命令模板。
202
-
-编译前可以先执行 dry-run 测试命令。
242
+
-侧边栏支持 dry-run 测试命令、测试跳转、打开输出和查看展开后的命令预览。
203
243
204
244
## 功能亮点
205
245
@@ -211,6 +251,9 @@ JumpProto 会把生成后的 Go 代码重新连回源 `.proto` 定义,也能
211
251
- 支持配置多个 `protoRoots`,适配 Go 代码和 Proto 源码分离的仓库。
212
252
- 当 `protoRoots` 未命中时,可继续在当前工作区兜底搜索。
213
253
- 在 JumpProto 侧边栏里编辑、测试并运行项目自己的 Proto 编译命令。
254
+
- 在执行前预览当前 `.proto` 文件展开后的 Make Proto 命令。
255
+
- 从侧边栏测试当前光标的跳转结果,并快速打开 `JumpProto` 输出面板。
256
+
- 缓存工作区扫描,并支持在大仓库里取消 usage 搜索。
214
257
- JumpProto 侧边栏和提示消息支持英文与中文切换。
215
258
216
259
## 快速开始
@@ -227,7 +270,7 @@ JumpProto 会把生成后的 Go 代码重新连回源 `.proto` 定义,也能
227
270
- 在 Proto 文件中,对 `message`、`enum`、`service`、`rpc`、字段类型或字段名执行 `JumpProto: Go to Go Usage`。
228
271
- 在 `.proto` 文件中,配置 Make Proto 规则后执行 `JumpProto: Compile Current Proto`。
229
272
- 编辑 Go 文件时,可以使用状态栏里的 JumpProto 入口快速跳转到 Proto 定义。
230
-
- 使用 Activity Bar 里的 JumpProto 侧边栏管理根目录、语言、工作区搜索和编译规则。
273
+
- 使用 Activity Bar 里的 JumpProto 侧边栏管理根目录、语言、工作区搜索、编译规则、跳转测试和输出日志。
231
274
232
275
启用 `gopls` 时,VS Code 可能同时给出生成 Go 和 Proto 定义候选。需要源定义时,选择 `.proto` 候选即可。
233
276
@@ -238,6 +281,9 @@ JumpProto 会把生成后的 Go 代码重新连回源 `.proto` 定义,也能
238
281
|`JumpProto: Go to Proto Definition`| 打开光标下生成 Go 符号对应的源 `.proto` 定义。 |
239
282
|`JumpProto: Go to Go Usage`| 查找光标下 Proto 符号或字段的 Go 使用处。 |
240
283
|`JumpProto: Compile Current Proto`| 按当前 `.proto` 文件上下文运行已配置的 shell 命令模板。 |
284
+
|`JumpProto: Test Navigation`| 解析当前光标的目标并写入输出面板,不执行跳转。 |
285
+
|`JumpProto: Open Output`| 打开 `JumpProto` 输出面板。 |
286
+
|`JumpProto: Diagnose Current Symbol`| 将当前光标的详细诊断信息写入输出面板。 |
241
287
|`JumpProto: Add Proto Root`| 添加源 `.proto` 根目录。 |
242
288
|`JumpProto: Remove Proto Root`| 移除已配置的源 `.proto` 根目录。 |
243
289
|`JumpProto: Toggle Search In Workspace`| 开启或关闭工作区兜底搜索。 |
@@ -291,6 +337,27 @@ cd {protoSrcRoot} && make special_proto packagename={protoPackage} filename={pro
0 commit comments