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