Skip to content

Commit bce1be3

Browse files
authored
Merge pull request #2 from SivanCola/codex/complete-jumpproto-upgrades
[codex] Complete JumpProto quality upgrades
2 parents e5d9e74 + df4db50 commit bce1be3

32 files changed

Lines changed: 3689 additions & 1578 deletions

.github/workflows/release.yml

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,12 @@ on:
44
push:
55
tags:
66
- "v*"
7-
workflow_dispatch: {}
7+
workflow_dispatch:
8+
inputs:
9+
version:
10+
description: "Release version without leading v. Must match package.json."
11+
required: true
12+
type: string
813

914
jobs:
1015
release:
@@ -22,18 +27,26 @@ jobs:
2227
- name: Install
2328
run: npm ci
2429

30+
- name: Verify release metadata
31+
env:
32+
RELEASE_VERSION: ${{ inputs.version }}
33+
run: npm run release:verify:metadata
34+
2535
- name: Test
2636
run: npm test
2737

2838
- name: Package VSIX
29-
run: |
30-
mkdir -p dist
31-
npx @vscode/vsce package --out dist/JumpProto.vsix
39+
run: npm run vsix
40+
41+
- name: Verify VSIX
42+
env:
43+
RELEASE_VERSION: ${{ inputs.version }}
44+
run: npm run release:verify
3245

3346
- name: Publish to VS Code Marketplace
3447
env:
3548
VSCE_PAT: ${{ secrets.VSCE_PAT }}
36-
run: npx @vscode/vsce publish -p "$VSCE_PAT"
49+
run: npx @vscode/vsce publish --packagePath dist/JumpProto.vsix -p "$VSCE_PAT"
3750

3851
- name: Publish to Open VSX
3952
env:
@@ -43,4 +56,5 @@ jobs:
4356
- name: Create GitHub Release
4457
uses: softprops/action-gh-release@v2
4558
with:
59+
tag_name: ${{ github.ref_type == 'tag' && github.ref_name || format('v{0}', inputs.version) }}
4660
files: dist/JumpProto.vsix

.jumpjump/bookmarks.json

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"version": 2,
3+
"groups": [
4+
{
5+
"id": "ungrouped",
6+
"name": "未分组",
7+
"order": 0,
8+
"collapsed": false,
9+
"sortBy": "createdAt",
10+
"sortDirection": "desc",
11+
"system": true
12+
},
13+
{
14+
"id": "group-测试",
15+
"name": "测试",
16+
"order": 1,
17+
"collapsed": false,
18+
"sortBy": "manual",
19+
"sortDirection": "asc"
20+
}
21+
],
22+
"items": [
23+
{
24+
"id": "50354de4-e8a6-4d43-9ec0-0a2d64aa4a24",
25+
"type": "line",
26+
"label": "verify-release.mjs:1",
27+
"path": "scripts/verify-release.mjs",
28+
"line": 1,
29+
"groupId": "group-测试",
30+
"lastOpenedAt": "2026-04-29T11:59:10.192Z",
31+
"createdAt": "2026-04-29T11:58:41.438Z",
32+
"updatedAt": "2026-04-29T11:59:02.594Z",
33+
"manualOrder": 0
34+
}
35+
]
36+
}

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Changelog
2+
3+
## 1.0.8 - 2026-04-29
4+
5+
- Split extension lifecycle, configuration, navigation, usage search, compile, diagnostics, and command registration into focused modules.
6+
- Added integration fixtures covering Go/proto navigation, workspace-external proto roots, import aliases, same-package usages, nested messages, fields, enums, services, and RPCs.
7+
- Added `JumpProto: Diagnose Current Symbol` for troubleshooting navigation failures from the output channel.
8+
- Added release checks for matching release versions, non-empty changelog entries, passing tests, and verified VSIX contents.
9+
- Added sidebar self-check actions for testing navigation, opening output, and previewing the rendered Make Proto command.
10+
- Documented support boundaries and troubleshooting notes in English and Chinese.
11+
- Improved usage-search performance with cancellable scans, cached Go/proto metadata, workspace file-change invalidation, and configurable `protoJump.exclude` patterns.

README.md

Lines changed: 84 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Use it to jump from `.pb.go` symbols to `message`, `enum`, `service`, `rpc`, and
2929
- `.proto -> Go` usage search for definitions, field types, and field names.
3030
- Sidebar configuration for Proto roots, workspace fallback search, UI language, and Make Proto rules.
3131
- `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.
3333

3434
## Highlights
3535

@@ -41,6 +41,9 @@ Use it to jump from `.pb.go` symbols to `message`, `enum`, `service`, `rpc`, and
4141
- Configure multiple `protoRoots` for repositories with separated Go and Proto source trees.
4242
- Fall back to workspace search when `protoRoots` does not resolve a source file.
4343
- 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.
4447
- Switch JumpProto UI text between English and Chinese.
4548

4649
## Quick Start
@@ -57,7 +60,7 @@ Use it to jump from `.pb.go` symbols to `message`, `enum`, `service`, `rpc`, and
5760
- From Proto, run `JumpProto: Go to Go Usage` on a `message`, `enum`, `service`, `rpc`, field type, or field name.
5861
- From a `.proto` file, run `JumpProto: Compile Current Proto` after configuring a Make Proto rule.
5962
- 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.
6164

6265
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.
6366

@@ -68,6 +71,9 @@ When `gopls` is enabled, VS Code may show both generated Go and Proto definition
6871
| `JumpProto: Go to Proto Definition` | Opens the source `.proto` definition for the generated Go symbol under the cursor. |
6972
| `JumpProto: Go to Go Usage` | Finds Go usage for the Proto symbol or field under the cursor. |
7073
| `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. |
7177
| `JumpProto: Add Proto Root` | Adds a source `.proto` root directory. |
7278
| `JumpProto: Remove Proto Root` | Removes a configured source `.proto` root directory. |
7379
| `JumpProto: Toggle Search In Workspace` | Enables or disables workspace fallback search. |
@@ -121,6 +127,27 @@ Supported placeholders:
121127
| `{relativeProtoNoExt}` | Path relative to `protoSrcRoot`, without `.proto`. |
122128
| `{protoPackage}` | Package segment inferred from `go_package` or `package`. |
123129

130+
### `protoJump.exclude`
131+
132+
- Type: `string[]`
133+
- Default: `["**/node_modules/**", "**/vendor/**", "**/out/**", "**/dist/**", "**/.git/**"]`
134+
- 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+
124151
### `protoJump.uiLanguage`
125152

126153
- Type: `"zh" | "en"`
@@ -150,6 +177,17 @@ esac
150177

151178
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.
152179

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+
153191
## Requirements
154192

155193
- 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
166204

167205
- Go-to-Proto navigation depends on VS Code first resolving the Go symbol to a generated `.pb.go` definition.
168206
- 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.
169208
- Field usage search can miss complex aliasing, reflection, generated helper wrappers, or heavily dynamic code.
170209
- Proto compile commands run locally through `/bin/zsh`.
210+
- Use `JumpProto: Open Output` to inspect dry-run commands, diagnostics, and navigation test results.
171211

172212
## Privacy
173213

@@ -199,7 +239,7 @@ JumpProto 会把生成后的 Go 代码重新连回源 `.proto` 定义,也能
199239
- 支持从 `.proto` 反查 Go 使用处,覆盖定义、字段类型和字段名。
200240
- 侧边栏集中管理 Proto 根目录、工作区兜底搜索、界面语言和 Make Proto 规则。
201241
- `Compile Current Proto` 支持基于占位符的 shell 命令模板。
202-
- 编译前可以先执行 dry-run 测试命令。
242+
- 侧边栏支持 dry-run 测试命令、测试跳转、打开输出和查看展开后的命令预览
203243

204244
## 功能亮点
205245

@@ -211,6 +251,9 @@ JumpProto 会把生成后的 Go 代码重新连回源 `.proto` 定义,也能
211251
- 支持配置多个 `protoRoots`,适配 Go 代码和 Proto 源码分离的仓库。
212252
-`protoRoots` 未命中时,可继续在当前工作区兜底搜索。
213253
- 在 JumpProto 侧边栏里编辑、测试并运行项目自己的 Proto 编译命令。
254+
- 在执行前预览当前 `.proto` 文件展开后的 Make Proto 命令。
255+
- 从侧边栏测试当前光标的跳转结果,并快速打开 `JumpProto` 输出面板。
256+
- 缓存工作区扫描,并支持在大仓库里取消 usage 搜索。
214257
- JumpProto 侧边栏和提示消息支持英文与中文切换。
215258

216259
## 快速开始
@@ -227,7 +270,7 @@ JumpProto 会把生成后的 Go 代码重新连回源 `.proto` 定义,也能
227270
- 在 Proto 文件中,对 `message``enum``service``rpc`、字段类型或字段名执行 `JumpProto: Go to Go Usage`
228271
-`.proto` 文件中,配置 Make Proto 规则后执行 `JumpProto: Compile Current Proto`
229272
- 编辑 Go 文件时,可以使用状态栏里的 JumpProto 入口快速跳转到 Proto 定义。
230-
- 使用 Activity Bar 里的 JumpProto 侧边栏管理根目录、语言、工作区搜索和编译规则
273+
- 使用 Activity Bar 里的 JumpProto 侧边栏管理根目录、语言、工作区搜索、编译规则、跳转测试和输出日志
231274

232275
启用 `gopls` 时,VS Code 可能同时给出生成 Go 和 Proto 定义候选。需要源定义时,选择 `.proto` 候选即可。
233276

@@ -238,6 +281,9 @@ JumpProto 会把生成后的 Go 代码重新连回源 `.proto` 定义,也能
238281
| `JumpProto: Go to Proto Definition` | 打开光标下生成 Go 符号对应的源 `.proto` 定义。 |
239282
| `JumpProto: Go to Go Usage` | 查找光标下 Proto 符号或字段的 Go 使用处。 |
240283
| `JumpProto: Compile Current Proto` | 按当前 `.proto` 文件上下文运行已配置的 shell 命令模板。 |
284+
| `JumpProto: Test Navigation` | 解析当前光标的目标并写入输出面板,不执行跳转。 |
285+
| `JumpProto: Open Output` | 打开 `JumpProto` 输出面板。 |
286+
| `JumpProto: Diagnose Current Symbol` | 将当前光标的详细诊断信息写入输出面板。 |
241287
| `JumpProto: Add Proto Root` | 添加源 `.proto` 根目录。 |
242288
| `JumpProto: Remove Proto Root` | 移除已配置的源 `.proto` 根目录。 |
243289
| `JumpProto: Toggle Search In Workspace` | 开启或关闭工作区兜底搜索。 |
@@ -291,6 +337,27 @@ cd {protoSrcRoot} && make special_proto packagename={protoPackage} filename={pro
291337
| `{relativeProtoNoExt}` | 相对 `protoSrcRoot` 的路径,不含 `.proto`|
292338
| `{protoPackage}` | 根据 `go_package``package` 推导出的包名片段。 |
293339

340+
### `protoJump.exclude`
341+
342+
- 类型:`string[]`
343+
- 默认:`["**/node_modules/**", "**/vendor/**", "**/out/**", "**/dist/**", "**/.git/**"]`
344+
- 说明:JumpProto 工作区搜索时排除的 glob 规则。
345+
346+
可以用它跳过生成目录、vendor、构建目录或体积很大的目录:
347+
348+
```json
349+
{
350+
"protoJump.exclude": [
351+
"**/node_modules/**",
352+
"**/vendor/**",
353+
"**/out/**",
354+
"**/dist/**",
355+
"**/.git/**",
356+
"**/third_party/big_generated/**"
357+
]
358+
}
359+
```
360+
294361
### `protoJump.uiLanguage`
295362

296363
- 类型:`"zh" | "en"`
@@ -320,6 +387,17 @@ esac
320387

321388
编译前建议先在侧边栏点击 `Test Command`。它只做 shell 语法 dry-run,并把展开后的命令写入 `JumpProto` 输出面板。
322389

390+
当当前活动文件是 `.proto` 时,侧边栏会展示按当前文件上下文展开后的命令。如果无法预览,请确认该文件位于 `protoJump.protoRoots`,或位于可识别的 `proto_src` 目录下。
391+
392+
## 支持边界 / Troubleshooting
393+
394+
- Go -> Proto 依赖 VS Code 和 `gopls` 先把光标符号解析到生成的 `.pb.go` 定义。JumpProto 再读取生成文件头部,并根据 `// source: path/to/file.proto` 回源。
395+
- Proto -> Go usage 是静态工作区搜索,不等同于完整 Go 类型系统引用查询。它覆盖常见的带包名引用、import alias、同包裸名、字段访问、getter 和结构体字面量。
396+
- Usage 搜索会缓存 Go 文件列表、文件内容、`.pb.go` 头部和推断出的 Go package 信息;当 Go/Proto 文件或 `protoJump` 配置变化时会自动失效。
397+
- import alias、默认 import、同包裸名、nested message、字段、enum、service、rpc 会覆盖常见生成 Go 布局,但反射、动态代码或自定义包装仍可能漏掉。
398+
- `Compile Current Proto` 会优先从 `protoJump.protoRoots` 判断 `{protoSrcRoot}`,然后尝试识别带 `Makefile``proto_src` 祖先目录。
399+
- 使用 `JumpProto: Test Navigation` 可以只检查当前光标解析结果而不跳转。跳转失败时使用 `JumpProto: Diagnose Current Symbol`,它会把编辑器上下文、definition provider 结果、source header 解析、proto root 候选、Go package 推断和 usage 搜索策略写入 `JumpProto` 输出面板。
400+
323401
## 前置条件
324402

325403
- Go 代码应由 `protoc-gen-go` 生成。
@@ -336,8 +414,10 @@ esac
336414

337415
- Go 到 Proto 跳转依赖 VS Code 先把 Go 符号解析到生成的 `.pb.go` 定义。
338416
- Proto 到 Go 的使用处搜索是启发式扫描,并会限制结果数量以保持响应速度。
417+
- Usage 搜索最多返回 200 个引用,并可在进度通知里取消。
339418
- 字段使用处搜索可能漏掉复杂别名、反射、生成辅助包装或高度动态的代码。
340419
- Proto 编译命令会在本机通过 `/bin/zsh` 执行。
420+
- 可以用 `JumpProto: Open Output` 查看 dry-run 命令、诊断信息和跳转测试结果。
341421

342422
## 隐私
343423

0 commit comments

Comments
 (0)