Repository navigation
feat(lsp): 支持代码操作、签名帮助和内联提示 - #101
Merged
Merged
Conversation
19 of 21 tasks
Mucheen
marked this pull request as ready for review
November 18, 2026 15:27
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
桌面编辑器需要能显示语言服务器的代码操作、函数签名和内联提示。Rust Core 复用已有的 LSP 会话、能力协商、文档同步和请求期限,为 Viva 提供可直接呈现的结果。
改动 / Changes
only和triggerKind,过滤禁用或无法完整应用的操作,并稳定地将优先项和各组动作排序。编辑结果保留目标文档版本。.err().expect(...)断言替换为等价的.expect_err(...)。LSP 的共享契约改动让仓库门禁检查整个 workspace,这一修正用于恢复已启用的严格 Clippy 门禁。断言和产品行为保持原有语义。不在本 PR 范围内 / Out of scope
Viva 的交互、功能矩阵、双语词条、截图与编辑器性能对比由桌面端的配套 PR 提供。该 PR 负责本机 C ABI 的 LSP 会话契约。插件清单能力版本、SDK 和插件后端宿主服务维持原有契约。
类型专属 / feat
多平台对齐
范围检查 / Scope checks
功能矩阵 / Feature matrix
N/A。该仓库提供共享 Core。用户可见的能力矩阵随 Viva 消费端更新。
插件归属 / Plugin ownership
rust/crates/core/src/tests/published_build_plugins.rs和其已有 Maven、Gradle 测试数据存在具体插件依赖,已由 #2174 单独跟踪。UI 验证 / UI evidence
N/A。该仓库负责共享请求和数据,截图与双平台交互由配套桌面 PR 验收。
统一日志系统 / Structured logging
界面文案 / i18n
N/A。界面标签、提示与设置词条归配套 Viva PR。LSP 上游内容按契约传给消费方呈现。
逻辑归属 / Logic placement
lsp-client和lsp-engine提供。C ABI 负责协议分发。rust/contracts/和rust/fixtures/lsp/editor-actions-hints-v1.json。工具专属语义仍由实际语言服务器持有。性能与内存 / Performance and memory
设置 / Settings
editor.preferences.resolve负责解析内联提示偏好的默认值。设置界面及 ⓘ 由 Viva PR 验收。插件契约 / Plugin contract
N/A。此表记录 API-25 在桌面与 Core 之间的 JSON C ABI 调用和事件。插件后端没有新增可调用的宿主方法或通知,因此没有插件 API 索引、协议更新记录或 SDK 变更。
lsp.request·codeActionslsp.request·resolveCodeActionlsp.request·signatureHelplsp.request·inlayHintslsp.request·resolveInlayHintfeaturesChanged·signatureHelpOptionsinlayHintsRefreshworkspaceApplyEditworkspaceApplyEditCancelledlsp.applyEditResponseapplyEditId的应用结果editor.preferences.resolve·inlayHints发行包与资源 / Bundle and resources
N/A。未增加安装资源、下载步骤或运行时写入位置。工作区编辑仍走现有的宿主工作区写入限制。
无用代码与重构 / Dead code and refactoring
验证 / Verification
cargo test --manifest-path rust/Cargo.toml -p lithe-lsp-client -p lithe-lsp-engine --libcargo fmt --manifest-path rust/Cargo.toml --all -- --check、git diff --check origin/main..HEADnode scripts/rust-core/affected-crates.mjsnode scripts/rust-core/verify-platform-tests.mjsnode --test scripts/rust-core/*.test.mjsnode scripts/logging/generate-log-events.mjs --checknode shared/plugins/scripts/verify-docs.mjsscripts/rust-core/verify-rust-core-comments.shrun-rust-tests-with-timing.mjs定向 Core 回归cargo test --locked --manifest-path rust/Cargo.toml --workspace --features lithe-remote/servercargo clippy --manifest-path rust/Cargo.toml -p lithe-lsp-client -p lithe-lsp-engine --all-targets --all-features -- -D warnings--locked --all-targets --all-features -- -D warnings;Windows 交叉 lint,--locked --all-targets --target x86_64-pc-windows-msvc -- -D warnings复现验证覆盖继承提交上的三处失败。Core 旧逻辑会转发过期编辑、遗漏宿主撤销事件,并把内联提示原始标签数组转成显示字符串后重新发送。三个回归在本分支通过。
Windows 原生桌面交互与安装未在本工作树运行。Viva 验收由配套桌面 PR 跟踪。
在前置测试修正之前,两条全仓 lint 均触发 Lithe-core-rust#99 引入的
clippy::err_expect。在dfa44f4改用等价断言后,两条 lint 已原样复跑通过。提交前确认 / Final checks
origin/main的fa33446更新分支,目标为main。