Exemple #1
0
 private static void MarkNodeHierarchyDirty(HashSet <TextSpan> allSpans, SyntaxNode node, TextChangeRange[] changes, int currentChangeIndex)
 {
     /* Find all parent of the node and mark the '<' of their start element
      * or the start of the whole attribute as dirty
      */
     foreach (var parent in node.GetParentElementsAndAttributes())
     {
         var parentStart = parent.Start;
         for (int j = currentChangeIndex - 1; j >= 0; j--)
         {
             var previousChange = changes[j];
             if (previousChange.Span.Start < parentStart)
             {
                 parentStart += previousChange.NewLength - previousChange.Span.Length;
             }
         }
         allSpans.Add(new TextSpan(parentStart, 0));
     }
     // Add the node
     allSpans.Add(new TextSpan(node.Span.Start, 0));
 }