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

Use DiffEditor DiffNavigator to navigate diffs #14889

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

colin-grant-work
Copy link
Contributor

@colin-grant-work colin-grant-work commented Feb 10, 2025

What it does

Fixes #14888 by adding diff navigation commands to the toolbar of diff editors and using the existing diff navigator tool in MonacoDiffEditors to navigate among changes.

How to test

  1. Open a diff editor with some changes.

Common ways to do this: modify a file and then open it from the source control view; use the 'select for comparison...compare with selected' commands in the file tree; using the AI chat features, ask the @Coder agent to make modifications.

  1. You should see up and down arrows on the toolbar, and clicking them should take to the next / previous change in the file, as appropriate.
  2. If you open a diff editor with no differences, the arrows should appear, but they should be greyed out.

@ reviewers, there was relevant work in #13104, but since that was mostly related to @theia/git, I'm not sure the machinery implemented there is relevant anymore. The code here just skips that machinery in the case that I believe I know how to handle better, but possibly it's just no longer necessary. In particular, I'm not sure how we would have a diff in an editor with a file scheme.

Follow-ups

Breaking changes

  • This PR introduces breaking changes and requires careful review. If yes, the breaking changes section in the changelog has been updated.

Attribution

Review checklist

Reminder for reviewers

@colin-grant-work colin-grant-work force-pushed the feature/diff-navigation branch 2 times, most recently from be5109a to bcea1ff Compare February 10, 2025 23:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Waiting on reviewers
Development

Successfully merging this pull request may close these issues.

Enable change navigation in diff editors
1 participant