Skip to content

feat(run-config): 批处理运行在非 Windows 平台可新建、编辑,标为不可运行 - #87

Merged
xiaoyumuxi merged 3 commits into
mainfrom
feat/2100-batch-editable-off-windows
Nov 18, 2026
Merged

xiaoyumuxi merged 3 commits into
mainfrom
feat/2100-batch-editable-off-windows

Conversation

@xiaoyumuxi

Copy link
Copy Markdown
Contributor

关联 Issue

类型

feat:在 macOS 和 Linux 上也能新建、编辑批处理(cmd)运行配置,只是标为本机不能运行

改动

#85 合入时,批处理只出现在 Windows 的类型列表里,在其他平台上已保存的批处理配置会被丢掉,只给一条 unsupportedPlatform 诊断。用户希望项目和 Windows 同事共用时,在 Mac 上也能看到并编辑这些配置,只是提醒不能在本机运行、运行按钮置灰。

命令 之前 现在
runConfig.configurationTypes 非 Windows 不列出 process.batch 所有平台都列出四种类型,返回 {types: [{provider, availability?}]};本机不能运行的类型带 availability(unsupportedPlatform)
runConfig.editorForm 非 Windows 上批处理返回 not_supported 所有平台都给出表单,返回值多一个可选的 availability
runConfig.saveConfiguration 非 Windows 上批处理返回 not_supported 照常校验和保存
runConfig.resolve 非 Windows 上丢弃批处理条目,加 unsupportedPlatform 诊断 照常列出,availability 为 {status: "unavailable", code: "unsupportedPlatform"};不再出这条诊断
runConfig.createLaunchPlan 拒绝 不变,仍然拒绝(已有 availability 的配置一律拒绝,launch_plan 里的平台检查也保留)
  • process.rs:supported_on(provider, platform) -> bool 换成 provider_availability / platform_availability,返回 availability,Kind::supported_on 保留。
  • resolve.rs:availability 的先后是插件不可用 → invalidConfiguration → unsupportedPlatform → missingWorkingDirectory,先到先得;默认选中的配置本来就跳过带 availability 的条目。
  • rust/contracts/rust-core-api.md:更新命令表、availability 代码列表、configurationTypes 与 editorForm 的返回值、resolve 一节。
  • 这些是桌面端用的 Core API,不是插件契约,所以不更新插件协议更新记录。

测试

  • built_in_process_runs_are_created_edited_moved_and_deleted_through_the_editor_form 里的类型列表断言:所有平台都期望四种类型;非 Windows 上只有批处理带 unsupportedPlatform。
  • batch_runs_are_editable_but_unavailable_outside_windows(原 batch_runs_are_unavailable_outside_windows,Windows 上跳过):已保存的批处理配置被列出并带 unsupportedPlatform、没有诊断;已有配置和新建配置的表单都正常返回并带 availability;保存成功;createLaunchPlan 拒绝。
  • cargo fmt --check、cargo clippy -p lithe-execution -p lithe-core --all-targets -- -D warnings、cargo test -p lithe-core -p lithe-execution 全部通过(本机 macOS)。

- configurationTypes 在所有平台列出四种内置类型;本机不能运行的类型带 availability(unsupportedPlatform)
- editorForm 在所有平台给出批处理表单,并附 availability;saveConfiguration 照常保存
- resolve 不再丢弃非 Windows 上的批处理配置,改为列出并标 unsupportedPlatform;createLaunchPlan 仍拒绝启动
- 更新 rust-core-api.md 与测试

Refs 1lck/Lithe-IDEA#2100
…ble-off-windows

# Conflicts:
#	rust/crates/execution/src/configuration/form.rs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant