Base:
property
Expression
Microsoft.CodeAnalysis.CSharp.Syntax.CommonForEachStatementSyntax.Expression
65 references to Expression
Microsoft.CodeAnalysis.CSharp (13)
Binder\ForEachLoopBinder.cs (1)
93
syntax.
Expression
);
FlowAnalysis\NullableWalker.cs (1)
7320
ForEachStatementSyntax {
Expression
: var expression } => expression,
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);
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 (5)
src\Analyzers\CSharp\Analyzers\UseCollectionInitializer\CSharpUpdateExpressionSyntaxHelper.cs (1)
25
expression = foreachStatement.
Expression
;
src\Analyzers\CSharp\Analyzers\UseCollectionInitializer\CSharpUseCollectionInitializerAnalyzer.cs (1)
114
spreadElements.Add(foreachStatement.
Expression
);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SemanticModelExtensions.cs (1)
382
foreachStatement.
Expression
== expression)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (1)
1288
=> node?.Parent is ForEachStatementSyntax foreachStatement && foreachStatement.
Expression
== node;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseExplicitTypeHelper.cs (1)
107
foreachStatement.Identifier, typeName, foreachStatement.
Expression
,
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (5)
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpCollectionExpressionRewriter.cs (2)
498
IndentExpression(foreachStatement, foreachStatement.
Expression
, preferredIndentation));
778
yield return foreachStatement.
Expression
;
src\Analyzers\CSharp\CodeFixes\UseDeconstruction\CSharpUseDeconstructionCodeFixProvider.cs (1)
126
forEachStatement.
Expression
,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (1)
1655
if (@foreach.
Expression
== outer &&
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (1)
1253
if (expressionOpt != null && expressionOpt != forEachStatementSyntax.
Expression
)
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (7)
RefStructInterfacesTests.cs (4)
7986
Assert.Equal("new S()", foreachSyntax.
Expression
.ToString());
11068
Assert.Equal("new S1()", foreachSyntax.
Expression
.ToString());
15365
AssertEx.Equal("new S()", foreachSyntax.
Expression
.ToString());
18582
AssertEx.Equal("new S()", foreachSyntax.
Expression
.ToString());
Semantics\InlineArrayTests.cs (3)
18589
var f = tree.GetRoot().DescendantNodes().OfType<ForEachStatementSyntax>().Single().
Expression
;
18915
var f = tree.GetRoot().DescendantNodes().OfType<ForEachStatementSyntax>().Single().
Expression
;
19252
var collection = tree.GetRoot().DescendantNodes().OfType<ForEachStatementSyntax>().Single().
Expression
;
Microsoft.CodeAnalysis.CSharp.Features (15)
ConvertForEachToFor\CSharpConvertForEachToForCodeRefactoringProvider.cs (1)
64
var foreachCollectionExpression = foreachStatement.
Expression
;
ConvertLinq\ConvertForEachToLinqQuery\AbstractConverter.cs (3)
113
expression: forEachStatement.
Expression
)
133
receiverForInvocation: foreachStatement.
Expression
,
253
receiverForInvocation: foreachStatement.
Expression
,
ConvertLinq\CSharpConvertLinqQueryToForEachProvider.cs (1)
617
if (forEachStatement.
Expression
.WalkDownParentheses() != _source)
Debugging\CSharpProximityExpressionsService.RelevantExpressionsCollector.cs (1)
65
AddExpressionTerms(node.
Expression
, _expressions);
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (1)
329
ForEachPart.Expression => node.
Expression
.Span,
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.CallSiteContainerRewriter.cs (1)
219
return node.WithExpression(VisitNode(node.
Expression
))
Snippets\CSharpForEachLoopSnippetProvider.cs (2)
118
arrayBuilder.Add(new SnippetPlaceholder(node.
Expression
.ToString(), node.
Expression
.SpanStart));
src\Analyzers\CSharp\Analyzers\UseCollectionInitializer\CSharpUpdateExpressionSyntaxHelper.cs (1)
25
expression = foreachStatement.
Expression
;
src\Analyzers\CSharp\Analyzers\UseCollectionInitializer\CSharpUseCollectionInitializerAnalyzer.cs (1)
114
spreadElements.Add(foreachStatement.
Expression
);
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpCollectionExpressionRewriter.cs (2)
498
IndentExpression(foreachStatement, foreachStatement.
Expression
, preferredIndentation));
778
yield return foreachStatement.
Expression
;
src\Analyzers\CSharp\CodeFixes\UseDeconstruction\CSharpUseDeconstructionCodeFixProvider.cs (1)
126
forEachStatement.
Expression
,
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (10)
Generated\Syntax.Test.xml.Generated.cs (2)
12668
Assert.NotNull(node.
Expression
);
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 (8)
1941
Assert.NotNull(fs.
Expression
);
1942
Assert.Equal("b", fs.
Expression
.ToString());
1974
Assert.NotNull(fs.
Expression
);
1975
Assert.Equal("b", fs.
Expression
.ToString());
2005
Assert.NotNull(fs.
Expression
);
2006
Assert.Equal("b", fs.
Expression
.ToString());
3389
Assert.NotNull(fs.
Expression
);
3390
Assert.Equal("b", fs.
Expression
.ToString());
Microsoft.CodeAnalysis.CSharp.Workspaces (5)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SemanticModelExtensions.cs (1)
382
foreachStatement.
Expression
== expression)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (1)
1288
=> node?.Parent is ForEachStatementSyntax foreachStatement && foreachStatement.
Expression
== node;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseExplicitTypeHelper.cs (1)
107
foreachStatement.Identifier, typeName, foreachStatement.
Expression
,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (1)
1655
if (@foreach.
Expression
== outer &&
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (1)
1253
if (expressionOpt != null && expressionOpt != forEachStatementSyntax.
Expression
)
Roslyn.Diagnostics.CSharp.Analyzers (5)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SemanticModelExtensions.cs (1)
382
foreachStatement.
Expression
== expression)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (1)
1288
=> node?.Parent is ForEachStatementSyntax foreachStatement && foreachStatement.
Expression
== node;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseExplicitTypeHelper.cs (1)
107
foreachStatement.Identifier, typeName, foreachStatement.
Expression
,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (1)
1655
if (@foreach.
Expression
== outer &&
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (1)
1253
if (expressionOpt != null && expressionOpt != forEachStatementSyntax.
Expression
)