Repository navigation
feat(run-config): 插件声明运行配置类型(runConfigurationTypes 0),所有运行配置加“允许多个实例” - #94
Merged
Merged
Conversation
- 构建系统新增 runConfigurationTypes:类型 id、名称、说明、execution、arguments 模板和最多 16 个字段
(text、choice、checkbox、file、directory、arguments),字段可带默认值、必填、占位符、显示条件和自己的参数
- 新模板变量 ${field:<id>};每个字段恰好引用一次;${userArguments} 恰好出现一次时编辑器显示程序参数
- 保存的配置类型 build.run-type,extensions.build 记 {pluginID, buildSystemID, type, values},
仍存 .lithe/run/plugin/<插件 ID>.toml
- 新命令 build.runConfigurationPlan 把保存的配置展开成 argv 计划
- runConfig.configurationTypes / editorForm / saveConfiguration 新增 runTypePlugins(清单和语言文件),
语言文件新增 runConfigurationTypes 词条
- 所有运行配置的通用开关 allowMultipleInstances,只在开启时保存
- 新增 fixture run-configuration-types/,更新契约 README、schema、Core API 文档、更新记录和能力对照
xiaoyumuxi
marked this pull request as ready for review
November 18, 2026 07:25
This was referenced Nov 18, 2026
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:新能力
runConfigurationTypes0——构建插件声明自己的运行配置类型,宿主按声明画编辑器,Core 校验并展开命令行;所有运行配置(含 Core 自带的 Shell / PowerShell / 批处理 / 程序)加通用开关allowMultipleInstances。Remote 类配置这次不做。改动
插件契约(
shared/plugins/contract/v1/)buildSystems[].runConfigurationTypes(1–16 个),需要requires.runConfigurationTypes: 0:id、displayName、description?[A-Za-z0-9._-],≤64)、名称(≤120 字节)、说明(≤512)executionapplication或task;不能是servicearguments${root}、${userArguments}、${option:*}、${field:<id>},不能带条件fields[](≤16)text、choice(options+ 可选optionLabels,≤64 项)、checkbox、file、directory、arguments;可带default、required、placeholder、description、visibleWhen,以及字段自己的arguments(≤8,值用${value})${userArguments}恰好出现一次时编辑器才显示“程序参数”。runConfigurationTypes.<构建系统 ID>.<类型 ID>:displayName、description、fields.<id>.{title, description, placeholder, options};不合法时是plugin.build.invalidLocalization。fixtures/run-configuration-types/(清单 +l10n/zh-Hans.json)。Core
lithe-build:manifest/run_types.rs校验声明,run_types.rs校验字段值并展开 argv;template.rs加${field:<id>}。lithe-execution:新配置类型build.run-type,extensions.build={pluginID, buildSystemID, type, values},仍存.lithe/run/plugin/<插件 ID>.toml/.local.toml;declared.rs按声明生成编辑表单(字段 ID 为field:<id>,visibleWhen同样带前缀),表单带runType。allowMultipleInstances(每个编辑器都有,含 Core 自带运行),只在开启时保存。关:再次启动先停掉正在运行的进程;开:宿主在旁边再起一个,每个进程有自己的控制台。run-configuration-v2.schema.json:加allowMultipleInstances、build.run-type分支(extensions.build必填,execution只能application/task,不带 command、toolchains、debug、members)。lithe-plugin-model:能力RUN_CONFIGURATION_TYPES=&[0];语言文件解析新增runConfigurationTypes。宿主调用 Core 的命令(不是插件宿主方法)
build.runConfigurationPlan(Core 命令,新)build.run-type配置展开成任务计划,带回runType;工作目录落在多个实例里时取最深的那个runConfig.configurationTypes/runConfig.editorForm/runConfig.saveConfiguration:新请求字段runTypePluginslocalizations报告没有新增或修改
lithe/host/*宿主方法和通知,所以 API 总表的宿主方法表和更新记录的“宿主方法(按 API 编号)”索引不加行。文档
rust/contracts/rust-core-api.md:命令表加build.runConfigurationPlan,运行配置部分加 “Plugin-declared types” 小节、runTypePlugins、allowMultipleInstances和字段属性label、description、placeholder、optionLabels。reference/protocol-changelog.md:能力表加runConfigurationTypes0,2026-11-18 时间线加一行。reference/capabilities-and-versions.md、reference/api-catalog.md(API-29 中英两行)、reference/domains/build-systems.md:加runConfigurationTypes,桌面端标“未声明”(宿主 PR 接入后再改)。错误码
plugin.build.invalidRunConfiguration(新)values.<id>plugin.build.invalidLocalization(新)runConfigurationTypes不合法plugin.manifest.invalid/plugin.template.invalidplugin.build.invalidSelection/plugin.build.unavailable测试
crates/core/src/tests/plugin_run_types.rs(6 个):declared_types_follow_the_built_in_kinds_with_translated_text:插件类型排在内置类型后面,名称和说明用语言文件翻译a_translation_that_does_not_fit_the_declarations_is_rejected_whole:语言文件对不上声明时整份拒绝,报plugin.build.invalidLocalizationthe_editor_draws_declared_fields_and_shows_program_arguments_only_when_taken:表单字段、标签、占位符、可选项、显示条件,allowMultipleInstances是复选框,没装插件时打不开编辑器saved_declared_runs_expand_into_the_types_command_line:保存时按字段报错(notFound、required),隐藏字段不检查也不保存;保存后读回;build.runConfigurationPlan展开 argv、选最深的实例;别的插件、找不到实例、未知配置、缺workspaceRoot时拒绝;手改保存文件里的值后规划,报plugin.build.invalidRunConfiguration(字段values.runKind);文件运行传绝对路径a_type_without_program_arguments_stores_none:不带${userArguments}的类型不存程序参数,关掉多实例时不写allowMultipleInstancesrun_configuration_type_declarations_are_validated:声明的各种错误(字段没被恰好引用一次、模板变量不允许、超限等)各自的错误码和字段run_configuration.rs:内置程序编辑器的字段列表加allowMultipleInstances。lithe-build;fixture 用jsonschema对清单和语言文件 schema 校验通过。本机 macOS 上全部通过:
cargo fmt --all -- --checkcargo clippy -p lithe-build -p lithe-execution -p lithe-core -p lithe-plugin-model -p lithe-plugin-manifest --all-targets -- -D warnings(本机和--target x86_64-pc-windows-msvc)cargo test(lithe-core 832 个)scripts/rust-core/verify-rust-core-comments.sh、node scripts/logging/generate-log-events.mjs --check、node scripts/rust-core/verify-platform-tests.mjs、node --test scripts/rust-core/*.test.mjsnode shared/plugins/scripts/verify-docs.mjs、node --test shared/plugins/scripts/*.test.mjs插件后端协议(
plugin-rpc、litheBuild)没有改动,没跑sdk-e2e.mjs。