private static Task <Document> SplitSimpleIfAsync(
            Document document,
            IfStatementSyntax ifStatement,
            CancellationToken cancellationToken)
        {
            ExpressionSyntax condition = ifStatement.Condition;
            StatementSyntax  statement = ifStatement.Statement.WithoutTrivia();

            List <IfStatementSyntax> ifStatements = SyntaxInfo.BinaryExpressionInfo(condition)
                                                    .AsChain()
                                                    .Select(expression => IfStatement(expression.TrimTrivia(), statement).WithFormatterAnnotation())
                                                    .ToList();

            ifStatements[0] = ifStatements[0].WithLeadingTrivia(ifStatement.GetLeadingTrivia());
            ifStatements[ifStatements.Count - 1] = ifStatements[ifStatements.Count - 1].WithTrailingTrivia(ifStatement.GetTrailingTrivia());

            if (ifStatement.IsEmbedded())
            {
                BlockSyntax block = Block(ifStatements);

                return(document.ReplaceNodeAsync(ifStatement, block, cancellationToken));
            }
            else
            {
                return(document.ReplaceNodeAsync(ifStatement, ifStatements, cancellationToken));
            }
        }
        private static Task <Document> RefactorAsync(
            Document document,
            IfStatementSyntax ifStatement,
            CancellationToken cancellationToken)
        {
            StatementSyntax  statement = ifStatement.Statement.WithoutTrivia();
            ExpressionSyntax condition = ifStatement.Condition;

            BinaryExpressionChainInfo info = SyntaxInfo.BinaryExpressionChainInfo((BinaryExpressionSyntax)condition);

            var ifStatements = new List <IfStatementSyntax>();

            foreach (ExpressionSyntax expression in info.Expressions)
            {
                ifStatements.Add(SyntaxFactory.IfStatement(expression.TrimTrivia(), statement).WithFormatterAnnotation());
            }

            ifStatements[0] = ifStatements[0].WithLeadingTrivia(ifStatement.GetLeadingTrivia());
            ifStatements[ifStatements.Count - 1] = ifStatements[ifStatements.Count - 1].WithTrailingTrivia(ifStatement.GetTrailingTrivia());

            if (ifStatement.IsEmbedded())
            {
                BlockSyntax block = SyntaxFactory.Block(ifStatements);

                return(document.ReplaceNodeAsync(ifStatement, block, cancellationToken));
            }
            else
            {
                return(document.ReplaceNodeAsync(ifStatement, ifStatements, cancellationToken));
            }
        }