Skip to content

Remove empty diffs in legacy diff algorithm#314563

Open
tokyo4j wants to merge 1 commit intomicrosoft:mainfrom
tokyo4j:fix-legacy-empty-to-empty-diff
Open

Remove empty diffs in legacy diff algorithm#314563
tokyo4j wants to merge 1 commit intomicrosoft:mainfrom
tokyo4j:fix-legacy-empty-to-empty-diff

Conversation

@tokyo4j
Copy link
Copy Markdown

@tokyo4j tokyo4j commented May 5, 2026

This prevents reintroducing #248612 when #314348 is merged and legacy algorithm is used for quick diff.

Copilot AI review requested due to automatic review settings May 5, 2026 22:18
This properly fixes microsoft#248612, which was worked around by switching to
advanced diff algorithm.
@tokyo4j tokyo4j force-pushed the fix-legacy-empty-to-empty-diff branch from 132d10c to f120105 Compare May 5, 2026 22:20
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a legacy diff edge case where the prettification step can emit empty-to-empty hunks, which can surface as broken quick diff behavior in SCM when the legacy algorithm is selected.

Changes:

  • Filters out zero-length-on-both-sides diff hunks from LcsDiff's pretty diff output.
  • Adds a regression test covering the empty-to-empty hunk scenario from issue #248612.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/vs/base/common/diff/diff.ts Removes empty-to-empty changes from prettified diff results.
src/vs/editor/test/common/diff/diffComputer.test.ts Adds a regression test for the legacy line diff behavior that triggered the SCM UI issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants