Repository navigation
fix(editor): 完整显示补全候选名称和签名 - #2196
Merged
Merged
Conversation
Mucheen
marked this pull request as ready for review
November 19, 2026 08:57
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
补全列表中的长函数签名会挤压名称列。输入
context.WithTimeo时,两个候选可能只显示为With...和WithTi...,签名末尾的参数及返回类型也不可见。改动 / Changes
按实际字体测量可见候选,弹窗宽度在窗口边界内随内容调整。候选行优先给名称留足宽度,空间不足时缩短或收起签名摘要。
选中候选在行内放不下时,列表底部换行展示完整内容。超出详情高度时可滚动。上下键同步更新详情,编辑器保留焦点,回车和 Tab 沿用原有接受路径。
参数提示按自身文档的换行高度和补全弹窗的实际边界选位置。空间不足以同时容纳时优先保留补全。
补齐合成语言服务的绘制、键盘、滚动和弹窗共存回归,补充无头截图场景、功能矩阵和 Agent Note。
评审修复
8a1d04743将弹窗边框计入候选、详情与参数文档的尺寸,签名在行内放不下时可以从详情读到末尾。补全按光标上下的可用空间限制候选行数,参数提示避开补全和输入行。超长详情使用 Viva 虚拟列表,每个文本块按需换行,滚动及编辑器焦点行为有合成回归覆盖。
Linux 的 LSP 无头检查纳入补全回归和截图。功能矩阵和 Agent Note 记录了新场景。
以独立提交
bdba52125修复主线 feat(toolchains): surface managed plugin runtimes and prepare on demand #2195 带入的toolchains_state.go字段对齐。Go 1.27.3 格式门禁复现后通过,忽略空白比较为空。不在本 PR 范围内 / Out of scope
语言服务器回应、补全排序、插件契约,以及 #2128 中的代码操作与内联提示。
类型专属:fix
复现与根因
检查项
desktop/internal/workbench/pluginsemantics_test.go中的TestCompletionPopupKeepsFunctionNamesAndShowsSelectedSignature在修复前报两条candidate row did not paint the full name并且两个完整签名断言失败,修复后通过。semanticPopups、semanticRow、补全键盘与接受路径,以及参数提示的唯一呈现调用方。Core 和 SDK 契约不涉及本次变更。.agents/notes/implemented/bug-fix/2026-11-19-viva-completion-signature-visibility.md。范围检查 / Scope checks
功能矩阵 / Feature matrix
lsp-completion-hover.json与lsp-signature-help.json的验证场景,两端原生验证仍为pending。main的实际提交差异门禁通过。.artifacts/。插件归属 / Plugin ownership
UI 验证 / UI evidence
76f8a663f加同一测试夹具,修复提交为425c4dbd5。命令为LITHE_VISUAL_OUTPUT_DIR=<dir> ./scripts/desktop/desktop-go.sh test -tags 'vivahead lithevisual' ./internal/workbench -run '^TestVisualCompletionPopup$' -count=1 -timeout=120s。评审复验使用同一个
TestVisualCompletionPopup场景,比较bdba52125和8a1d04743。六组 macOS 无头前后截图保存在同一目录,新增 900×600 的窗口中部及近底部场景,后者同时显示补全、输入行和参数提示。 前后截图统一日志系统 / Structured logging
N/A:本次处理弹窗尺寸、定位及可见范围。请求、错误和终态沿用现有路径。
界面文案 / i18n
逻辑归属 / Logic placement
N/A:改动只涉及 Viva
gfx.Canvas测量、ui.Scroll详情和gfx.Rect定位,补全选择、编辑和协议仍走现有路径。性能与内存 / Performance and memory
bdba52125的 153.686 ms 降至8a1d04743的 0.328 ms。该数据来自无头测试。设置 / Settings
N/A:没有设置项。
插件契约 / Plugin contract
N/A:没有协议或宿主 API 改动。
发行包与资源 / Bundle and resources
N/A:没有运行时资源或打包变更。已复核安装包只读静态检查。
无用代码与重构 / Dead code and refactoring
验证 / Verification
./scripts/desktop/desktop-go.sh test -p=2 ./... -timeout=12m -json./scripts/desktop/desktop-go.sh test -race -p=2 ./internal/workbench -run '^(Test.*Completion|TestLSPSignatureHelp)' -count=1 -timeout=2m./scripts/desktop/desktop-go.sh vet ./internal/workbenchGitHub CI
Linux 的 LSP 无头测试通过,包含
TestLSPSignatureHelpKeepsCompletionPreviewVisible。整仓格式检查在desktop/internal/settingswindow/toolchains_state.go失败。该文件在此 PR 的提交中与上游main完全相同,且上游基线的两个 Linux 作业也在同一文件报错。PR 草稿 CI · 上游基线 CI转为 Ready for review 后,Linux 的 LSP 无头用例再次通过。完整 Desktop CI 的 Linux、macOS、Windows 作业仍在同一个主线文件的格式检查处失败,macOS 和 Windows 的设置截图步骤随后找不到产物。功能矩阵、Agent Note 和依赖 pin 检查通过。转正后的完整 CI
提交
bdba52125修复该格式问题后,当时的 GitHub 8 项检查全部通过,涵盖 Linux、macOS、Windows 和 Desktop CI gate。Windows 初次运行在既有跨文件重命名回归中等待编辑结果超时,复跑同一提交的 Windows 作业通过。本机以GOFLAGS=-p=1运行./scripts/desktop/check.sh通过。最终 CI评审补测的五项断言均在
bdba52125上复现,修复后定向无头通过。i18n 62 项、矩阵及其实际提交差异、Agent Note、安装包只读、测试稳定性静态门禁和 actionlint 通过。新提交的 Desktop CI本机 macOS ARM64 的 14 项补全与参数提示专项、专项竞态和
GOFLAGS=-p=1 ./scripts/desktop/check.sh通过。五个新增用例逐项计时为 0.08–0.35 秒。Linux 的新回归及六张截图通过。Linux 整仓首次运行复现终端关闭后后台任务未退出的已知问题 #2054。 Linux 日志 · Linux 截图8a1d04743的 Windows 首轮在TestEditorEssentialsClosingProjectDropsDialogsAndStartsNewEditVisit等待项目关闭超时,同一用例在本机 macOS 单独连跑 5 次通过。原 PR 随后合入main,当前头f5ff7d59d包含本轮修复。最新提交的重新运行已提交给 GitHub。 Windows 首轮日志 · 当前 CI未能执行的检查和原因
本机无 Parallels Windows 来宾,Windows 原生验收未运行。macOS 视觉证据来自无头驱动。
提交前确认 / Final checks
main为基线,目标为main。