Announcement

Collapse
No announcement yet.

Comments are not ignored when aligning

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Comments are not ignored when aligning

    Hello,
    When comparing C# source files, the comment lines sometimes are aligned to actual code lines.

    I am using the built-in "C,C++,C# Source" format, and I have marked Comment as non-important in Session Settings.

    Attached is a Zip with two very simple C# files. One has one line of code, and the other has 2 lines - comment line and code line.
    Instead of aligning the code lines, the code line is aligned against the comment line. The code lines are only partially equal, but the comment line should be completely ignored for comparison.

    Attached is a screenshot of the comparison.

    Is this a bug ? How can I make the code lines align in this case ?

    Thanks, Igal.

  • #2
    Thanks for the sample files. Sometimes our Alignment has some fringe/troublecases it doesn't align as well as it should. I'll add these files to our test cases so we can test against them in the future.

    For this specific (2 line) example, you would need to manually align them with the right-click -> Align option. If more lines are introduced to the file, it is possible to will affect the overall alignment.
    Aaron P Scooter Software

    Comment


    • #3
      Thank you Aaron.

      Can you suggest a way to "fix" the alignment automatically ?
      This is just a sample from a larger file, in which this misalignment happens several times. Manually aligning it is very time consuming.

      Regards, Igal.

      Comment


      • #4
        Hello,

        Would it be possible to email us a full (or larger) set of example files? If you email us at [email protected] please also include a link back to this forum thread for our reference.

        Update: Line Weights might help. They are not absolute, but can help push/shift alignment around slightly. Do you see better results if you toggle Closeness matching or use Alternate Method in the Session Settings -> Alignment tab?
        Last edited by Aaron; 28-Sep-2012, 10:14 AM. Reason: Line Weights
        Aaron P Scooter Software

        Comment


        • #5
          Hello Aaron.

          I will produce larger example files and email to the address you provided.

          I tried defining Line Weights. This didn't help.
          As far as I understand your comments in other posts, Line Weights only come into play when there are several exactly matching lines, and one needs to define which line is to be matched first.

          I tried toggling Closesness matching, and using Alternate Method. I tried setting various Skew Tolerance values. This didn't help.

          Comment


          • #6
            Skew Tolerance helps if there are matches further away and probably wouldn't help in this case. Alternate Method and Closeness could have different impact, depending on the rest of the file.

            Line Weights come into play when the alignment algorithm has to decide between two equally weighted lines. The lines themselves do not have to be an exact match, but that is a common case.

            Feel free to email us the example files whenever you get the chance. We appreciate it and will add them to our list of test cases.
            Aaron P Scooter Software

            Comment

            Working...
            X