1 implementation of IForEachLoopOperation
Microsoft.CodeAnalysis (1)
Generated\Operations.Generated.cs (1)
4197internal sealed partial class ForEachLoopOperation : BaseLoopOperation, IForEachLoopOperation
30 references to IForEachLoopOperation
Microsoft.CodeAnalysis (5)
Generated\Operations.Generated.cs (3)
10811public override IOperation VisitForEachLoop(IForEachLoopOperation operation, object? argument) 11419public virtual void VisitForEachLoop(IForEachLoopOperation operation) => DefaultVisit(operation); 11558public virtual TResult? VisitForEachLoop(IForEachLoopOperation operation, TArgument argument) => DefaultVisit(operation, argument);
Operations\ControlFlowGraphBuilder.cs (1)
4453public override IOperation? VisitForEachLoop(IForEachLoopOperation operation, int? captureIdForResult)
Operations\Loops\LoopKind.cs (1)
33/// Indicates an <see cref="IForEachLoopOperation"/> in C# or VB.
Microsoft.CodeAnalysis.CodeStyle (3)
src\Analyzers\Core\Analyzers\ForEachCast\AbstractForEachCastDiagnosticAnalyzer.cs (1)
64if (semanticModel.GetOperation(node, cancellationToken) is not IForEachLoopOperation loopOperation)
src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (1)
413if (operation is not IForEachLoopOperation loopOperation)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.Walker.cs (1)
272operation.Parent is IForEachLoopOperation forEachLoop && forEachLoop.LoopControlVariable == operation ||
Microsoft.CodeAnalysis.CodeStyle.Fixes (4)
src\Analyzers\Core\CodeFixes\ForEachCast\AbstractForEachCastCodeFixProvider.cs (2)
65var loopOperation = (IForEachLoopOperation)semanticModel.GetRequiredOperation(forEachStatement, cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\NullableHelpers.cs (2)
97if (operation is IForEachLoopOperation forEachLoop) 149IForEachLoopOperation { LoopControlVariable: IVariableDeclaratorOperation variableDeclarator } => variableDeclarator.Symbol.Equals(symbol),
Microsoft.CodeAnalysis.CSharp (1)
Operations\CSharpOperationFactory.cs (1)
1973private IForEachLoopOperation CreateBoundForEachStatementOperation(BoundForEachStatement boundForEachStatement)
Microsoft.CodeAnalysis.CSharp.Features (1)
ConvertForEachToFor\CSharpConvertForEachToForCodeRefactoringProvider.cs (1)
152protected override bool IsSupported(ILocalSymbol foreachVariable, IForEachLoopOperation forEachOperation, ForEachStatementSyntax foreachStatement)
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (2)
IOperation\IOperationTests.cs (2)
379var op = (IForEachLoopOperation)comp.GetSemanticModel(tree).GetOperation(tree.GetRoot().DescendantNodes().OfType<ForEachStatementSyntax>().Single());
Microsoft.CodeAnalysis.Features (6)
ConvertForEachToFor\AbstractConvertForEachToForCodeRefactoringProvider.cs (2)
54protected abstract bool IsSupported(ILocalSymbol foreachVariable, IForEachLoopOperation forEachOperation, TForEachStatement foreachStatement); 153if (model.GetOperation(foreachStatement, cancellationToken) is not IForEachLoopOperation operation || operation.Locals.Length != 1)
src\Analyzers\Core\Analyzers\ForEachCast\AbstractForEachCastDiagnosticAnalyzer.cs (1)
64if (semanticModel.GetOperation(node, cancellationToken) is not IForEachLoopOperation loopOperation)
src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (1)
413if (operation is not IForEachLoopOperation loopOperation)
src\Analyzers\Core\CodeFixes\ForEachCast\AbstractForEachCastCodeFixProvider.cs (2)
65var loopOperation = (IForEachLoopOperation)semanticModel.GetRequiredOperation(forEachStatement, cancellationToken);
Microsoft.CodeAnalysis.Test.Utilities (4)
Compilation\OperationTreeVerifier.cs (3)
631if (operation is IForEachLoopOperation { IsAsynchronous: true }) 648public override void VisitForEachLoop(IForEachLoopOperation operation) 650LogString(nameof(IForEachLoopOperation));
Compilation\TestOperationVisitor.cs (1)
329public override void VisitForEachLoop(IForEachLoopOperation operation)
Microsoft.CodeAnalysis.VisualBasic.Features (1)
ConvertForEachToFor\VisualBasicConvertForEachToForCodeRefactoringProvider.vb (1)
167Protected Overrides Function IsSupported(foreachVariable As ILocalSymbol, foreachOperation As IForEachLoopOperation, foreachStatement As ForEachBlockSyntax) As Boolean
Microsoft.CodeAnalysis.Workspaces (3)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.Walker.cs (1)
272operation.Parent is IForEachLoopOperation forEachLoop && forEachLoop.LoopControlVariable == operation ||
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Utilities\NullableHelpers.cs (2)
97if (operation is IForEachLoopOperation forEachLoop) 149IForEachLoopOperation { LoopControlVariable: IVariableDeclaratorOperation variableDeclarator } => variableDeclarator.Symbol.Equals(symbol),