Skip to content

Allow to open a diff editor with two untitled sides #165123

@fenilgmehta

Description

@fenilgmehta

On many occasions, we would like to compare texts (i.e. see a diff view) where the text for both sides of the diff will come from the clipboard. Following are some of the occasions out of many:

  1. arbitrary text from different place (e.g. browser, local files, terminal output, ...)
  2. code from the same file
  3. database queries from logs

Current workaround:

  1. Open two new files (file1, file2), and paste the text from both the sources which we want to compare
  2. Go to the file which we want to be on the left hand side of the diff view. Let us keep it as file1 for our example.
  3. Press CTRL+SHIFT+P and search Compare Active File With..., and find the second file (i.e. file2) from all the active files which we want on the right hand side of the diff view.
    • The searching of the second file (file2) from the open files has a lot of friction because:
      • the file name would be something like Untitled-N which we have to keep in mind after the file is created
      • many files can be open in the VSCode window, and performing a linear search by reading their names is quite slow
  4. View the diff
  5. Close the diff view, file1 and file2.

It would be great to have this option to Open Blank Diff View as a tab where we can directly paste clipboard content on both sides of the diff view. Even IDE's by Jetbrains have a similar feature.

Following is a possible flow after this features is implemented:

  1. Press CTRL+SHIFT+P and search Open Blank Diff View
  2. Paste the content on both sides of the diff view
  3. View the diff
  4. Close the diff view

Metadata

Metadata

Assignees

Labels

diff-editorDiff editor issuesfeature-requestRequest for new features or functionalitygood first issueIssues identified as good for first-time contributorshelp wantedIssues identified as good community contribution opportunitiesverification-neededVerification of issue is requestedverifiedVerification succeededworkbench-untitled-editorsManaging of untitled editors in workbench window

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions