Skip to content

changed: a declaration longer or gone in the base than in the graph's text keeps its own lines - #1846

Merged
swapnilpaliwal-sd merged 1 commit into
apps/integration-0.1.9from
apps/java/changed-maps-hunks-to-wrong-declaration
Oct 2, 2026
Merged

swapnilpaliwal-sd merged 1 commit into
apps/integration-0.1.9from
apps/java/changed-maps-hunks-to-wrong-declaration

Conversation

@swapnilpaliwal-sd

Copy link
Copy Markdown
Contributor

When the graph is built from a text other than the range's base (a later commit, or the newer side of the range), changed misplaced hunks:

  • A span carried onto the base ended where the graph's shorter text ended. Statements the base had after that were charged to the next declaration or dropped. The span now runs on over lines only the base has, as long as they are still inside it (braces open, or Python indentation).
  • A deleted field line the graph never held came back as an anonymous inside <type>. It is now named as that field, removed.
  • With the graph at the range's newer side, added was not inverted, so a removed method or field read added — new method. It is now removed, and the swapped "line(s) gone" note is labelled removed.
  • Tests: a new Java grown-file-read-against-its-base case and two new Python checks, each with a control (an edit only in the method below). Both new checks failed before the fix.

Checked: tests/run.py, all 5 languages, 1394/1394 checks; java suite 79 passed, 0 failed. changed_range, edit_stale_spans and hook_rebase fail on the same checks as the base branch.

… text keeps its own lines

- a span carried from a later graph text onto the base runs on over the lines only the base has while they are
  still inside it (braces open, or deeper indentation): statements a later text deleted were charged to the
  method below or dropped
- a deleted field line the graph never held is named as that field, removed, not an anonymous 'inside <type>'
- a range read with the graph at its newer side turns 'added' into 'removed', like 'removed' into 'added'

Co-authored-by: axiomcode-bot[bot] <334110751+axiomcode-bot[bot]@users.noreply.github.com>
@swapnilpaliwal-sd
swapnilpaliwal-sd merged commit fc6c771 into apps/integration-0.1.9 Oct 2, 2026
12 checks passed
@swapnilpaliwal-sd
swapnilpaliwal-sd deleted the apps/java/changed-maps-hunks-to-wrong-declaration branch October 2, 2026 17:03
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.

1 participant