feat: 右键在资源管理器中打开/显示 + 使用默认应用打开;文件查看页 ⋯ 菜单 - #40
Open
ma15803216102 wants to merge 2 commits into
Open
Conversation
- 新增 host 路由 fs.open-in-explorer(目录就地打开、文件在所在文件夹中选中显示)与 fs.open-default(系统默认应用打开),路径经 resolveGitPath 解析(git 面板相对路径可用) - 新增 src/open-external.ts 跨平台实现: * Windows: cmd /c explorer /select,path(显示)/ explorer dir;start "" path(默认应用) * macOS: open -R path(Finder 显示)/ open path * Linux: xdg-open 打开所在目录(无便携选中动词)或目录本身 - Explorer 右键:目录 → 在资源管理器中打开;文件 → 在资源管理器中显示 + 使用默认应用打开 - Git 面板文件右键:同样新增 在资源管理器中显示 + 使用默认应用打开 - wire.ts 新增 open-error 错误码;zh/en 文案与 README 同步
- EditorHost 头部(所有文件类型查看页共享的操作面板)右侧新增三个点按钮, 弹出菜单:复制相对路径、复制绝对路径、在文件管理器中显示、使用默认应用打开 - 复用现有 fsOpenInExplorer / fsOpenDefault 路由与 writeClipboard;打开失败在 头部下方内联显示错误 - 新增 moreActions 文案(zh/en),README 快捷键表补充文件页更多操作一行
Contributor
Author
|
请求审阅 🙏:本 PR 为侧边栏新增「在资源管理器中打开/显示」与「使用默认应用打开」(Explorer/Git 右键 + 文件查看页 @EvanLuo42 @morlay 有空的话请帮忙 review 一下,谢谢! 说明:
|
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.
变更内容
为侧边栏补齐"在系统文件管理器打开 / 默认应用打开"能力,三平台(Windows / macOS / Linux)适配:
1. Explorer 资源管理器右键
2. Git 面板文件行右键
resolveGitPath解析,repo-root 相对路径可用)3. 文件查看页操作面板
⋯菜单:复制相对路径、复制绝对路径、在文件管理器中显示、使用默认应用打开(所有文件类型查看页共享)实现
fs.open-in-explorer/fs.open-default(src/index.ts)src/open-external.ts跨平台实现:cmd /c explorer /select,"path"(显示)/explorer "dir";start "" "path"(默认应用)open -R path(Finder 显示)/open pathxdg-open(打开所在目录,无便携"选中"动词)或目录本身src/wire.ts新增open-error错误码;zh/en 文案(moreActions等)与 README 同步验证
tsc+tsdown构建通过vitest409 通过;13 个失败均为 Windows 环境既有问题(node-pty 启动 / git\r\n行尾 / POSIX 路径断言 / 设置页渲染计数,基线同样失败,本 PR 无新增失败)explorer /select,与start ""拉起成功