Repository navigation
feat(run-config): 运行配置文件夹、列表排序与复制任意配置 - #91
Merged
Merged
Conversation
…opyConfiguration) - 配置新增 folder 字段(对应 IDEA 的 folderName),保存在配置本身,项目层配置的文件夹随项目共享。 - 本机的列表顺序和是否按名称排序保存在 local.yaml 的 arrangement 下;resolve 按显示顺序返回配置并带 sortAlphabetically,格式错误时报 invalidArrangement 诊断并忽略。 - runConfig.arrange 移动配置到文件夹(写到定义它的层,生成配置写稀疏覆盖)、保存手动顺序和排序开关。 - runConfig.copyConfiguration 复制任意配置;复制生成的构建提供者运行时同时把原配置完整保存到本地层,避免副本顶替原配置。
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:运行配置可以放进文件夹、按名称排序或手动排序,任何配置都能复制
改动
IDEA 的“运行/调试配置”窗口工具栏有 + − 复制、新建文件夹和按字母排序。#2129 只做了 + − 和复制内置运行;这次把通用逻辑放进 Core,桌面端只负责界面。
folder字段folderName),1–256 字节,首尾不能是空白,不能含控制字符。保存在配置本身,项目层配置的文件夹随项目共享;本地层的{id, folder}能覆盖它。启动时忽略。不合法时配置标为invalidConfigurationarrangement{sortAlphabetically?, order?},只存本机。默认按名称(忽略大小写)排序runConfig.resolvesortAlphabetically:排序时按名称;不排序时按保存的order,没列到的配置按名称排在后面,已不存在的 ID 跳过。arrangement格式错误时忽略,并报invalidArrangement诊断runConfig.arrange(新){root, folders?, order?, sortAlphabetically?, plugins?}→{changes}。folders把配置移进文件夹(null移出),写到定义该配置的层:项目层定义的写项目层,否则写本地层(生成的配置写稀疏{id, folder}),同时删掉另一层对它的 folder。order整体替换手动顺序(最多 4096 个,去重),sortAlphabetically替换排序开关;省略的字段保持不变,存回默认值时删掉arrangementrunConfig.copyConfiguration(新){root, configurationId, name, plugins?}→{id, changes}。副本带上原配置所有已保存的选择(包括文件夹),换新的user:ID 和名字。原配置是项目层定义、且没有本地覆盖的用户配置时,副本存项目层,否则存本地层,所以本地的选择不会被带进项目build.provider条目会顶替同一目标的生成条目,副本单独存在就会把原配置挤掉。所以复制时同时把原配置按原 ID 完整存进本地层,两者都留在列表里;代价是原配置不再跟随构建模型以后的改名。configuration/arrangement.rs、configuration/copying.rs;document.rs加folder,validation.rs校验文件夹名,resolve.rs读arrangement并排序。rust/contracts/run-configuration-v2.schema.json加folder和顶层arrangement;rust/contracts/rust-core-api.md更新命令表、resolve 的顺序和新命令的说明。测试
新增
crates/core/src/tests/run_configuration_arrangement.rs:folders_are_saved_in_the_defining_layer_and_the_order_only_locally:默认按名称(忽略大小写)排序;项目层配置的文件夹写进项目层,本地配置的写本地层;手动顺序只写 local.yaml,关掉排序后生效,没列到的按名称排在后面;重新开启排序时保留已存的顺序;null移出文件夹;没有变化时不写文件。a_local_folder_override_wins_and_a_bad_request_changes_nothing:本地覆盖的文件夹优先;移动时写项目层并删掉本地覆盖;不存在的 ID、首尾空白或换行的文件夹名、空 ID 的顺序都被拒绝;手改坏的arrangement报invalidArrangement并按默认排序;空文件夹名让配置变成invalidConfiguration。copies_keep_every_choice_and_never_hide_the_original:复制项目层的内置运行时,副本带文件夹和参数,存项目层;复制生成的构建提供者运行时,副本和原配置都在列表里,原配置存进插件的本地 TOML;名字为空、ID 不存在时拒绝。本机 macOS 上
cargo fmt --check、cargo clippy -p lithe-core -p lithe-execution --all-targets -- -D warnings、cargo test -p lithe-core -p lithe-execution(lithe-core 826 个全部通过)、cargo test --workspace --no-run、scripts/rust-core/verify-rust-core-comments.sh execution core、node scripts/rust-core/verify-platform-tests.mjs全部通过。