Skip to content

Improve ignore comments logic #115

@CodesAway

Description

@CodesAway

When comparing, improve handling when ignore comments

  • If only change in line is adding / deleting comments, should ignore

    • This handles the common case of adding a line comment on the same line as existing code
    • The current code only handles if the entire line is a comment and is added / removed
  • When handling split lines, should ignore comments

    • For example, a recent work cleanup I did in a file removed comments and combined lines
    • If ignoring comments, this difference should be ignored

To handle the second scenario, I'm improving the split line logic to accept a normalization function that takes Indexed, so it knows of the line number. This info combined with the BEXString which can indicated commented out code will allow normalizing away commented out code and ignoring it.

A new NormalizationFunction class is being added and existing methods are being overloaded to take the new class as wall as keep the existing signature, calling the new overloaded methods, by first wrapping the BiFunction<String, String, DiffNormalizedText> into a NormalizationFunction (using the static normalization method)

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions