1 instantiation of ForEachVariableStatementSyntax
Microsoft.CodeAnalysis.CSharp (1)
_generated\1\Syntax.xml.Internal.Generated.cs (1)
12936
internal override SyntaxNode CreateRed(SyntaxNode? parent, int position) => new CSharp.Syntax.
ForEachVariableStatementSyntax
(this, parent, position);
92 references to ForEachVariableStatementSyntax
Microsoft.CodeAnalysis.CSharp (44)
_generated\0\Syntax.xml.Main.Generated.cs (7)
417
public virtual TResult? VisitForEachVariableStatement(
ForEachVariableStatementSyntax
node) => this.DefaultVisit(node);
1173
public virtual void VisitForEachVariableStatement(
ForEachVariableStatementSyntax
node) => this.DefaultVisit(node);
1928
public override SyntaxNode? VisitForEachVariableStatement(
ForEachVariableStatementSyntax
node)
4458
public static
ForEachVariableStatementSyntax
ForEachVariableStatement(SyntaxList<AttributeListSyntax> attributeLists, SyntaxToken awaitKeyword, SyntaxToken forEachKeyword, SyntaxToken openParenToken, ExpressionSyntax variable, SyntaxToken inKeyword, ExpressionSyntax expression, SyntaxToken closeParenToken, StatementSyntax statement)
4473
return (
ForEachVariableStatementSyntax
)Syntax.InternalSyntax.SyntaxFactory.ForEachVariableStatement(attributeLists.Node.ToGreenList<Syntax.InternalSyntax.AttributeListSyntax>(), (Syntax.InternalSyntax.SyntaxToken?)awaitKeyword.Node, (Syntax.InternalSyntax.SyntaxToken)forEachKeyword.Node!, (Syntax.InternalSyntax.SyntaxToken)openParenToken.Node!, (Syntax.InternalSyntax.ExpressionSyntax)variable.Green, (Syntax.InternalSyntax.SyntaxToken)inKeyword.Node!, (Syntax.InternalSyntax.ExpressionSyntax)expression.Green, (Syntax.InternalSyntax.SyntaxToken)closeParenToken.Node!, (Syntax.InternalSyntax.StatementSyntax)statement.Green).CreateRed();
4477
public static
ForEachVariableStatementSyntax
ForEachVariableStatement(SyntaxList<AttributeListSyntax> attributeLists, ExpressionSyntax variable, ExpressionSyntax expression, StatementSyntax statement)
4481
public static
ForEachVariableStatementSyntax
ForEachVariableStatement(ExpressionSyntax variable, ExpressionSyntax expression, StatementSyntax statement)
_generated\2\Syntax.xml.Syntax.Generated.cs (12)
8032
public
ForEachVariableStatementSyntax
Update(SyntaxList<AttributeListSyntax> attributeLists, SyntaxToken awaitKeyword, SyntaxToken forEachKeyword, SyntaxToken openParenToken, ExpressionSyntax variable, SyntaxToken inKeyword, ExpressionSyntax expression, SyntaxToken closeParenToken, StatementSyntax statement)
8036
var
newNode = SyntaxFactory.ForEachVariableStatement(attributeLists, awaitKeyword, forEachKeyword, openParenToken, variable, inKeyword, expression, closeParenToken, statement);
8045
public new
ForEachVariableStatementSyntax
WithAttributeLists(SyntaxList<AttributeListSyntax> attributeLists) => Update(attributeLists, this.AwaitKeyword, this.ForEachKeyword, this.OpenParenToken, this.Variable, this.InKeyword, this.Expression, this.CloseParenToken, this.Statement);
8047
public new
ForEachVariableStatementSyntax
WithAwaitKeyword(SyntaxToken awaitKeyword) => Update(this.AttributeLists, awaitKeyword, this.ForEachKeyword, this.OpenParenToken, this.Variable, this.InKeyword, this.Expression, this.CloseParenToken, this.Statement);
8049
public new
ForEachVariableStatementSyntax
WithForEachKeyword(SyntaxToken forEachKeyword) => Update(this.AttributeLists, this.AwaitKeyword, forEachKeyword, this.OpenParenToken, this.Variable, this.InKeyword, this.Expression, this.CloseParenToken, this.Statement);
8051
public new
ForEachVariableStatementSyntax
WithOpenParenToken(SyntaxToken openParenToken) => Update(this.AttributeLists, this.AwaitKeyword, this.ForEachKeyword, openParenToken, this.Variable, this.InKeyword, this.Expression, this.CloseParenToken, this.Statement);
8052
public
ForEachVariableStatementSyntax
WithVariable(ExpressionSyntax variable) => Update(this.AttributeLists, this.AwaitKeyword, this.ForEachKeyword, this.OpenParenToken, variable, this.InKeyword, this.Expression, this.CloseParenToken, this.Statement);
8054
public new
ForEachVariableStatementSyntax
WithInKeyword(SyntaxToken inKeyword) => Update(this.AttributeLists, this.AwaitKeyword, this.ForEachKeyword, this.OpenParenToken, this.Variable, inKeyword, this.Expression, this.CloseParenToken, this.Statement);
8056
public new
ForEachVariableStatementSyntax
WithExpression(ExpressionSyntax expression) => Update(this.AttributeLists, this.AwaitKeyword, this.ForEachKeyword, this.OpenParenToken, this.Variable, this.InKeyword, expression, this.CloseParenToken, this.Statement);
8058
public new
ForEachVariableStatementSyntax
WithCloseParenToken(SyntaxToken closeParenToken) => Update(this.AttributeLists, this.AwaitKeyword, this.ForEachKeyword, this.OpenParenToken, this.Variable, this.InKeyword, this.Expression, closeParenToken, this.Statement);
8060
public new
ForEachVariableStatementSyntax
WithStatement(StatementSyntax statement) => Update(this.AttributeLists, this.AwaitKeyword, this.ForEachKeyword, this.OpenParenToken, this.Variable, this.InKeyword, this.Expression, this.CloseParenToken, statement);
8063
public new
ForEachVariableStatementSyntax
AddAttributeLists(params AttributeListSyntax[] items) => WithAttributeLists(this.AttributeLists.AddRange(items));
Binder\ForEachLoopBinder.cs (5)
76
var
syntax = (
ForEachVariableStatementSyntax
)_syntax;
197
ExpressionSyntax variables = ((
ForEachVariableStatementSyntax
)_syntax).Variable;
379
var
node = (
ForEachVariableStatementSyntax
)_syntax;
Binder\LocalBinderFactory.cs (2)
658
if (node is
ForEachVariableStatementSyntax
forEachVariable && !forEachVariable.Variable.IsDeconstructionLeft())
672
public override void VisitForEachVariableStatement(
ForEachVariableStatementSyntax
node)
Compilation\CSharpSemanticModel.cs (1)
4853
public abstract DeconstructionInfo GetDeconstructionInfo(
ForEachVariableStatementSyntax
node);
Compilation\MemberSemanticModel.cs (1)
1061
public override DeconstructionInfo GetDeconstructionInfo(
ForEachVariableStatementSyntax
node)
Compilation\SpeculativeSemanticModelWithMemberModel.cs (1)
425
public override DeconstructionInfo GetDeconstructionInfo(
ForEachVariableStatementSyntax
node)
Compilation\SyntaxTreeSemanticModel.cs (1)
2444
public override DeconstructionInfo GetDeconstructionInfo(
ForEachVariableStatementSyntax
node)
CSharpExtensions.cs (1)
922
public static DeconstructionInfo GetDeconstructionInfo(this SemanticModel? semanticModel,
ForEachVariableStatementSyntax
@foreach)
FlowAnalysis\NullableWalker.cs (1)
12644
ForEachVariableStatementSyntax
variableStatement => variableStatement.Variable.GetLocation(),
Lowering\Instrumentation\DebugInfoInjector.cs (4)
278
var
forEachSyntax = (
ForEachVariableStatementSyntax
)original.Syntax;
324
var
forEachSyntax = (
ForEachVariableStatementSyntax
)original.Syntax;
Lowering\LocalRewriter\LocalRewriter_ForEachStatement.cs (1)
1287
if (forEachSyntax is
ForEachVariableStatementSyntax
)
Symbols\LocalDeclarationKind.cs (1)
48
/// User defined local variable declared by <see cref="ForEachStatementSyntax"/> or <see cref="
ForEachVariableStatementSyntax
"/>.
Symbols\Source\SourceLocalSymbol.cs (1)
785
Debug.Assert(this.ScopeBinder.GetBinder((
ForEachVariableStatementSyntax
)_deconstruction) == _nodeBinder);
Syntax\ForEachVariableStatementSyntax.cs (4)
11
public
ForEachVariableStatementSyntax
Update(SyntaxToken forEachKeyword, SyntaxToken openParenToken, ExpressionSyntax variable, SyntaxToken inKeyword, ExpressionSyntax expression, SyntaxToken closeParenToken, StatementSyntax statement)
14
public
ForEachVariableStatementSyntax
Update(SyntaxToken awaitKeyword, SyntaxToken forEachKeyword, SyntaxToken openParenToken, ExpressionSyntax variable, SyntaxToken inKeyword, ExpressionSyntax expression, SyntaxToken closeParenToken, StatementSyntax statement)
23
public static
ForEachVariableStatementSyntax
ForEachVariableStatement(SyntaxToken forEachKeyword, SyntaxToken openParenToken, ExpressionSyntax variable, SyntaxToken inKeyword, ExpressionSyntax expression, SyntaxToken closeParenToken, StatementSyntax statement)
26
public static
ForEachVariableStatementSyntax
ForEachVariableStatement(SyntaxToken awaitKeyword, SyntaxToken forEachKeyword, SyntaxToken openParenToken, ExpressionSyntax variable, SyntaxToken inKeyword, ExpressionSyntax expression, SyntaxToken closeParenToken, StatementSyntax statement)
Syntax\SyntaxExtensions.cs (1)
373
if ((object)((
ForEachVariableStatementSyntax
)parent).Variable == expr)
Microsoft.CodeAnalysis.CSharp.CodeStyle (9)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ExpressionSyntaxExtensions.cs (1)
306
if (((
ForEachVariableStatementSyntax
)parent).Variable == expr)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.cs (1)
832
(current is
ForEachVariableStatementSyntax
@foreach && previous == @foreach.Variable))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SemanticFacts\CSharpSemanticFacts.cs (2)
220
if (node is
ForEachVariableStatementSyntax
@foreach)
287
ForEachVariableStatementSyntax
_ when token.Kind() == SyntaxKind.InKeyword => GetDeconstructionForEachMethods(semanticModel, node).As<ISymbol>(),
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (2)
219
=> node is
ForEachVariableStatementSyntax
;
232
ForEachVariableStatementSyntax
@foreach => @foreach.Variable.GetLocation(),
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (2)
658
ForEachVariableStatementSyntax
{ Variable: DeclarationExpressionSyntax declarationExpression } => declarationExpression.Type.IsTypeInferred(semanticModel),
900
else if (forEach is
ForEachVariableStatementSyntax
{ Variable: DeclarationExpressionSyntax declarationExpression })
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpTypeStyleHelper.cs (1)
109
case
ForEachVariableStatementSyntax
forEachVariableStatement:
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (3)
src\roslyn\src\Analyzers\CSharp\CodeFixes\GenerateMethod\GenerateDeconstructMethodCodeFixProvider.cs (1)
61
case
ForEachVariableStatementSyntax
@foreach:
src\roslyn\src\Analyzers\CSharp\CodeFixes\MakeStatementAsynchronous\CSharpMakeStatementAsynchronousCodeFixProvider.cs (1)
72
case
ForEachVariableStatementSyntax
forEachDeconstruction:
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseDeconstruction\CSharpUseDeconstructionCodeFixProvider.cs (1)
113
private
ForEachVariableStatementSyntax
CreateForEachVariableStatement(INamedTypeSymbol tupleType, ForEachStatementSyntax forEachStatement)
Microsoft.CodeAnalysis.CSharp.Features (15)
Completion\CompletionProviders\DeclarationName\DeclarationNameInfo.cs (1)
486
f is
ForEachVariableStatementSyntax
forEachVariableStatement ? forEachVariableStatement.Variable :
Completion\KeywordRecommenders\InKeywordRecommender.cs (2)
68
var
statement = token.GetAncestor<
ForEachVariableStatementSyntax
>();
Debugging\CSharpProximityExpressionsService.RelevantExpressionsCollector.cs (1)
68
public override void VisitForEachVariableStatement(
ForEachVariableStatementSyntax
node)
EditAndContinue\BreakpointSpans.cs (1)
682
return ((
ForEachVariableStatementSyntax
)statement).Variable.Span;
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (4)
333
private static TextSpan GetActiveSpan(
ForEachVariableStatementSyntax
node, ForEachPart part)
598
span = GetActiveSpan((
ForEachVariableStatementSyntax
)node, (ForEachPart)statementPart);
883
case SyntaxKind.ForEachVariableStatement: return AreEquivalentIgnoringLambdaBodies(((
ForEachVariableStatementSyntax
)oldNode).Variable, ((
ForEachVariableStatementSyntax
)newNode).Variable);
EditAndContinue\SyntaxComparer.cs (2)
1318
var
forEachVariable = (
ForEachVariableStatementSyntax
)commonForEach;
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.CallSiteContainerRewriter.cs (1)
223
public override SyntaxNode VisitForEachVariableStatement(
ForEachVariableStatementSyntax
node)
src\roslyn\src\Analyzers\CSharp\CodeFixes\GenerateMethod\GenerateDeconstructMethodCodeFixProvider.cs (1)
61
case
ForEachVariableStatementSyntax
@foreach:
src\roslyn\src\Analyzers\CSharp\CodeFixes\MakeStatementAsynchronous\CSharpMakeStatementAsynchronousCodeFixProvider.cs (1)
72
case
ForEachVariableStatementSyntax
forEachDeconstruction:
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseDeconstruction\CSharpUseDeconstructionCodeFixProvider.cs (1)
113
private
ForEachVariableStatementSyntax
CreateForEachVariableStatement(INamedTypeSymbol tupleType, ForEachStatementSyntax forEachStatement)
Microsoft.CodeAnalysis.CSharp.NetAnalyzers (1)
Microsoft.NetCore.Analyzers\Runtime\CSharpAvoidRedundantRegexIsMatchBeforeMatch.Fixer.cs (1)
530
if (descendant is
ForEachVariableStatementSyntax
forEachVariable &&
Microsoft.CodeAnalysis.CSharp.Workspaces (11)
ReassignedVariable\CSharpReassignedVariableService.cs (1)
52
if (current is
ForEachVariableStatementSyntax
)
Recommendations\CSharpRecommendationServiceRunner.cs (1)
330
return statement is ForStatementSyntax or ForEachStatementSyntax or
ForEachVariableStatementSyntax
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ExpressionSyntaxExtensions.cs (1)
306
if (((
ForEachVariableStatementSyntax
)parent).Variable == expr)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.cs (1)
832
(current is
ForEachVariableStatementSyntax
@foreach && previous == @foreach.Variable))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SemanticFacts\CSharpSemanticFacts.cs (2)
220
if (node is
ForEachVariableStatementSyntax
@foreach)
287
ForEachVariableStatementSyntax
_ when token.Kind() == SyntaxKind.InKeyword => GetDeconstructionForEachMethods(semanticModel, node).As<ISymbol>(),
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (2)
219
=> node is
ForEachVariableStatementSyntax
;
232
ForEachVariableStatementSyntax
@foreach => @foreach.Variable.GetLocation(),
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (2)
658
ForEachVariableStatementSyntax
{ Variable: DeclarationExpressionSyntax declarationExpression } => declarationExpression.Type.IsTypeInferred(semanticModel),
900
else if (forEach is
ForEachVariableStatementSyntax
{ Variable: DeclarationExpressionSyntax declarationExpression })
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpTypeStyleHelper.cs (1)
109
case
ForEachVariableStatementSyntax
forEachVariableStatement:
Roslyn.Diagnostics.CSharp.Analyzers (9)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ExpressionSyntaxExtensions.cs (1)
306
if (((
ForEachVariableStatementSyntax
)parent).Variable == expr)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.cs (1)
832
(current is
ForEachVariableStatementSyntax
@foreach && previous == @foreach.Variable))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SemanticFacts\CSharpSemanticFacts.cs (2)
220
if (node is
ForEachVariableStatementSyntax
@foreach)
287
ForEachVariableStatementSyntax
_ when token.Kind() == SyntaxKind.InKeyword => GetDeconstructionForEachMethods(semanticModel, node).As<ISymbol>(),
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (2)
219
=> node is
ForEachVariableStatementSyntax
;
232
ForEachVariableStatementSyntax
@foreach => @foreach.Variable.GetLocation(),
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (2)
658
ForEachVariableStatementSyntax
{ Variable: DeclarationExpressionSyntax declarationExpression } => declarationExpression.Type.IsTypeInferred(semanticModel),
900
else if (forEach is
ForEachVariableStatementSyntax
{ Variable: DeclarationExpressionSyntax declarationExpression })
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpTypeStyleHelper.cs (1)
109
case
ForEachVariableStatementSyntax
forEachVariableStatement: