Repository navigation
feat(run-config): 解释器字段标出 shell 家族(shellFamily),宿主可列出已安装的同类 shell - #92
Merged
Merged
Conversation
脚本类运行配置(shell、PowerShell、批处理)的 interpreter 字段带上 shellFamily:posix、powershell 或 cmd。宿主按这个值筛选自己找到的已安装 shell,作为解释器的可选项,和“自动”、自定义路径并列;保存的值仍是程序名 或路径。程序类配置没有解释器,也就没有这个属性。
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:编辑表单的解释器字段标出它接受哪类 shell(
shellFamily),宿主可以在“自动”和自定义路径之外列出已安装的同类 shell改动
用户希望“解释器路径”像工具链设置那样选择:自动(显示实际生效的程序)、终端已检测到的 shell、自定义路径。哪种运行用哪类 shell 是 Core 的知识,所以由 Core 在表单字段上标出;查找本机安装了哪些 shell、怎么分类,仍是桌面端平台层的事(终端的新建菜单已经在做)。
shellFamily(新,可选)kind: executable的字段上,表示这个程序应是哪类 shell:posix(Shell 脚本)、powershell(PowerShell 脚本)、cmd(批处理)。宿主可以在“自动”和自定义路径之外列出已安装的同类 shell;字段的值仍是命令名或路径,保存、校验、启动都不变。二进制程序(Executable)的program字段没有这个属性configuration/process.rs:Kind::shell_family()给出每种内置运行的 shell 家族。configuration/form.rs:解释器字段加上shellFamily;新的字段构造方法shell_family,值为None时不写。rust/contracts/rust-core-api.md:字段列表加shellFamily?,字段属性表加一行说明。测试
crates/core/src/tests/run_configuration.rs的built_in_process_runs_are_created_edited_moved_and_deleted_through_the_editor_form加断言:Shell、PowerShell、批处理表单的解释器字段分别是posix、powershell、cmd;二进制程序没有解释器字段,program字段没有shellFamily。本机 macOS 上
cargo fmt --all -- --check、cargo clippy -p lithe-execution -p lithe-core --all-targets -- -D warnings、cargo test -p lithe-execution(30 个)、cargo test -p lithe-core run_config(35 个)全部通过。