Repository navigation
feat(desktop): 悬浮等待从 500 ms 缩短到 300 ms - #2011
Merged
Merged
Conversation
xiaoyumuxi
marked this pull request as ready for review
November 16, 2026 05:34
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
关联 Issue / Linked issue
PR 类型 / Type
改动说明 / What changes
背景 / Why
在 Go 的编辑器对比(#1997 的脚本)里,Lithe 的悬浮弹窗比 Zed 慢约 180 ms。拆开看,慢的部分全是等待:Lithe 指针停下后固定等 500 ms 才发请求,Zed 和 VS Code 默认等 300 ms。扣除等待之后,Lithe 的开销(约 60 ms)比 Zed(82 ms)和 GoLand(69 ms)都小。语言服务器热起来后几毫秒就能答复,Core 还会保留重复位置的答案(#2006),所以唯一的差距就是这段等待。
改动 / Changes
desktop/internal/workbench/pluginsemantics.go:semanticHoverDelay从500 * time.Millisecond改为300 * time.Millisecond,注释写明这个值与 Zed、VS Code(editor.hover.delay)的默认值一致,以及为什么用户等的时间主要是这段等待。shared/platform-feature-matrix/features/lsp-completion-hover.json:在验证说明最前面加 2026-11-16 的记录,写明新的等待时间和实测结果。实现状态和验证状态不变,Windows 原生窗口验收仍待做。hoverDelay设成-1或time.Hour,不依赖 500 这个值,所以不需要改。不在本 PR 范围内 / Out of scope
HOVER_DELAYS.lithe还写着 500 ms,本 PR 合入后在 Epic(compare): 在 macOS 上对比 Lithe 与 GoLand、VS Code、Zed 的资源占用和 Go 交互延迟(不合入,基准测试集,后续基准测试perf/ide-comparison分支中进行补充) #1997 里改成 300。下文实测表里“扣除等待”一列显示 −140 ms 就是这个原因,按 300 ms 扣除约为 60 ms。类型专属:feat
多平台对齐
platform-specific),理由:范围检查 / Scope checks
功能矩阵 / Feature matrix
shared/platform-feature-matrix/features/lsp-completion-hover.json:验证说明加了 2026-11-16 的记录;两端状态不变,Windows 原生窗口验收仍待做./scripts/platform-feature-matrix/verify-platform-feature-matrix.sh和./scripts/platform-feature-matrix/verify-platform-feature-matrix-change.sh origin/main HEAD.artifacts/下生成的矩阵视图插件归属 / Plugin ownership
develop-lithe第三节“插件归属与宿主零依赖”的自查命令,结果为空shared/i18n/;没有改scripts/resources/、docs/ci-builds.md、Agent Note 或 SkillUI 验证 / UI evidence
统一日志系统 / Structured logging
N/A:没有新增或改动生命周期里程碑、终态、降级或失败路径。
界面文案 / i18n
node scripts/i18n/verify-app-language-localization.mjs和node scripts/i18n/generate-i18n.mjs --check,都通过逻辑归属 / Logic placement
性能与内存 / Performance and memory
方法: 用 #1997 的
scripts/desktop/perf/ide-compare-latency.mjs,同一台空闲机器(Apple M4,macOS 27.3),先后测两个用scripts/desktop/package-desktop.sh --format app --ad-hoc-sign打包的应用,Core 都是 6a14126,只差这一个常量。项目是 Lithe-IDEA adf46f5,打开desktop/internal/workbench/app.go,语言服务器是 gopls v0.23.0,每项操作 5 次。悬浮的时间从指针落到字符上算起,到弹窗画出来为止,包含编辑器自己的等待。跳到定义、查找引用和打字不经过悬浮等待,两次结果的差异是不同轮次之间的波动,不是这次改动带来的。
同一台机器上早先的三方对比(#1997,Lithe 0.7.0,不同轮次)里,悬浮的中位数是 Zed 382 ms、GoLand 569 ms、Lithe 552 ms。改成 300 ms 后,Lithe 的悬浮预计从三者中最慢变成最快;要在同一轮里证实,需要 #1997 重新跑三方对比。
设置 / Settings
N/A:没有新增或修改设置项。
插件契约 / Plugin contract
N/A:没有改插件契约、能力版本、插件函数协议或宿主方法。
发行包与资源 / Bundle and resources
N/A:没有新增或修改运行时资源、缓存、下载物或构建步骤。
无用代码与重构 / Dead code and refactoring
验证 / Verification
./scripts/desktop/desktop-go.sh test ./internal/workbench/ -run 'Hover|Semantic' -count=1scripts/desktop/check.sh./scripts/platform-feature-matrix/verify-platform-feature-matrix.sh./scripts/platform-feature-matrix/verify-platform-feature-matrix-change.sh origin/main HEADnode scripts/i18n/verify-app-language-localization.mjs、node scripts/i18n/generate-i18n.mjs --checkide-compare-latency.mjs各测 5 次未能执行的检查和原因:
editor-bench.sh:没有改desktop/internal/editor/**或desktop/internal/editorview/**,不需要运行。提交前确认 / Final checks
main(0938bedcd)创建,目标分支main.artifacts/等产物,没有凭据、个人路径和未脱敏的日志或截图