Skip to content
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

Multi File Diff Editor #179000

Closed
lszomoru opened this issue Apr 3, 2023 · 8 comments · Fixed by #197652
Closed

Multi File Diff Editor #179000

lszomoru opened this issue Apr 3, 2023 · 8 comments · Fixed by #197652
Assignees
Labels
feature-request Request for new features or functionality insiders-released Patch has been released in VS Code Insiders on-testplan scm General SCM compound issues
Milestone

Comments

@lszomoru
Copy link
Member

lszomoru commented Apr 3, 2023

Explore creating a custom editor that would show a list of diff editor widget.

@lszomoru lszomoru added the scm General SCM compound issues label Apr 3, 2023
@lszomoru lszomoru added this to the April 2023 milestone Apr 3, 2023
@lszomoru lszomoru self-assigned this Apr 3, 2023
@lszomoru lszomoru added the feature-request Request for new features or functionality label Apr 3, 2023
@7rulnik
Copy link

7rulnik commented Apr 11, 2023

@lszomoru do I understand it correctly that basically, it's a one-long list of diffs like in GitHub PRs?

@lszomoru lszomoru modified the milestones: April 2023, May 2023 Apr 26, 2023
@joaomoreno joaomoreno changed the title Workbench - diff list custom editor Support opening a set of changes using a changes editor May 3, 2023
@lszomoru lszomoru modified the milestones: May 2023, Backlog May 15, 2023
@jacekkopecky
Copy link
Contributor

@lszomoru do you mean something similar to my extension Whole Diff ?

@hediet
Copy link
Member

hediet commented Aug 10, 2023

I think this feature consists of two different problems:

  • Have a custom editor that has IMultiDocumentDiffEditorModel as model (might need @bpasero's help):
    interface IMultiDocumentDiffEditorModel {
      diffs: LazyPromise<IDiffEntry>[];
      onDidChange: Event;
    }
    // The lazy promise allows lazy-loading (only load a the original/modified files when they are in view) and streaming (show the diff of the first file already while the other files are loading).
    // This might be very useful for reviewing github PRs on github.dev.
    interface LazyPromise<T> {
       request(): Promise<T>;
       value: T | undefined;
       onDidChange: Event;
    }
    // invariant: assert(original || modified);
    interface IDiffEntry {
       original: ITextModel | undefined; // undefined if the file was created.
       modified: ITextModel | undefined; // undefined if the file was deleted.
    }
    • There should be a command to open a multi diff editor with a model that represents all changed files. This model should fire an event when the list of changed files changes.
    • There could be an implementation of IMultiDocumentDiffEditorModel that is mapped to a folder, then extensions could easily invoke this editor
  • Make the diff editors virtual (@hediet)
    • Both the contents of each diff editor as well as the diff editors itself should be virtual
    • See here for how virtualization could be achieved.

@Igorgro
Copy link

Igorgro commented Aug 10, 2023

@hediet what do you think about extension mentioned above?

@hediet
Copy link
Member

hediet commented Aug 10, 2023

@Igorgro I didn't try it, but it looks like a decent alternative. It seems to create a patch file that you can then view using a different extension. The feature request described in this issue goes much further, as we want to use our diff algorithm and the monaco editor to render the changes. We also want to allow users to modify/revert changes, which is not possible with the patch file approach.

@jacekkopecky
Copy link
Contributor

Agreed with @hediet – my extension is useful but similar-but-richer native functionality would be preferred.

@hediet hediet changed the title Support opening a set of changes using a changes editor Multi File Diff Editor Aug 25, 2023
@bpasero bpasero removed their assignment Aug 30, 2023
@hediet hediet modified the milestones: Backlog, November 2023 Nov 7, 2023
@VSCodeTriageBot VSCodeTriageBot added unreleased Patch has not yet been released in VS Code Insiders insiders-released Patch has been released in VS Code Insiders and removed unreleased Patch has not yet been released in VS Code Insiders labels Nov 9, 2023
@lszomoru lszomoru removed their assignment Nov 27, 2023
@hediet hediet mentioned this issue Nov 27, 2023
3 tasks
@eamodio
Copy link
Contributor

eamodio commented Nov 28, 2023

@hediet Loving where this is going so far, but I've noticed some issue, but also would love to see additions/changes to the new vscode.changes command. How should I best report those? I didn't see a specific issue for the vscode.changes command.

@hediet
Copy link
Member

hediet commented Nov 28, 2023

The vscode.changes command is experimental and subject to change. Feel free to create individual issues! But we cannot commit on stable API yet.

@github-actions github-actions bot locked and limited conversation to collaborators Dec 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality insiders-released Patch has been released in VS Code Insiders on-testplan scm General SCM compound issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants