Skip to content

Add ToString override to DiffPiece - #159

Merged
mmanela merged 1 commit into
mmanela:masterfrom
Maneet7805:diffpiece-tostring
Nov 26, 2026
Merged

mmanela merged 1 commit into
mmanela:masterfrom
Maneet7805:diffpiece-tostring

Conversation

@Maneet7805

@Maneet7805 Maneet7805 commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #84

Adds a ToString() override to DiffPiece so pieces are readable in the debugger
Handles missing values safely and includes 3 unit tests. All 251 tests pass.
I wrote this with help from an AI assistant and have reviewed and tested it myself.

Summary by CodeRabbit

  • New Features
    • Diff results now have a readable text representation that includes position, sub-piece count, change type, and text. Missing positions are shown as a dash, and the representation remains available when sub-pieces or text are absent. This makes it easier to inspect individual pieces of a diff in text form.

Shows position, sub-piece count, change type and text, so a
DiffPaneModel's Lines are readable in the debugger without expanding
each piece. Null-safe for Position, SubPieces and Text.

Fixes mmanela#84
@Maneet7805

Copy link
Copy Markdown
Contributor Author

Hi! Just checking in on this small PR. This is my first contribution here, so please let me know if you'd like changes, such as the ToString format or additional tests. If CI needs approval to run, I'd appreciate that too. Thanks!

Repository owner deleted a comment from coderabbitai Bot Nov 26, 2026

@mmanela mmanela left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Looks fine to me, thanks for helping!

@mmanela
mmanela merged commit 2e1e171 into mmanela:master Nov 26, 2026
1 check passed
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.

ToString override on DiffPiece (and possibly others)

2 participants