Store MarkerRanges in Gitlab::Diff::Line objects [RUN ALL RSPEC] [RUN AS-IF-FOSS]

Merged Vasilii Iakliushin requested to merge 16950_use_marker_ranges_2 into master

What does this MR do?

Contributes to #16950 (closed)

Follow-up for !55669 (merged)

Feature flag #324638

Explanation

I'm making a set of changes to update Gitlab::Diff::Highlight code to make it reusable for word-diff feature.

In the previous MR I created a new MarkerRange class that can keep information not only about the range of changed characters in the diff line but also the type of the change ('addition' or 'deletion').

I updated Gitlab::Diff::Highlight to populate Diff::Line objects with corresponding MarkerRanges. This change should not affect the final highlighted result. I will remove the duplicated code after verifying that the new version works without any problems.

Screenshots (strongly suggested)

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team
Edited by Michael Kozono