1 override of WithStatements
Microsoft.CodeAnalysis.CSharp.Workspaces (1)
CodeGeneration\CSharpSyntaxGenerator.cs (1)
2499public override SyntaxNode WithStatements(SyntaxNode declaration, IEnumerable<SyntaxNode> statements)
22 references to WithStatements
Microsoft.CodeAnalysis.CodeStyle.Fixes (1)
src\Analyzers\Core\CodeFixes\UseSystemHashCode\UseSystemHashCodeCodeFixProvider.cs (1)
78var updatedDecl = generator.WithStatements(
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (4)
CodeGeneration\SyntaxGeneratorTests.cs (4)
3381var newGetAccessor = Generator.WithStatements(getAccessor, null); 3568Assert.Equal(2, Generator.GetStatements(Generator.WithStatements(Generator.MethodDeclaration("m"), stmts)).Count); 3569Assert.Equal(2, Generator.GetStatements(Generator.WithStatements(Generator.ConstructorDeclaration(), stmts)).Count); 3573Assert.Equal(0, Generator.GetStatements(Generator.WithStatements(Generator.IdentifierName("x"), stmts)).Count);
Microsoft.CodeAnalysis.VisualBasic.Workspaces.UnitTests (16)
CodeGeneration\SyntaxGeneratorTests.vb (16)
2986Assert.Equal(2, Generator.GetStatements(Generator.WithStatements(Generator.MethodDeclaration("m"), stmts)).Count) 2987Assert.Equal(2, Generator.GetStatements(Generator.WithStatements(Generator.ConstructorDeclaration(), stmts)).Count) 2989Assert.Equal(2, Generator.GetStatements(Generator.WithStatements(Generator.VoidReturningLambdaExpression({}), stmts)).Count) 2990Assert.Equal(2, Generator.GetStatements(Generator.WithStatements(Generator.ValueReturningLambdaExpression({}), stmts)).Count) 2992Assert.Equal(2, Generator.GetStatements(Generator.WithStatements(Generator.VoidReturningLambdaExpression(Generator.IdentifierName("e")), stmts)).Count) 2993Assert.Equal(2, Generator.GetStatements(Generator.WithStatements(Generator.ValueReturningLambdaExpression(Generator.IdentifierName("e")), stmts)).Count) 2995Assert.Equal(0, Generator.GetStatements(Generator.WithStatements(Generator.IdentifierName("x"), stmts)).Count) 3003Generator.WithStatements(Generator.VoidReturningLambdaExpression({}), stmts), 3010Generator.WithStatements(Generator.ValueReturningLambdaExpression({}), stmts), 3017Generator.WithStatements(Generator.VoidReturningLambdaExpression(Generator.IdentifierName("e")), stmts), 3024Generator.WithStatements(Generator.ValueReturningLambdaExpression(Generator.IdentifierName("e")), stmts), 3031Generator.WithStatements(Generator.VoidReturningLambdaExpression(stmts), {}), 3036Generator.WithStatements(Generator.ValueReturningLambdaExpression(stmts), {}), 3041Generator.WithStatements(Generator.VoidReturningLambdaExpression(Generator.IdentifierName("e")), {}), 3046Generator.WithStatements(Generator.ValueReturningLambdaExpression(Generator.IdentifierName("e")), {}), 3085Dim newGetAccessor = _g.WithStatements(getAccessor, Nothing)
Microsoft.CodeAnalysis.Workspaces (1)
Editing\SyntaxEditorExtensions.cs (1)
44=> editor.ReplaceNode(declaration, (d, g) => g.WithStatements(d, statements));