Base:
property
ForEachKeyword
Microsoft.CodeAnalysis.CSharp.Syntax.CommonForEachStatementSyntax.ForEachKeyword
34 references to ForEachKeyword
Microsoft.CodeAnalysis.CSharp (12)
Binder\Binder.cs (1)
735
node = foreachSyntax.
ForEachKeyword
;
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);
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);
7814
public new ForEachStatementSyntax WithStatement(StatementSyntax statement) => Update(this.AttributeLists, this.AwaitKeyword, this.
ForEachKeyword
, this.OpenParenToken, this.Type, this.Identifier, this.InKeyword, this.Expression, this.CloseParenToken, statement);
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (2)
src\Analyzers\CSharp\CodeFixes\MakeStatementAsynchronous\CSharpMakeStatementAsynchronousCodeFixProvider.cs (1)
71
.WithForEachKeyword(forEach.
ForEachKeyword
.WithLeadingTrivia())
src\Analyzers\CSharp\CodeFixes\UseDeconstruction\CSharpUseDeconstructionCodeFixProvider.cs (1)
122
forEachStatement.
ForEachKeyword
,
Microsoft.CodeAnalysis.CSharp.Features (6)
ConvertLinq\ConvertForEachToLinqQuery\AbstractConverter.cs (3)
102
forEachStatement.
ForEachKeyword
.LeadingTrivia,
103
forEachStatement.
ForEachKeyword
.TrailingTrivia,
149
leadingCommentsTrivia = forEachStatement.
ForEachKeyword
.GetAllTrivia().Concat(leadingCommentsTrivia);
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (1)
326
ForEachPart.ForEach => node.
ForEachKeyword
.Span,
src\Analyzers\CSharp\CodeFixes\MakeStatementAsynchronous\CSharpMakeStatementAsynchronousCodeFixProvider.cs (1)
71
.WithForEachKeyword(forEach.
ForEachKeyword
.WithLeadingTrivia())
src\Analyzers\CSharp\CodeFixes\UseDeconstruction\CSharpUseDeconstructionCodeFixProvider.cs (1)
122
forEachStatement.
ForEachKeyword
,
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (14)
Generated\Syntax.Test.xml.Generated.cs (2)
12663
Assert.Equal(SyntaxKind.ForEachKeyword, node.
ForEachKeyword
.Kind());
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 (12)
1930
Assert.NotEqual(default, fs.
ForEachKeyword
);
1931
Assert.Equal(SyntaxKind.ForEachKeyword, fs.
ForEachKeyword
.Kind());
1959
Assert.NotEqual(default, fs.
ForEachKeyword
);
1960
Assert.Equal(SyntaxKind.ForEachKeyword, fs.
ForEachKeyword
.Kind());
1961
Assert.True(fs.
ForEachKeyword
.IsMissing);
1962
Assert.Equal(1, fs.
ForEachKeyword
.TrailingTrivia.Count);
1963
Assert.Equal(SyntaxKind.SkippedTokensTrivia, fs.
ForEachKeyword
.TrailingTrivia[0].Kind());
1964
Assert.Equal("for", fs.
ForEachKeyword
.TrailingTrivia[0].ToString());
1992
Assert.NotEqual(default, fs.
ForEachKeyword
);
1993
Assert.Equal(SyntaxKind.ForEachKeyword, fs.
ForEachKeyword
.Kind());
3378
Assert.NotEqual(default, fs.
ForEachKeyword
);
3379
Assert.Equal(SyntaxKind.ForEachKeyword, fs.
ForEachKeyword
.Kind());