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