예제 #1
0
        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));
        }
 public ProjectionSpanDiffer(IDifferenceService diffService,
                             ReadOnlyCollection <SnapshotSpan> deletedSnapSpans,
                             ReadOnlyCollection <SnapshotSpan> insertedSnapSpans)
 {
     this.diffService            = diffService;
     this.inputDeletedSnapSpans  = deletedSnapSpans;
     this.inputInsertedSnapSpans = insertedSnapSpans;
 }
예제 #3
0
 public DiffController(
     IDifferenceLeftRepository differenceLeftRepository,
     IDifferenceRightRepository differenceRightRepository,
     IDifferenceService differenceService)
 {
     _differenceLeftRepository  = differenceLeftRepository;
     _differenceRightRepository = differenceRightRepository;
     _differenceService         = differenceService;
 }
예제 #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DiffController"/> class.
 /// </summary>
 /// <param name="differenceService">The service that implements difference.</param>
 public DiffController(IDifferenceService differenceService)
 {
     _differenceService = differenceService;
 }
 internal ProjectionWorkaroundTagger(IProjectionBuffer projectionBuffer, IDifferenceService diffService)
 {
     this.ProjectionBuffer = projectionBuffer;
     this.diffService      = diffService;
     this.ProjectionBuffer.SourceBuffersChanged += SourceSpansChanged;
 }
예제 #6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DifferenceServiceHost"/> class.
 /// </summary>
 /// <param name="differenceService">The service that implements difference.</param>
 public DifferenceServiceHost(IDifferenceService differenceService)
 {
     _differenceService = differenceService;
 }