private static void GetNodePairs(ITreeNode firstNode, ITreeNode lastNode, IList<FormattingRange> list)
 {
     var firstChild = firstNode;
     var lastChild = lastNode;
     var commonParent = firstNode.FindCommonParent(lastNode);
     while (firstChild != null && firstChild.Parent != commonParent)
     {
         firstChild = firstChild.Parent;
     }
     while (lastChild != null && lastChild.Parent != commonParent)
     {
         lastChild = lastChild.Parent;
     }
     Assertion.Assert(firstChild != null, "firstChild != null");
     Assertion.Assert(lastChild != null, "lastChild != null");
     var node = firstChild;
     while (node != null && node != lastChild.NextSibling)
     {
         if (!node.IsWhitespaceToken())
         {
             GetNodePairs(node, list, commonParent);
         }
         node = node.NextSibling;
     }
 }
        private static void GetNodePairs(ITreeNode firstNode, ITreeNode lastNode, IList <FormattingRange> list)
        {
            var firstChild   = firstNode;
            var lastChild    = lastNode;
            var commonParent = firstNode.FindCommonParent(lastNode);

            while (firstChild != null && firstChild.Parent != commonParent)
            {
                firstChild = firstChild.Parent;
            }
            while (lastChild != null && lastChild.Parent != commonParent)
            {
                lastChild = lastChild.Parent;
            }
            Assertion.Assert(firstChild != null, "firstChild != null");
            Assertion.Assert(lastChild != null, "lastChild != null");
            var node = firstChild;

            while (node != null && node != lastChild.NextSibling)
            {
                if (!node.IsWhitespaceToken())
                {
                    GetNodePairs(node, list, commonParent);
                }
                node = node.NextSibling;
            }
        }