Repository navigation
feat(run-config): 运行配置的启动前步骤 - #88
Merged
Merged
Conversation
运行配置新增 beforeLaunch,引用内置进程运行,按顺序在配置启动前运行。 Core 展开嵌套步骤、校验引用并对项目文件列出的步骤给出确认指纹; 编辑器表单新增 beforeLaunch 字段,updateOptions 可修改步骤列表。 Refs 1lck/Lithe-IDEA#1616 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1lck
marked this pull request as ready for review
November 18, 2026 02:36
29 of 32 tasks
1 task done
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
类型
feat:运行配置新增
beforeLaunch,新增宿主命令runConfig.beforeLaunch改动
对应 IntelliJ IDEA 的 “Before launch: Run Another Configuration”。展开、校验和确认指纹都放在 Core,各宿主行为一致,宿主只按顺序启动进程。
rust/crates/execution/src/configuration/before_launch.rs(新增)RunConfiguration.beforeLaunch: [{configuration: <id>}]:最多 16 项,非空、≤256 字节、不能引用自己(validate_shape,由validate_configuration调用)。beforeLaunch就整体替换下层的列表;local.yaml写空列表可以隐藏项目文件里的步骤。runConfig.beforeLaunch {root, configurationId, localDocument?}:展开嵌套步骤(被引用配置自己的步骤先运行),展开后最多 32 步;返回{status:"ok", steps:[{configurationId,name,summary}], confirmation}或{status:"rejected", refusal:{code, configurationId}},原因码notFound/notAllowed(不是内置进程运行)/unavailable/cycle/tooLong。confirmation就给出fingerprint:对用到的列表和这些步骤启动的命令定义求 sha256。宿主按指纹记住用户的确认,列表或命令一改就重新询问;只用到local.yaml的列表时为null。check_edit:保存时用同一套规则检查,成环报conflict。form.rs:editorForm在最后加字段beforeLaunch(类型beforeLaunch,candidates:[{id,name}]是除自己以外可用的内置进程运行);saveConfiguration读写values.beforeLaunch,错误码notFound/notAllowed/unavailable/conflict/tooLong。editing.rs/requests.rs:runConfig.updateOptions接受可选的beforeLaunch: [ids];本地层写空列表时,若项目层有步骤就写beforeLaunch: []覆盖,否则删除该键。document.rs:RunConfiguration.before_launch(为空时不序列化),provider_runs.rs跟进。command.rs解析runConfig.beforeLaunch,dispatcher/run_config.rs分发。run-configuration-v2.schema.json增加beforeLaunch;rust-core-api.md命令表加一行,并新增 “Steps before launch” 一节。没有改插件契约、能力版本或插件函数协议,插件无需改动。旧宿主不调用
runConfig.beforeLaunch,会忽略配置里的beforeLaunch。验证
cargo test -p lithe-core before_launch(core/src/tests/before_launch_steps.rs3 个测试:嵌套展开与确认指纹、拒绝原因、编辑校验与本地层清空)cargo test -p lithe-core run_configuration(编辑器字段列表加beforeLaunch)cargo test --workspacecargo clippy --workspace --all-targets -- -D warningscargo fmt --checkrunconfig_before_launch_test.go(真实 Core + 系统 shell)。🤖 Generated with Claude Code