Repository navigation
feat(run): 运行配置的启动前步骤 - #2121
Merged
Merged
Conversation
运行配置可以列出启动前步骤:按顺序运行内置进程运行,全部以 0 退出后才启动配置。 项目文件列出的步骤第一次运行前确认,确认按指纹记在应用存储里; 内置运行编辑器和构建提供者运行编辑器都可以编辑步骤列表。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1lck
marked this pull request as ready for review
November 18, 2026 02:38
26 of 29 tasks
15 of 18 tasks
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
启动服务前常常要先生成代码、编译前端或拉起依赖。原来只能手动先运行一个配置、等它结束再运行另一个,配置里也没有地方写“启动前先运行这几个命令”。IntelliJ IDEA 用户习惯用运行配置的 “Before launch: Run Another Configuration”。本 PR 实现它:运行配置可以列出启动前步骤,按顺序运行,全部成功后才启动配置。
项目文件是仓库内容,打开别人的仓库后点运行就执行仓库指定的命令,等于让仓库不经确认在本机执行代码,所以项目文件列出的步骤第一次运行前要确认。
改动 / Changes
Core(Lithe-IDEA/Lithe-core-rust#88)
beforeLaunch: [{configuration: <id>}]。每一步只能引用内置进程运行(Shell、PowerShell、批处理、可执行程序),最多 16 项;一层写了列表就整体替换下层的列表,local.yaml写空列表可以关掉项目文件里的步骤。runConfig.beforeLaunch:展开嵌套步骤(展开后最多 32 步),引用不存在、不能作为步骤、在本机不可用、成环、过长时拒绝并给出原因码;用到项目文件的列表时给出确认指纹(列表和步骤命令定义的 sha256)。beforeLaunch字段和候选列表,runConfig.updateOptions可以修改步骤列表。宿主
scripts/desktop/build-desktop-core.sh:PINNED_CORE_REVISION升到bb4832e(包含 Core 合入的本功能)。core/run_before_launch.go(新增)、core/run_config.go、core/run_process.go:RunBeforeLaunch调用和类型,RunConfiguration.BeforeLaunch,RunOptionsEdit.BeforeLaunch,编辑器字段的Candidates。workbench/runconfig_before_launch.go(新增):run-before-launch-approvals.json(按项目根目录,每个项目最多 64 个);取消或关闭则不启动配置。workbench/runconfig_process.go:进程启动的公共部分抽成startConfiguredProcess,内置运行和步骤共用;内置运行启动前先跑步骤。workbench/runconfig.go:构建提供者运行(含 Debug)在prepareConfiguredRun之前先跑步骤。workbench/build.go:新增writeBuildOutputNow,在窗口线程上直接写控制台。失败提示用异步的streamBuildOutput会在操作结束后才到达而被丢弃。runconfig_form.go/runconfig_form_view.go:内置运行编辑器新增字段类型beforeLaunch,显示已选步骤(序号、名称,找不到的配置标红显示 ID),可上移、下移、移除,“添加步骤”菜单列出还没选的候选。runconfig_edit.go/runconfig_view.go:构建提供者运行编辑器也有同样的列表,候选是除自己外可用的内置进程运行;只有列表改动时才发送beforeLaunch,不会把解析后的列表抄进本地层。root.go:挂上确认框。unavailable)。run-before-launch-steps.json、Agent Note2026-11-18-run-configuration-before-launch-steps.md、截图docs/assets/before-launch/。截图(暗色中文 / 亮色英文):
不在本 PR 范围内 / Out of scope
runOptions扩展点补充([Feature] 运行配置支持插件注入的「修改选项」:按组勾选运行选项、显示参数预览(对标 IDEA Modify options) #2100 中尚未实现的部分)。类型专属:feat
多平台对齐
process.batch)范围检查 / Scope checks
功能矩阵 / Feature matrix
shared/platform-feature-matrix/features/run-before-launch-steps.json,两端 implemented,验证状态 pendingverify-platform-feature-matrix.sh和verify-platform-feature-matrix-change.sh origin/main HEAD.artifacts/下生成的矩阵视图插件归属 / Plugin ownership
UI 验证 / UI evidence
LITHE_VISUAL_OUTPUT_DIR=… ./scripts/desktop/desktop-go.sh test -tags 'vivahead lithevisual' ./internal/workbench/ -run TestVisualBeforeLaunchSteps:编辑器、确认框、运行结果三个场景,暗色中文和亮色英文,1200×820统一日志系统 / Structured logging
performed(run.beforeLaunch.allow/cancel、run.configuration.form.beforeLaunch.add)、operationRejected("run_before_launch","refused")、backgroundFailed("run_before_launch_approvals")记录,没有新的日志写法finishBuildError结束运行)界面文案 / i18n
shared/i18n/,已运行生成器并提交生成结果verify-app-language-localization.mjs和generate-i18n.mjs --check逻辑归属 / Logic placement
性能与内存 / Performance and memory
设置 / Settings
插件契约 / Plugin contract
runConfig.beforeLaunch是 Core 给宿主的命令,已写进 Core 的rust-core-api.mdPINNED_CORE_REVISION已升到包含 Core 改动的 commit发行包与资源 / Bundle and resources
a.store,Application Support / 用户数据目录),不写发行目录;已运行verify-runtime-bundle-immutability.sh无用代码与重构 / Dead code and refactoring
startConfiguredProcess,没有留下重复验证 / Verification
./scripts/desktop/desktop-go.sh test ./internal/workbench/ -run 'BeforeLaunch|TestRunConfigFormKeepsTheStepList|TestBuiltInRunIsCreated|TestRunConfigForm|TestRunConfigEditor' -count=3./scripts/desktop/desktop-go.sh test ./internal/workbench/ ./internal/core/ -count=1TestVisualBeforeLaunchSteps(vivahead lithevisual)node scripts/i18n/generate-i18n.mjs --check、verify-app-language-localization.mjsverify-platform-feature-matrix.sh、verify-platform-feature-matrix-change.sh origin/main HEAD./scripts/agent-notes/verify-agent-notes.sh./scripts/desktop/verify/verify-runtime-bundle-immutability.shcargo test --workspace、cargo clippy --workspace --all-targets -- -D warnings、cargo fmt --check新增的自动化测试(真实 Core + 系统 shell/cmd):
TestBeforeLaunchStepsRunInOrderAfterTheProjectListIsAllowed:确认框列出步骤,点“运行步骤”后嵌套步骤先运行、按顺序输出,再启动配置;再次运行不询问;改了步骤命令后重新询问,取消后不启动。TestFailingBeforeLaunchStepStopsTheStart:步骤以 3 退出时控制台写出步骤名和退出码,配置不运行;本地文件的步骤不询问。TestStoppingDuringABeforeLaunchStepEndsIt:步骤运行中停止,步骤结束、配置不运行。TestRunConfigFormKeepsTheStepList:编辑器读写步骤列表、移动顺序、候选只含其他内置进程运行。未能执行的检查和原因: Windows 本机虚拟机验收在本轮所有 PR 合入后统一进行,结果另行报告。
提交前确认 / Final checks
main创建,目标main🤖 Generated with Claude Code