Skip to content

Fixes invariant violation in tryRebase#291840

Merged
hediet merged 1 commit intomainfrom
hediet/b/accepted-raccoon
Jan 30, 2026
Merged

Fixes invariant violation in tryRebase#291840
hediet merged 1 commit intomainfrom
hediet/b/accepted-raccoon

Conversation

@hediet
Copy link
Member

@hediet hediet commented Jan 30, 2026

No description provided.

Copilot AI review requested due to automatic review settings January 30, 2026 10:17
@hediet hediet enabled auto-merge (squash) January 30, 2026 10:17
@hediet hediet self-assigned this Jan 30, 2026
@vs-code-engineering vs-code-engineering bot added this to the February 2026 milestone Jan 30, 2026
Copy link
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 an invariant violation in the tryRebase method by improving conflict detection logic and adding comprehensive test coverage for rebase invariants.

Changes:

  • Enhanced conflict detection in tryRebase to handle inserts strictly inside ranges and inserts at range boundaries
  • Removed redundant sorted/disjoint invariant checking code that was causing false positives
  • Added 1000 randomized test cases validating five key rebase invariants (symmetry, diamond property, empty edit behavior, and TP2)

Reviewed changes

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

File Description
src/vs/editor/common/core/edits/stringEdit.ts Fixed conflict detection logic by adding helper function and updating rebase conditions; added parse method for debugging
src/vs/editor/common/core/ranges/offsetRange.ts Added documentation clarifying that intersects returns false for empty ranges
src/vs/editor/test/common/core/stringEdit.test.ts Added comprehensive test suite with 1000 randomized cases validating rebase invariants

@hediet hediet merged commit 963958a into main Jan 30, 2026
27 of 28 checks passed
@hediet hediet deleted the hediet/b/accepted-raccoon branch January 30, 2026 10:36
@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Mar 16, 2026
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.

3 participants