Skip to content

feat(desktop): support bidirectional implementation navigation and gutter icons - #2391

Merged
1lck merged 1 commit into
mainfrom
feat/implementation-navigation-and-gutter-icons
Nov 24, 2026
Merged

1lck merged 1 commit into
mainfrom
feat/implementation-navigation-and-gutter-icons

Conversation

@1lck

@1lck 1lck commented Nov 24, 2026

Copy link
Copy Markdown
Owner

关联 Issue / Linked issue

  • 无(用户直接反馈并要求本地无头验证后合并发布)

PR 类型 / Type

  • feat:新功能或用户可见的改进

改动说明 / What changes

背景 / Why

用户反馈在接口定义和实现类之间无法像 IntelliJ IDEA 那样通过左侧绿色 I / 蓝色 O 行首图标直观识别并双向跳转,也缺少统一的 Go to Implementation 与 Go to Super Declaration 入口。

改动 / Changes

  • Core 修订升级:将 scripts/desktop/build-desktop-core.sh 的 PINNED_CORE_REVISION 升级至 1310ee36258230e83fe1513ab71b67e2af157edd(含 Lithe-IDEA/Lithe-core-rust#198)。
  • 宿主图标能力:在 desktop/internal/core/plugin_session.go 的 EditorHost.ActionIcons 中新增 navigate-implemented、navigate-implementing、navigate-overridden、navigate-overriding。
  • 行号栏图标与命中测试:
    • desktop/internal/icons/gutter_nav.go:新增 16x16 亮色/暗色多层图标(绿色 I↓/I↑、蓝色 O↓/O↑ 及上下箭头回退)。
    • desktop/internal/editorview/lineicons.go、lineicons_test.go:实现零分配 LineIconAt 命中测试并屏蔽软换行续行。
  • 双通道与交互体验:
    • desktop/internal/workbench/editor_actions.go、editor_view.go、root.go、theme.go:支持同行 navigate-up / navigate-down 双通道并排渲染、主题切换缓存刷新、悬停 Tooltip 展示、Suppress 启动提示及多目标定位跳转。
  • 双向语义跳转与快捷键:
    • desktop/internal/workbench/editor_menu.go、pluginsemantics.go、pluginsemantics_view.go、documents.go、document_links.go:补充 Go to Implementation(Opt+Cmd+B,走标准 LSP textDocument/implementation)、Go to Super Declaration(Cmd+U)以及 fileURILocalPath。
  • i18n 与功能矩阵:
    • shared/i18n/messages.json、locales/en-US.json、locales/zh-CN.json、desktop/internal/i18n/shared.generated.go:补充 6 条共享中英文词条并重新生成。
    • shared/platform-feature-matrix/features/lsp-navigation-edits.json、plugin-editor-actions.json:登记实现情况(真机 verificationStatus 保持 pending)。
  • 测试覆盖:更新 editoractions_test.go、pluginsemantics_test.go,新增无头截图测试 navigation_gutter_visual_test.go。

不在本 PR 范围内 / Out of scope

  • 具体 Java 插件的实现(分别在 lithe-plugin-java 与 lithe-plugin-java-navigation 中提交与发布)。

类型专属:feat

多平台对齐

  • 两端都具备:合入后 macOS 与 Windows 都具备该能力(桌面端共享 Go/Viva 实现)

范围检查 / Scope checks

功能矩阵 / Feature matrix

  • 已更新 shared/platform-feature-matrix/features/lsp-navigation-edits.json 与 plugin-editor-actions.json(真实窗口验证保持 pending)
  • 已运行 ./scripts/platform-feature-matrix/verify-platform-feature-matrix.sh(validated 222 platform capabilities)
  • 没有提交 .artifacts/ 下生成的矩阵视图

插件归属 / Plugin ownership

  • 仅修改通用宿主能力与 editor.actions / LSP implementation 通用扩展点,无具体插件名称或依赖引用
  • 新增测试使用测试内联双倍/合成动作数据

UI 验证 / UI evidence

  • 已运行无头视觉测试 TestVisualNavigationGutter(覆盖 light-en、light-zh-Hans、dark-en、dark-zh-Hans,共 16 张截图,并人工检查了悬停提示与暗色多目标弹窗渲染)

统一日志系统 / Structured logging

  • [N/A] 未新增独立顶层生命周期事件;沿用现有编辑器动作与语义跳转工作台路径

界面文案 / i18n

  • 宿主新增 6 条文案均通过 shared/i18n/ 生成并已运行 verify-app-language-localization.mjs 与 generate-i18n.mjs --check(12651/12651)

逻辑归属 / Logic placement

  • 图标能力白名单、editorActions.decode 校验及语义规则保持在 Rust Core(Lithe-IDEA/Lithe-core-rust#198)

性能与内存 / Performance and memory

  • 命中测试 LineIconAt 保持零分配;运行 editor-bench.sh 显示 24 项 BenchmarkEditorViewPaint/* 与 BenchmarkEditorViewScroll/* 均为 0 B / 0 allocs/op

设置 / Settings

N/A:未新增或修改设置项。

插件契约 / Plugin contract

  • Core PR Lithe-IDEA/Lithe-core-rust#198 已先合入并更新协议更新记录
  • scripts/desktop/build-desktop-core.sh PINNED_CORE_REVISION 已升级至 1310ee36258230e83fe1513ab71b67e2af157edd

发行包与资源 / Bundle and resources

  • 已运行 ./scripts/desktop/verify/verify-runtime-bundle-immutability.sh 通过

无用代码与重构 / Dead code and refactoring

  • 无多余改动或遗留产物

验证 / Verification

命令或操作 平台 结果
TestVisualNavigationGutter (-tags "vivahead lithevisual") macOS headless PASS (2.42s, 4 theme/locale variants)
./scripts/desktop/desktop-go.sh test -count=1 ./internal/core ./internal/editorview macOS (Pinned Core 1310ee36) PASS
./scripts/desktop/desktop-go.sh test -count=1 -run '^(TestEditor|TestFileURILocalPath|TestImplementation|TestPluginToolWindowUsesPackageIconAcrossThemes)' ./internal/workbench macOS (Pinned Core 1310ee36) PASS (4.120s)
verify-app-language-localization.mjs & generate-i18n.mjs --check Shared PASS (12651/12651)
verify-platform-feature-matrix.sh & verify-runtime-bundle-immutability.sh Shared PASS

未能执行的检查和原因:

  • Windows 真机交互与真实桌面端窗口人工点击测试未在本次无头验证中执行(按用户指示跳过 CI 并先在无头模式验证)。

提交前确认 / Final checks

  • 分支已基于最新 origin/main 变基,无临时产物提交

@1lck
1lck merged commit 9f98af0 into main Nov 24, 2026
0 of 7 checks passed
@1lck
1lck deleted the feat/implementation-navigation-and-gutter-icons branch November 24, 2026 13:02
@1lck 1lck mentioned this pull request Nov 24, 2026
8 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant