/// <summary> /// Build array with sequence points movement using <c>BodyChangeHistory</c> instance, /// which is storing informations collected from editor events. /// </summary> /// <param name="history"><c>BodyChangeHistory</c> instance storing informations collected from editor events.</param> private void findChanges(BodyChangeHistory history) { for (int i = 0; i < history.TextChanges.Count; i++) { if (history.TextChanges[i].Semicolon != null) { int oldStartOff = oldOffset(history.TextChanges[i].Offset, i, history.TextChanges); int line, column; history.Converter.GetPositionFromOffset(oldStartOff, out line, out column); if (history.TextChanges[i].Removed) { diffSequencePoints[findSeqPoint((uint)line, (uint)column)] -= history.TextChanges[i].Semicolon.Length; } else { diffSequencePoints[findSeqPoint((uint)line, (uint)column)] += history.TextChanges[i].Semicolon.Length; } } } }
public SequencePointRemapper(List <SequencePoint> origSeqPoints, List <SequencePoint> newSeqPoints, BodyChangeHistory history) { originalSequencePoints = origSeqPoints; diffSequencePoints = new int[origSeqPoints.Count]; newSequencePoints = newSeqPoints; if (history != null) { findChanges(history); } }