Skip to content

Conversation

@LeftPhalange
Copy link
Contributor

@LeftPhalange LeftPhalange commented Aug 14, 2025

Addresses issue #260762. This adds the workbench.action.compareEditor.openSide or DIFF_OPEN_SIDE constant in to the MenuRegistry, which registers it into the Command Palette.

Below is a screenshot showing it in the command palette.

image

How to Test

  1. Open Visual Studio Code.
  2. Open a folder with two files.
  3. Select one file for compare in the Explorer pane by right-clicking it and click Select for Compare in the context menu.
  4. Select another file by right-clicking it and clicking on Compare with Selected in the context menu.
  5. The diff viewer should now open. Click on one of the file editors. This can be either side.
  6. Open the Command Palette by hitting CTRL + SHIFT + P (Command/Cmd for Mac, instead of CTRL).
  7. Look for "Open File on Selected Side". Click it while the desired file editor on either side is selected.
  8. The desired file should be opened on its own.

@LeftPhalange LeftPhalange changed the title Add Open File on Selected Side using DIFF_OPEN_SIDE command Add Open File on Selected Side option to Command Palette using DIFF_OPEN_SIDE command Aug 14, 2025
@hediet
Copy link
Member

hediet commented Aug 18, 2025

Thanks for the PR! Why is the command called Open File on Selected Side though?

@LeftPhalange
Copy link
Contributor Author

LeftPhalange commented Aug 18, 2025

@hediet - good question! When I created this PR, my understanding of the function DIFF_OPEN_SIDE is that the file on the selected side is opened when the chord CTRL + K and SHIFT + O is triggered in the diff editor, per issue #260762. I realize that any side of the editor does not necessarily mean it is a file, but just an editor.

Would other verbiage make more sense for this? For instance:

  1. Open Active Side in Editor (Open Active Diff Side in Editor?)
  2. Open Active Diff Side
  3. Open Selected Side in Editor

… command palette action to Open Active Diff Side
@LeftPhalange LeftPhalange changed the title Add Open File on Selected Side option to Command Palette using DIFF_OPEN_SIDE command Add Open Active Diff Side option to Command Palette using DIFF_OPEN_SIDE command Aug 18, 2025
@hediet hediet enabled auto-merge (squash) August 21, 2025 09:22
@vs-code-engineering vs-code-engineering bot added this to the August 2025 milestone Aug 21, 2025
@hediet hediet merged commit f36487a into microsoft:main Aug 21, 2025
17 checks passed
@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Oct 5, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

workbench.action.compareEditor.openSide ("open file" in diff editor) doesn't have a command in command palette

3 participants