Repository navigation
fix(lsp): 保留 Hover Markdown 与代码块语言 - #197
Merged
Merged
Conversation
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
语言服务器以裸
MarkedString返回 Hover 时,Core 把 Markdown 标成纯文本,弹窗直接显示代码围栏;返回{language, value}时又丢掉语言,无法按声明语言着色。改动 / Changes
MarkedString按 LSP 规范标为 Markdown。{language, value}转为保留语言标识的 Markdown 代码块;围栏长于内容里的最长连续反引号,避免代码块提前结束。MarkupContent继续遵循plaintext/markdown,数组保持原有条目顺序,空结果保持为空。rust/contracts/rust-core-api.md,明确 Hover 格式、高亮选择与 fixture。不在本 PR 范围内 / Out of scope
宿主呈现回归已在 1lck/Lithe-IDEA#2390 合入;1lck/Lithe-IDEA#2391 已将宿主固定 Core 修订升级到包含本修复的
1310ee36。应用 Issue #2373 当前已关闭。类型专属:fix
复现与根因
textDocument/hover返回裸 Markdown 字符串或{language, value}。修复前前者得到isMarkdown: false,后者只剩正文;预期保留 Markdown 及代码语言。git log -S定位原行为在拆分提交7ae0c16(refactor(core): 拆出领域、LSP 和插件 crate,lithe-core 只留分发器与 FFI #28)已存在。检查项
client_hover_contents_match_fixture报告bare-marked-string、language-marked-string、language-marked-string-with-backticks、marked-string-array四项不符;恢复修复后通过。范围检查 / Scope checks
lsp-completion-hover,两端原生验证保持 pending。lsp-client;宿主仅呈现归一化结果。验证 / Verification
cargo test --manifest-path rust/Cargo.toml -p lithe-lsp-clientcargo fmt --manifest-path rust/Cargo.toml --all -- --checklsp-clientnode scripts/rust-core/verify-platform-tests.mjs未能执行的检查和原因: 本地仅验证变更模块,workspace 全量测试与跨平台 clippy 交 CI;真实服务器和 macOS/Windows 原生工作流未验收。旧共享契约验证脚本已移除,不能记为通过。
提交前确认 / Final checks