/// <summary>
 /// Initializes a new instance of the <see cref="DiffResultSpan"/> class.
 /// </summary>
 /// <param name="status">
 /// The status.
 /// </param>
 /// <param name="destIndex">
 /// The dest index.
 /// </param>
 /// <param name="sourceIndex">
 /// The source index.
 /// </param>
 /// <param name="length">
 /// The length.
 /// </param>
 protected DiffResultSpan(DiffResultSpanStatus status, int destIndex, int sourceIndex, int length)
 {
     this.status = status;
     this.destIndex = destIndex;
     this.sourceIndex = sourceIndex;
     this.length = length;
 }
Exemple #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DiffResultSpan"/> class.
 /// </summary>
 /// <param name="status">
 /// The status.
 /// </param>
 /// <param name="destIndex">
 /// The dest index.
 /// </param>
 /// <param name="sourceIndex">
 /// The source index.
 /// </param>
 /// <param name="length">
 /// The length.
 /// </param>
 protected DiffResultSpan(DiffResultSpanStatus status, int destIndex, int sourceIndex, int length)
 {
     this.status      = status;
     this.destIndex   = destIndex;
     this.sourceIndex = sourceIndex;
     this.length      = length;
 }
Exemple #3
0
 protected DiffResultSpan(DiffResultSpanStatus status, int destIndex, int sourceIndex, int length)
 {
     _status      = status;
     _destIndex   = destIndex;
     _sourceIndex = sourceIndex;
     _length      = length;
 }
 protected DiffResultSpan(DiffResultSpanStatus status, int destIndex, int sourceIndex, int length)
 {
     Status      = status;
     DestIndex   = destIndex;
     SourceIndex = sourceIndex;
     Length      = length;
 }
        // Potter
        public DiffChunk(DiffResultSpanStatus status, int length, int StartA, int StartB)
        {
            int CountA = (status == DiffResultSpanStatus.AddDestination ? 0 : length);

            Left = new Range(StartA, CountA);
            int CountB = (status == DiffResultSpanStatus.DeleteSource ? 0 : length);

            Right = new Range(StartB, CountB);
            //TempDump("P ");
        }
 protected DiffResultSpan(
     DiffResultSpanStatus status,
     int destIndex,
     int sourceIndex,
     int length)
 {
     _status = status;
     _destIndex = destIndex;
     _sourceIndex = sourceIndex;
     _length = length;
 }
Exemple #7
0
        private static List <MethodDeclarationSyntax> GetChangedPublicMethods(Document doc, ArrayList changes)
        {
            List <MethodDeclarationSyntax> mdsList = new List <MethodDeclarationSyntax>();
            var  syntaxTree  = doc.GetSemanticModelAsync().Result.SyntaxTree;
            bool isTestClass = IsThisTestClass(syntaxTree);

            if (isTestClass)
            {
                return(null);
            }

            DiffResultSpanStatus changeType = DiffResultSpanStatus.NoChange;
            int sourceIndex      = 0;
            int destIndex        = 0;
            int changeLength     = 0;
            int changedLineStart = 0;
            int changedLineEnd   = 0;

            foreach (DiffResultSpan change in changes)
            {
                changeType       = change.Status;
                sourceIndex      = change.SourceIndex + 1;
                destIndex        = change.DestIndex + 1;
                changeLength     = change.Length;
                changedLineStart = changeType.Equals(DiffResultSpanStatus.DeleteSource) ? sourceIndex : destIndex;
                changedLineEnd   = changedLineStart + changeLength - 1;

                var mds = GetMethodBetweenLines(syntaxTree, changedLineStart, changedLineEnd);

                if (mds != null)
                {
                    mdsList.AddRange(mds);
                }
            }


            return(mdsList);
        }