Base:
property
Statement
Microsoft.CodeAnalysis.CSharp.Syntax.CommonForEachStatementSyntax.Statement
39 references to Statement
Microsoft.CodeAnalysis.CSharp (11)
Syntax.xml.Main.Generated.cs (1)
1894
=> node.Update(VisitList(node.AttributeLists), VisitToken(node.AwaitKeyword), VisitToken(node.ForEachKeyword), VisitToken(node.OpenParenToken), (TypeSyntax?)Visit(node.Type) ?? throw new ArgumentNullException("type"), VisitToken(node.Identifier), VisitToken(node.InKeyword), (ExpressionSyntax?)Visit(node.Expression) ?? throw new ArgumentNullException("expression"), VisitToken(node.CloseParenToken), (StatementSyntax?)Visit(node.
Statement
) ?? throw new ArgumentNullException("statement"));
Syntax.xml.Syntax.Generated.cs (10)
7787
if (attributeLists != this.AttributeLists || awaitKeyword != this.AwaitKeyword || forEachKeyword != this.ForEachKeyword || openParenToken != this.OpenParenToken || type != this.Type || identifier != this.Identifier || inKeyword != this.InKeyword || expression != this.Expression || closeParenToken != this.CloseParenToken || statement != this.
Statement
)
7798
public new ForEachStatementSyntax WithAttributeLists(SyntaxList<AttributeListSyntax> attributeLists) => Update(attributeLists, this.AwaitKeyword, this.ForEachKeyword, this.OpenParenToken, this.Type, this.Identifier, this.InKeyword, this.Expression, this.CloseParenToken, this.
Statement
);
7800
public new ForEachStatementSyntax WithAwaitKeyword(SyntaxToken awaitKeyword) => Update(this.AttributeLists, awaitKeyword, this.ForEachKeyword, this.OpenParenToken, this.Type, this.Identifier, this.InKeyword, this.Expression, this.CloseParenToken, this.
Statement
);
7802
public new ForEachStatementSyntax WithForEachKeyword(SyntaxToken forEachKeyword) => Update(this.AttributeLists, this.AwaitKeyword, forEachKeyword, this.OpenParenToken, this.Type, this.Identifier, this.InKeyword, this.Expression, this.CloseParenToken, this.
Statement
);
7804
public new ForEachStatementSyntax WithOpenParenToken(SyntaxToken openParenToken) => Update(this.AttributeLists, this.AwaitKeyword, this.ForEachKeyword, openParenToken, this.Type, this.Identifier, this.InKeyword, this.Expression, this.CloseParenToken, this.
Statement
);
7805
public ForEachStatementSyntax WithType(TypeSyntax type) => Update(this.AttributeLists, this.AwaitKeyword, this.ForEachKeyword, this.OpenParenToken, type, this.Identifier, this.InKeyword, this.Expression, this.CloseParenToken, this.
Statement
);
7806
public ForEachStatementSyntax WithIdentifier(SyntaxToken identifier) => Update(this.AttributeLists, this.AwaitKeyword, this.ForEachKeyword, this.OpenParenToken, this.Type, identifier, this.InKeyword, this.Expression, this.CloseParenToken, this.
Statement
);
7808
public new ForEachStatementSyntax WithInKeyword(SyntaxToken inKeyword) => Update(this.AttributeLists, this.AwaitKeyword, this.ForEachKeyword, this.OpenParenToken, this.Type, this.Identifier, inKeyword, this.Expression, this.CloseParenToken, this.
Statement
);
7810
public new ForEachStatementSyntax WithExpression(ExpressionSyntax expression) => Update(this.AttributeLists, this.AwaitKeyword, this.ForEachKeyword, this.OpenParenToken, this.Type, this.Identifier, this.InKeyword, expression, this.CloseParenToken, this.
Statement
);
7812
public new ForEachStatementSyntax WithCloseParenToken(SyntaxToken closeParenToken) => Update(this.AttributeLists, this.AwaitKeyword, this.ForEachKeyword, this.OpenParenToken, this.Type, this.Identifier, this.InKeyword, this.Expression, closeParenToken, this.
Statement
);
Microsoft.CodeAnalysis.CSharp.CodeStyle (1)
src\Analyzers\CSharp\Analyzers\UseCollectionInitializer\CSharpUpdateExpressionSyntaxHelper.cs (1)
26
statements = ExtractEmbeddedStatements(foreachStatement.
Statement
);
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (1)
src\Analyzers\CSharp\CodeFixes\UseDeconstruction\CSharpUseDeconstructionCodeFixProvider.cs (1)
128
forEachStatement.
Statement
);
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (1)
FlowAnalysis\RegionAnalysisTests.cs (1)
7909
var stmt = tree.GetCompilationUnitRoot().DescendantNodesAndSelf().OfType<ForEachStatementSyntax>().Single().
Statement
;
Microsoft.CodeAnalysis.CSharp.Features (18)
ConvertForEachToFor\CSharpConvertForEachToForCodeRefactoringProvider.cs (7)
54
=> (foreachStatement.
Statement
, foreachStatement.
Statement
);
78
var indexVariable = CreateUniqueName(foreachInfo.SemanticFacts, model, foreachStatement.
Statement
, "i", cancellationToken);
120
if (foreachStatement.
Statement
is EmptyStatementSyntax)
122
return foreachStatement.
Statement
;
131
var bodyBlock = foreachStatement.
Statement
is BlockSyntax block ? block : Block(foreachStatement.
Statement
);
ConvertLinq\ConvertForEachToLinqQuery\CSharpConvertForEachToLinqQueryProvider.cs (2)
49
var current = forEachStatement.
Statement
;
105
current = currentForEachStatement.
Statement
;
ConvertLinq\CSharpConvertLinqQueryToForEachProvider.cs (4)
631
location: forEachStatement.
Statement
,
632
container: forEachStatement.
Statement
,
700
forEachStatement.
Statement
).WithAdditionalAnnotations(Formatter.Annotation), queryExpressionProcessingInfo);
722
expression => forEachStatement.
Statement
.WithAdditionalAnnotations(Formatter.Annotation),
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.CallSiteContainerRewriter.cs (1)
220
.WithStatement(ReplaceStatementIfNeeded(node.
Statement
));
Snippets\CSharpForEachLoopSnippetProvider.cs (2)
126
static s => (BlockSyntax)s.
Statement
,
133
static s => (BlockSyntax)s.
Statement
,
src\Analyzers\CSharp\Analyzers\UseCollectionInitializer\CSharpUpdateExpressionSyntaxHelper.cs (1)
26
statements = ExtractEmbeddedStatements(foreachStatement.
Statement
);
src\Analyzers\CSharp\CodeFixes\UseDeconstruction\CSharpUseDeconstructionCodeFixProvider.cs (1)
128
forEachStatement.
Statement
);
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (6)
Generated\Syntax.Test.xml.Generated.cs (2)
12670
Assert.NotNull(node.
Statement
);
12671
var newNode = node.WithAttributeLists(node.AttributeLists).WithAwaitKeyword(node.AwaitKeyword).WithForEachKeyword(node.ForEachKeyword).WithOpenParenToken(node.OpenParenToken).WithType(node.Type).WithIdentifier(node.Identifier).WithInKeyword(node.InKeyword).WithExpression(node.Expression).WithCloseParenToken(node.CloseParenToken).WithStatement(node.
Statement
);
Parsing\StatementParsingTests.cs (4)
1944
Assert.NotNull(fs.
Statement
);
1977
Assert.NotNull(fs.
Statement
);
2008
Assert.NotNull(fs.
Statement
);
3392
Assert.NotNull(fs.
Statement
);
Microsoft.CodeAnalysis.CSharp.Workspaces (1)
Rename\LocalConflictVisitor.cs (1)
66
Visit(node.
Statement
);