public static ProjectionSpanDifference DiffSourceSpans(IDifferenceService diffService,
                                                               IProjectionSnapshot left,
                                                               IProjectionSnapshot right)
        {
            if (left == null)
            {
                throw new ArgumentNullException("left");
            }
            if (right == null)
            {
                throw new ArgumentNullException("right");
            }

            if (!object.ReferenceEquals(left.TextBuffer, right.TextBuffer))
            {
                throw new ArgumentException("left does not belong to the same text buffer as right");
            }

            ProjectionSpanDiffer differ = new ProjectionSpanDiffer
                                              (diffService,
                                              left.GetSourceSpans(),
                                              right.GetSourceSpans());

            return(new ProjectionSpanDifference(differ.GetDifferences(), differ.InsertedSpans, differ.DeletedSpans));
        }
 internal static SnapshotSpan GetSourceSpan(this IProjectionSnapshot snapshot, int index)
 {
     return(snapshot.GetSourceSpans(index, 1)[0]);
 }