New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use shell.showItemInFolder to show files #1266

Merged
merged 5 commits into from Aug 27, 2018

Conversation

Projects
None yet
3 participants
@50Wliu
Member

50Wliu commented Jul 4, 2018

Requirements

  • Filling out the template is required. Any pull request that does not include enough information to be reviewed in a timely manner may be closed at the maintainers' discretion.
  • All new code requires tests to ensure against regressions

Description of the Change

Electron's shell module has a method shell.showItemInFolder to automatically open files in the OS's file manager. I'm not sure why we decided to go ahead with our implementation instead of using that, but it makes much more sense to delegate to Electron instead of maintaining our own version.

Alternate Designs

None.

Benefits

shell.showItemInFolder will use the default file manager, rather than the one hardcoded by tree-view. For example, on Windows, while the default file manager is commonly explorer.exe, that is not always the case. This change also reduces the amount of code that tree-view needs to maintain.

Possible Drawbacks

I have changed the menu text to always refer to a generic "File Manager", as it is no longer possible to know exactly which file manager will be used.

Applicable Issues

Supersedes and closes #889.
Should fix #685.
Should fix #583.

Needs testing on macOS and Linux.

@50Wliu 50Wliu added the needs-testing label Jul 4, 2018

@Arcanemagus

This comment has been minimized.

Arcanemagus commented Jul 5, 2018

I'm not sure why we decided to go ahead with our implementation instead of using that

It looks like that was added in #47, which was well after the Electron stuff was added in electron/electron@fbad5bc so... 🤷‍♂️.

@jasonrudolph jasonrudolph self-assigned this Aug 27, 2018

@jasonrudolph

This comment has been minimized.

Member

jasonrudolph commented Aug 27, 2018

Needs testing on macOS and Linux.

I ran through the following tests on macOS and Ubuntu:

  • Inside editor, use context menu to show file in OS file manager
  • Inside editor, use command palette to show file in OS file manager
  • Inside tree-view, use context menu to show selected file in OS file manager
  • Inside tree-view, use command palette to show selected file in OS file manager

Everything functioned as expected. 👌

@jasonrudolph jasonrudolph merged commit 93f9364 into master Aug 27, 2018

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@jasonrudolph jasonrudolph deleted the wl-use-system-file-manager branch Aug 27, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment