Skip to content

refactor: move diff line counting logic to separate module

Tomas Vik requested to merge 344-track-changed-lines into main

Originally, we hoped that we won't have to implement #344 (closed). That meant that the logic responsible for parsing diff hunks and providing added line numbers could have been encapsulated in the CommentingRangeProvider (class responsible for showing commenting ranges #340 (closed)).

The gitlab#325161 didn't get fixed and so we need to implement a workaround to track the line index before and after the change for unchanged lines. This MR is extracting the original logic into a separate module where it can be reused.

Disclaimer: This MR might look large, but it mostly moves functions and tests from one file to another.

The MR consist of four smaller commits, I recommend reviewing it commit-by-commit. The commits are going to get squashed on merge.

Edited by Tomas Vik

Merge request reports

Loading