public static BaseObjectCreationExpressionSyntax GetNewObjectCreation(
            BaseObjectCreationExpressionSyntax baseObjectCreation,
            SeparatedSyntaxList <ExpressionSyntax> expressions)
        {
            if (baseObjectCreation is ObjectCreationExpressionSyntax objectCreation &&
                objectCreation.ArgumentList?.Arguments.Count == 0)
            {
                baseObjectCreation = objectCreation
                                     .WithType(objectCreation.Type.WithTrailingTrivia(objectCreation.ArgumentList.GetTrailingTrivia()))
                                     .WithArgumentList(null);
            }

            var firstExpression = expressions.First();
            var initializerKind = firstExpression is AssignmentExpressionSyntax
                ? SyntaxKind.ObjectInitializerExpression
                : SyntaxKind.CollectionInitializerExpression;

            return(baseObjectCreation.WithInitializer(InitializerExpression(initializerKind, expressions)));
        }
    private static async Task <Document> CreateObjectInitializer(Document document, SemanticModel semanticModel, BaseObjectCreationExpressionSyntax objectCreationExpression, TypeInfo typeInfo, CancellationToken cancellationToken)
    {
        var mutableMembers = GetMutableMembers(typeInfo, semanticModel.Compilation);

        var availableSymbols = semanticModel.LookupSymbols(objectCreationExpression.SpanStart);

        var options = await document.GetOptionsAsync(cancellationToken).ConfigureAwait(false);

        var expressionList = CreateAssignmentExpressions(document, mutableMembers, availableSymbols);

        expressionList = FormatExpressionList(expressionList, options);

        var        initializer = SyntaxFactory.InitializerExpression(SyntaxKind.ObjectInitializerExpression, expressionList);
        SyntaxNode newNode     = objectCreationExpression.WithInitializer(initializer);

        var documentEditor = await DocumentEditor.CreateAsync(document, cancellationToken).ConfigureAwait(false);

        documentEditor.ReplaceNode(objectCreationExpression, newNode);

        return(documentEditor.GetChangedDocument());
    }