Add "Reveal in File Explorer" context menu option for local PR files
PR file context menus only showed "Open File on GitHub", which isn't useful for locally available files. Users needed a way to reveal PR files in their OS file explorer, similar to SCM context menu functionality.
Changes
Command registration (src/commands.ts)
- Added
pr.revealFileInOScommand that delegates to VS Code's built-inrevealFileInOS - Constructs file path via
vscode.Uri.joinPath(repository.rootUri, fileName)
Context value differentiation (src/view/treeNodes/fileChangeNode.ts)
-
GitFileChangeNodenow appends:localsuffix to distinguish fromRemoteFileChangeNode - Suffix preserved across
updateViewed()calls via_appendLocalSuffix()helper - Prevents duplicate suffixes with
endsWith(':local')check
Menu configuration (package.json)
- Added menu item at
view/item/contextgroup0_open@1 - Visibility:
view =~ /(pr|prStatus):github/ && viewItem =~ /filechange.*:local/ && viewItem !~ /filechange:DELETE/ - Hidden from command palette (context menu only)
Behavior
- Appears for locally checked out PR files (modified/added)
- Hidden for remote files (PR not checked out) and deleted files
- Platform-aware: "Reveal in Finder" on macOS, "Reveal in File Explorer" elsewhere
Original prompt
This section details on the original issue you should resolve
<issue_title>Add "Reveal in Finder/Explorer" option on PR files</issue_title> <issue_description>It would be great to get additional actions for PR files like Reveal in Finder/Explorer like in the SCM context menu. Right now the only option is "Open in GitHub" which isn't really useful.
</issue_description>
Comments on the Issue (you are @copilot in this section)
@alexr00 Hey @miguelsolorio! For modified files, we could do that. For added files when you don't have the PR checked out, we don't have the file available locally to reveal in the explorer.
- Fixes microsoft/vscode-pull-request-github#6899
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.