1 implementation of Operations
Microsoft.CodeAnalysis (1)
Generated\Operations.Generated.cs (1)
4007public ImmutableArray<IOperation> Operations { get; }
81 references to Operations
Microsoft.AspNetCore.Mvc.Api.Analyzers (2)
ApiActionsDoNotRequireExplicitModelValidationCheckAnalyzer.cs (2)
215return statement is IBlockOperation block && block.Operations.Length == 1 ? 216block.Operations[0] :
Microsoft.CodeAnalysis (1)
Operations\ControlFlowGraphBuilder.cs (1)
1387VisitStatements(operation.Operations);
Microsoft.CodeAnalysis.CodeStyle (15)
src\Analyzers\Core\Analyzers\Helpers\HashCodeAnalyzer\HashCodeAnalyzer.cs (2)
77while (blockOperation.Operations is [IBlockOperation childBlock]) 80var statements = blockOperation.Operations.WhereAsArray(o => !o.IsImplicit);
src\Analyzers\Core\Analyzers\UseConditionalExpression\ForReturn\UseConditionalExpressionForReturnHelpers.cs (3)
52var ifIndex = parentBlock.Operations.IndexOf(ifOperation); 56if (ifIndex + 1 >= parentBlock.Operations.Length) 59falseStatement = parentBlock.Operations[ifIndex + 1];
src\Analyzers\Core\Analyzers\UseConditionalExpression\UseConditionalExpressionHelpers.cs (1)
60=> statement is IBlockOperation { Operations: [var operationInBlock] }
src\Analyzers\Core\Analyzers\UseThrowExpression\AbstractUseThrowExpressionDiagnosticAnalyzer.cs (5)
141var statements = containingBlock.Operations; 172var ifOperationIndex = containingBlock.Operations.IndexOf(ifOperation); 176for (var i = ifOperationIndex + 1; i < containingBlock.Operations.Length; i++) 178expressionStatement = containingBlock.Operations[i] as IExpressionStatementOperation; 278if (block.Operations.Length != 1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\OperationExtensions.cs (4)
409if (block.Operations.Length == 0) 412var firstOp = block.Operations.Length == 1 413? block.Operations[0] 414: TryGetSingleExplicitStatement(block.Operations);
Microsoft.CodeAnalysis.CodeStyle.Fixes (5)
src\Analyzers\Core\CodeFixes\UseConditionalExpression\ForAssignment\AbstractUseConditionalExpressionForAssignmentCodeFixProvider.cs (2)
192var ifIndex = parentBlock.Operations.IndexOf(ifOperation); 198localDeclaration = parentBlock.Operations[ifIndex - 1] as IVariableDeclarationGroupOperation;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\InitializeParameter\AbstractInitializerParameterService.cs (2)
180var statementIndex = blockStatement!.Operations.IndexOf(statement); 181return statementIndex > 0 && blockStatement.Operations[statementIndex - 1] is { IsImplicit: false, Syntax: var priorSyntax }
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\InitializeParameter\InitializeParameterHelpersCore.cs (1)
85foreach (var statement in blockStatement.Operations)
Microsoft.CodeAnalysis.CSharp.CodeStyle (1)
src\Analyzers\CSharp\Analyzers\MakeStructMemberReadOnly\CSharpMakeStructMemberReadOnlyAnalyzer.cs (1)
152if (blockOperation is IBlockOperation { Operations: [IThrowOperation or IExpressionStatementOperation { Operation: IThrowOperation }] })
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (10)
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordHelpers.cs (9)
40Operations: [IReturnOperation 117Operations: [IReturnOperation { ReturnedValue: IOperation returnedValue }] 135Operations: [IReturnOperation 189if (GetBlockOfMethodBody(operation) is not { Operations.Length: int opLength } || 231if (GetBlockOfMethodBody(operation) is not { Operations.Length: int opLength } || 433foreach (var operation in body.Operations) 503var bodyOps = body.Operations; 1064var trueOps = ((whenTrue as IBlockOperation)?.Operations ?? [whenTrue]) 1066var falseOps = ((whenFalse as IBlockOperation)?.Operations ??
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\InitializeParameter\CSharpInitializeParameterService.cs (1)
102foreach (var operation in blockOperation.Operations)
Microsoft.CodeAnalysis.CSharp.Features (11)
ConvertIfToSwitch\CSharpConvertIfToSwitchCodeRefactoringProvider.Rewriting.cs (1)
65IBlockOperation op => AsExpressionSyntax(op.Operations.Single()),
src\Analyzers\CSharp\Analyzers\MakeStructMemberReadOnly\CSharpMakeStructMemberReadOnlyAnalyzer.cs (1)
152if (blockOperation is IBlockOperation { Operations: [IThrowOperation or IExpressionStatementOperation { Operation: IThrowOperation }] })
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordHelpers.cs (9)
40Operations: [IReturnOperation 117Operations: [IReturnOperation { ReturnedValue: IOperation returnedValue }] 135Operations: [IReturnOperation 189if (GetBlockOfMethodBody(operation) is not { Operations.Length: int opLength } || 231if (GetBlockOfMethodBody(operation) is not { Operations.Length: int opLength } || 433foreach (var operation in body.Operations) 503var bodyOps = body.Operations; 1064var trueOps = ((whenTrue as IBlockOperation)?.Operations ?? [whenTrue]) 1066var falseOps = ((whenFalse as IBlockOperation)?.Operations ??
Microsoft.CodeAnalysis.CSharp.Workspaces (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\InitializeParameter\CSharpInitializeParameterService.cs (1)
102foreach (var operation in blockOperation.Operations)
Microsoft.CodeAnalysis.Features (23)
ConvertIfToSwitch\AbstractConvertIfToSwitchCodeRefactoringProvider.Analyzer.cs (1)
184? ParseIfStatementSequence(block.Operations.AsSpan(), sections, topLevel: false, out defaultBodyOpt)
ConvertIfToSwitch\AbstractConvertIfToSwitchCodeRefactoringProvider.cs (2)
92var operations = parentBlock.Operations; 146case IBlockOperation { Operations: { Length: 1 } statements }:
InitializeParameter\AbstractAddParameterCheckCodeRefactoringProvider.cs (5)
277foreach (var statement in blockStatementOpt.Operations) 437var statementIndex = blockStatement.Operations.IndexOf(checkStatement); 438return statementIndex > 0 && blockStatement.Operations[statementIndex - 1] is { IsImplicit: false, Syntax: var priorSyntax } 461foreach (var statement in blockStatement.Operations) 510foreach (var statement in blockStatement.Operations)
InitializeParameter\AbstractInitializeMemberFromParameterCodeRefactoringProviderMemberCreation.cs (2)
579foreach (var statement in blockStatement.Operations) 672foreach (var statement in blockStatement.Operations)
src\Analyzers\Core\Analyzers\Helpers\HashCodeAnalyzer\HashCodeAnalyzer.cs (2)
77while (blockOperation.Operations is [IBlockOperation childBlock]) 80var statements = blockOperation.Operations.WhereAsArray(o => !o.IsImplicit);
src\Analyzers\Core\Analyzers\UseConditionalExpression\ForReturn\UseConditionalExpressionForReturnHelpers.cs (3)
52var ifIndex = parentBlock.Operations.IndexOf(ifOperation); 56if (ifIndex + 1 >= parentBlock.Operations.Length) 59falseStatement = parentBlock.Operations[ifIndex + 1];
src\Analyzers\Core\Analyzers\UseConditionalExpression\UseConditionalExpressionHelpers.cs (1)
60=> statement is IBlockOperation { Operations: [var operationInBlock] }
src\Analyzers\Core\Analyzers\UseThrowExpression\AbstractUseThrowExpressionDiagnosticAnalyzer.cs (5)
141var statements = containingBlock.Operations; 172var ifOperationIndex = containingBlock.Operations.IndexOf(ifOperation); 176for (var i = ifOperationIndex + 1; i < containingBlock.Operations.Length; i++) 178expressionStatement = containingBlock.Operations[i] as IExpressionStatementOperation; 278if (block.Operations.Length != 1)
src\Analyzers\Core\CodeFixes\UseConditionalExpression\ForAssignment\AbstractUseConditionalExpressionForAssignmentCodeFixProvider.cs (2)
192var ifIndex = parentBlock.Operations.IndexOf(ifOperation); 198localDeclaration = parentBlock.Operations[ifIndex - 1] as IVariableDeclarationGroupOperation;
Microsoft.CodeAnalysis.Test.Utilities (5)
Compilation\OperationTreeVerifier.cs (2)
444var statementsStr = $"{operation.Operations.Length} statements"; 449if (operation.Operations.IsEmpty)
Compilation\TestOperationVisitor.cs (1)
122AssertEx.Equal(operation.Operations, operation.ChildOperations);
Diagnostics\OperationTestAnalyzer.cs (2)
1321if (block.Operations.Length > 3) 1326foreach (var statement in block.Operations)
Microsoft.CodeAnalysis.Workspaces (7)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\OperationExtensions.cs (4)
409if (block.Operations.Length == 0) 412var firstOp = block.Operations.Length == 1 413? block.Operations[0] 414: TryGetSingleExplicitStatement(block.Operations);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\InitializeParameter\AbstractInitializerParameterService.cs (2)
180var statementIndex = blockStatement!.Operations.IndexOf(statement); 181return statementIndex > 0 && blockStatement.Operations[statementIndex - 1] is { IsImplicit: false, Syntax: var priorSyntax }
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\InitializeParameter\InitializeParameterHelpersCore.cs (1)
85foreach (var statement in blockStatement.Operations)