Repository: dotnet/roslyn
File: src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/LanguageServices/CSharpSyntaxGeneratorInternal.cs (C#)

Code before:
    public override bool SupportsThrowExpression()
        => true;

    public override bool RequiresExplicitImplementationForInterfaceMembers
        => false;

    public override SyntaxTrivia EndOfLine(string text)
        => SyntaxFactory.EndOfLine(text);

    public override SyntaxTrivia SingleLineComment(string text)
        => SyntaxFactory.Comment("//" + text);

    public override SyntaxNode LocalDeclarationStatement(SyntaxNode? type, SyntaxToken name, SyntaxNode? initializer, bool isConst)
    {
        return SyntaxFactory.LocalDeclarationStatement(
            isConst ? [ConstKeyword] : default,
             VariableDeclaration(type, name, initializer));
    }

    public override SyntaxNode WithInitializer(SyntaxNode variableDeclarator, SyntaxNode initializer)
        => ((VariableDeclaratorSyntax)variableDeclarator).WithInitializer((EqualsValueClauseSyntax)initializer);

    public override SyntaxNode WithPropertyInitializer(SyntaxNode propertyDeclaration, SyntaxNode initializer)
    {
        var property = (PropertyDeclarationSyntax)propertyDeclaration;
        var equalsValueClause = SyntaxFactory.EqualsValueClause((ExpressionSyntax)initializer);
        return property
            .WithInitializer(equalsValueClause)
            .WithSemicolonToken(SyntaxFactory.Token(SyntaxKind.SemicolonToken));
    }

    public override SyntaxNode EqualsValueClause(SyntaxToken operatorToken, SyntaxNode value)
        => SyntaxFactory.EqualsValueClause(operatorToken, (ExpressionSyntax)value);

    internal static VariableDeclarationSyntax VariableDeclaration(SyntaxNode? type, SyntaxToken name, SyntaxNode? expression)
    {
        return SyntaxFactory.VariableDeclaration(
            type == null ? SyntaxFactory.IdentifierName("var") : (TypeSyntax)type,
                [SyntaxFactory.VariableDeclarator(
                    name, argumentList: null,
                    expression == null ? null : SyntaxFactory.EqualsValueClause((ExpressionSyntax)expression))]);
    }

    public override SyntaxToken Identifier(string identifier)
        => SyntaxFactory.Identifier(identifier);

    public override SyntaxNode ConditionalAccessExpression(SyntaxNode expression, SyntaxNode whenNotNull)
        => SyntaxFactory.ConditionalAccessExpression((ExpressionSyntax)expression, (ExpressionSyntax)whenNotNull);

    public override SyntaxNode MemberBindingExpression(SyntaxNode name)
        => SyntaxFactory.MemberBindingExpression((SimpleNameSyntax)name);

Review comment (suggestion):
@copilot Actually, you should match the WithInitializer code and just do the cast to EqualsValueClauseSyntax.  But this does mean the *caller* code you added must wrap the initializer as an EqualsValueClause before passing in.  

Code after:
    public override bool SupportsThrowExpression()
        => true;

    public override bool RequiresExplicitImplementationForInterfaceMembers
        => false;

    public override SyntaxTrivia EndOfLine(string text)
        => SyntaxFactory.EndOfLine(text);

    public override SyntaxTrivia SingleLineComment(string text)
        => SyntaxFactory.Comment("//" + text);

    public override SyntaxNode LocalDeclarationStatement(SyntaxNode? type, SyntaxToken name, SyntaxNode? initializer, bool isConst)
    {
        return SyntaxFactory.LocalDeclarationStatement(
            isConst ? [ConstKeyword] : default,
             VariableDeclaration(type, name, initializer));
    }

    public override SyntaxNode WithInitializer(SyntaxNode variableDeclarator, SyntaxNode initializer)
        => ((VariableDeclaratorSyntax)variableDeclarator).WithInitializer((EqualsValueClauseSyntax)initializer);

    public override SyntaxNode WithPropertyInitializer(SyntaxNode propertyDeclaration, SyntaxNode initializer)
    {
        var property = (PropertyDeclarationSyntax)propertyDeclaration;
        return property
            .WithInitializer((EqualsValueClauseSyntax)initializer)
            .WithSemicolonToken(SyntaxFactory.Token(SyntaxKind.SemicolonToken));
    }

    public override SyntaxNode EqualsValueClause(SyntaxNode value)
        => EqualsValueClause(EqualsToken, value);

    public override SyntaxNode EqualsValueClause(SyntaxToken operatorToken, SyntaxNode value)
        => SyntaxFactory.EqualsValueClause(operatorToken, (ExpressionSyntax)value);

    internal static VariableDeclarationSyntax VariableDeclaration(SyntaxNode? type, SyntaxToken name, SyntaxNode? expression)
    {
        return SyntaxFactory.VariableDeclaration(
            type == null ? SyntaxFactory.IdentifierName("var") : (TypeSyntax)type,
                [SyntaxFactory.VariableDeclarator(
                    name, argumentList: null,
                    expression == null ? null : SyntaxFactory.EqualsValueClause((ExpressionSyntax)expression))]);
    }

    public override SyntaxToken Identifier(string identifier)
        => SyntaxFactory.Identifier(identifier);

    public override SyntaxNode ConditionalAccessExpression(SyntaxNode expression, SyntaxNode whenNotNull)
        => SyntaxFactory.ConditionalAccessExpression((ExpressionSyntax)expression, (ExpressionSyntax)whenNotNull);