Repository navigation
feat: Rust 设置页加上插件自己画的预览,新增三个 rust-analyzer 设置(0.1.1) - #1
Merged
Merged
Conversation
- 新设置:展开过程宏、运行构建脚本、高亮文档注释中的代码,对应 rust-analyzer 的 procMacro.enable、cargo.buildScripts.enable、semanticHighlighting.doc.comment.inject.enable。 - 后端实现 settings.view:Rust 语言页列出 cargo、rust-analyzer、rustup 工具行和四张预览卡片; Cargo 构建工具页画出查找 cargo 的顺序和 rustup 的版本选择。草稿先显示并标出未应用的修改, 按视图宽度排版并响应 resize。 - plugin.json 加 settingRegions、requires ui 0、ui.contribute 权限;补中文语言文件。 - 插件 e2e 覆盖层新增 TestRustSupportPluginDrawsItsSettingsRegions。 - README 按 Go 插件补设置预览说明和配图,更新功能矩阵,新增 v0.1.1 发布说明。
xiaoyumuxi
marked this pull request as ready for review
November 22, 2026 13:28
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
resizefix(plugins): 插件画布按真实宽度显示,并在窗口宽度变化后发 resize 1lck/Lithe-IDEA#2191(0.8.10 起)。插件原本就要求桌面端 0.8.12。改动说明 / What changes
给 Rust 的两个设置页加上插件后端自己画的“效果预览”,并新增三个 rust-analyzer 设置。原有设置项的位置和行为不变。
新设置
procMacro(展开过程宏)、buildScripts(运行构建脚本)、docCommentInject(高亮文档注释中的代码),默认都开启。procMacro.enable、cargo.buildScripts.enable、semanticHighlighting.doc.comment.inject.enable。前两项在语言服务器下次启动时生效;docCommentInject和原有的 Check on save、Check command 一样立即生效。l10n/zh-Hans.json补了三个设置的中文名称和说明,以及两个区域的中文搜索关键词。设置预览
backend/src/view/(mod.rs、scene.rs、settings.rs、words.rs、language.rs、resolution.rs),main.rs注册settings.view视图函数。后端只读设置值,不启动 cargo、rustup 或 rust-analyzer,也不写插件目录。language):tool节点列出 cargo、rust-analyzer、rustup,宿主画出版本和路径,点一行跳到「工具链」页。OUT_DIR报错;关闭但过程宏开着时,说明构建脚本仍会运行;cargo):toolDefinitions的cargo一致;width排版,画布声明on: ["resize"]:resize。清单与版本
plugin.json:版本 0.1.1;requires加ui: 0;权限加ui.contribute;新增两个settingRegions(含搜索关键词)。backend/Cargo.toml、Cargo.lock:0.1.1。测试与文档
e2e/host/desktop/internal/workbench/rust_support_plugin_settings_view_e2e_test.go(TestRustSupportPluginDrawsItsSettingsRegions)。它装上真实插件包,经设置窗口自己的设置来源启动后端,用中英文打开两个区域,每次回答都由 Core 校验。检查内容:pan、声明resize;checkCommand: clippy草稿把 cargo check 的说明换成 clippy 的 lint,并标出未应用的修改;resize后按新宽度重画,草稿标记仍在;e2e/host/lithe-host.json:测试名单加入上面的新测试,示例包名改为 0.1.1。宿主固定版本不变(maina6afaaf)。README.md(294 行精简到 233 行):docs/releases;docs/feature-matrix.md:新增rust-settings-previews行和章节,rust-support-plugin的能力里补上三个新设置。docs/releases/v0.1.1.md和docs/assets/settings-previews/的 3 张中文截图。截图 / Screenshots
截图来自插件 e2e 覆盖层里的宿主无头界面(宿主
a6afaaf),工具链行用的是测试数据。README 只放中文截图。语言与框架 → Rust(深色)
未应用的修改(浅色):关掉三个开关、检查命令改成 cargo clippy,还没有应用
构建工具 → Cargo(浅色)
验证 / Verification
backend/的cargo test --locked:62 个通过;cargo fmt --check、cargo clippy --locked --all-targets -- -D warnings通过。node scripts/e2e-host.mjs,宿主a6afaaf,本地 0.1.1 包):7 个全部通过(4 个 projectgen、BuildsAndServesAPackage、DownloadsCodeLLDBAndDebugsAProgram、DrawsItsSettingsRegions)。发布 / Release
PRERELEASE_TAGS仍只有v0.1.0):用到的宿主能力都在桌面端 0.8.12 里,插件本来就要求 0.8.12。