protected override bool TryGetActiveSpan(SyntaxNode node, int statementPart, out TextSpan span)
        {
            switch (node.Kind())
            {
                case SyntaxKind.Block:
                    span = GetActiveSpan((BlockSyntax)node, (BlockPart)statementPart);
                    return true;

                case SyntaxKind.ForEachStatement:
                    span = GetActiveSpan((ForEachStatementSyntax)node, (ForEachPart)statementPart);
                    return true;

                case SyntaxKind.DoStatement:
                    // The active statement of DoStatement node is the while condition,
                    // which is lexically not the closest breakpoint span (the body is).
                    // do { ... } [|while (condition);|]
                    var doStatement = (DoStatementSyntax)node;
                    return node.TryGetClosestBreakpointSpan(doStatement.WhileKeyword.SpanStart, out span);

                case SyntaxKind.PropertyDeclaration:
                    // The active span corresponding to a property declaration is the span corresponding to its initializer (if any),
                    // not the span correspoding to the accessor.
                    // int P { [|get;|] } = [|<initializer>|];
                    var propertyDeclaration = (PropertyDeclarationSyntax)node;

                    if (propertyDeclaration.Initializer != null &&
                        node.TryGetClosestBreakpointSpan(propertyDeclaration.Initializer.SpanStart, out span))
                    {
                        return true;
                    }
                    else
                    {
                        span = default(TextSpan);
                        return false;
                    }

                default:
                    return node.TryGetClosestBreakpointSpan(node.SpanStart, out span);
            }
        }
 public static IEnumerable<TextSpan> GetBreakpointSequence(SyntaxNode root, int position)
 {
     int endPosition = root.Span.End;
     int lastSpanEnd = 0;
     while (position < endPosition)
     {
         TextSpan span;
         if (root.TryGetClosestBreakpointSpan(position, out span) && span.End > lastSpanEnd)
         {
             position = lastSpanEnd = span.End;
             yield return span;
         }
         else
         {
             position++;
         }
     }
 }
 protected override bool TryGetEnclosingBreakpointSpan(SyntaxNode root, int position, out TextSpan span)
 {
     return root.TryGetClosestBreakpointSpan(position, out span);
 }