396 references to GetOperation
ConfigurationSchemaGenerator (1)
RuntimeSource\Configuration.Binder\Parser\BinderInvocation.cs (1)
28return context.SemanticModel.GetOperation(invocationSyntax, cancellationToken) is IInvocationOperation operation &&
Microsoft.Analyzers.Extra (4)
CallAnalysis\Fixers\LegacyLoggingFixer.cs (4)
41internal Func<SemanticModel, SyntaxNode, CancellationToken, IOperation?> GetOperation = (sm, sn, t) => sm.GetOperation(sn, t); 141var invocationOp = (invocationSM.GetOperation(invocationExpression, cancellationToken) as IInvocationOperation)!; 475var invocation = sm.GetOperation(invocationExpression, cancellationToken) as IInvocationOperation; 578var invocationOp = (invocationSM.GetOperation(invocationExpression, cancellationToken) as IInvocationOperation)!;
Microsoft.AspNetCore.Analyzers (1)
CompilationFeatureDetector.cs (1)
42var operation = semanticModel.GetOperation(syntax, cancellationToken);
Microsoft.AspNetCore.App.Analyzers (1)
RouteHandlers\RouteHandlerAnalyzer.cs (1)
129? invocation.SemanticModel.GetOperation(syntaxNode, context.CancellationToken)
Microsoft.AspNetCore.Http.RequestDelegateGenerator (3)
RequestDelegateGenerator.cs (1)
26var operation = context.SemanticModel.GetOperation(context.Node, token);
RequestDelegateGeneratorSuppressor.cs (1)
58var operation = semanticModel.GetOperation(node, context.CancellationToken);
StaticRouteHandlerModel\InvocationOperationExtensions.cs (1)
113var operation = targetSemanticModel?.GetOperation(expr);
Microsoft.AspNetCore.Mvc.Api.Analyzers (1)
AddResponseTypeAttributeCodeFixAction.cs (1)
171var operation = (IMethodBodyBaseOperation)context.SemanticModel.GetOperation(context.MethodSyntax, context.CancellationToken);
Microsoft.CodeAnalysis (5)
DiagnosticAnalyzer\AnalyzerDriver.cs (1)
2924if (semanticModel.GetOperation(executableBlock, cancellationToken) is { } operation)
Operations\ControlFlowGraph.cs (2)
80/// Returns null if <see cref="SemanticModel.GetOperation(SyntaxNode, CancellationToken)"/> returns null for the given <paramref name="node"/> and <paramref name="semanticModel"/>. 95IOperation? operation = semanticModel.GetOperation(node, cancellationToken);
Operations\IOperation.cs (1)
74/// Non-null for operations generated from source with <see cref="SemanticModel.GetOperation(SyntaxNode, System.Threading.CancellationToken)"/> API
Operations\Operation.cs (1)
128/// is the semantic model on which <see cref="SemanticModel.GetOperation(SyntaxNode, CancellationToken)"/> was invoked
Microsoft.CodeAnalysis.CodeStyle (10)
src\Analyzers\Core\Analyzers\ForEachCast\AbstractForEachCastDiagnosticAnalyzer.cs (1)
64if (semanticModel.GetOperation(node, cancellationToken) is not IForEachLoopOperation loopOperation)
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\SuppressMessageAttributeState.cs (1)
51var operation = (model.GetOperation(attributeSyntax, cancellationToken) as IAttributeOperation)?.Operation;
src\Analyzers\Core\Analyzers\UseAutoProperty\AbstractUseAutoPropertyAnalyzer.cs (1)
519var operation = semanticModel.GetOperation(expression, cancellationToken);
src\Analyzers\Core\Analyzers\UseThrowExpression\AbstractUseThrowExpressionDiagnosticAnalyzer.cs (2)
274var containingOperation = semanticModel.GetOperation(throwStatement.GetRequiredParent(), cancellationToken); 287containingOperation = semanticModel.GetOperation(throwStatement.GetRequiredParent().GetRequiredParent(), cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticEquivalence.cs (2)
89var originalOperation = semanticModel1.GetOperation(node1); 92var currentOperation = semanticModel2.GetOperation(node2);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticModelExtensions.cs (1)
55return semanticModel.GetOperation(node, cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SemanticFacts\ISemanticFactsExtensions.cs (2)
70if (semanticModel.GetOperation(parentBinary) is IBinaryOperation parentBinaryOp && 71semanticModel.GetOperation(innerBinary) is IBinaryOperation innerBinaryOp)
Microsoft.CodeAnalysis.CodeStyle.Fixes (5)
src\Analyzers\Core\CodeFixes\PopulateSwitch\AbstractPopulateSwitchCodeFixProvider.cs (1)
151var switchStatement = (TSwitchOperation)model.GetOperation(switchNode, cancellationToken)!;
src\Analyzers\Core\CodeFixes\UseConditionalExpression\ForReturn\AbstractUseConditionalExpressionForReturnCodeFixProvider.cs (1)
55var ifOperation = (IConditionalOperation)semanticModel.GetOperation(ifStatement, cancellationToken)!;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_Negate.cs (3)
150var operation = semanticModel.GetOperation(expressionNode, cancellationToken); 275var operation = semanticModel.GetOperation(isExpression, cancellationToken); 476var operation = semanticModel.GetOperation(expression);
Microsoft.CodeAnalysis.CSharp.CodeStyle (16)
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (1)
117var operation = semanticModel.GetOperation(topMostExpression, cancellationToken);
src\Analyzers\CSharp\Analyzers\UsePatternCombinators\CSharpUsePatternCombinatorsDiagnosticAnalyzer.cs (1)
78var operation = semanticModel.GetOperation(expression, cancellationToken);
src\Analyzers\CSharp\Analyzers\UsePrimaryConstructor\CSharpUsePrimaryConstructorDiagnosticAnalyzer.cs (1)
502var rightOperation = semanticModel.GetOperation(assignmentExpression.Right.WalkDownSuppressions());
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (12)
87var castExpressionOperation = semanticModel.GetOperation(cast.Expression, cancellationToken); 196var originalOperation = originalSemanticModel.GetOperation(castNode, cancellationToken); 255var rewrittenOperation = rewrittenSemanticModel.GetOperation(rewrittenExpression.WalkDownParentheses(), cancellationToken); 756var rewrittenOperation = rewrittenSemanticModel.GetOperation(rewrittenBitwiseNotExpression, cancellationToken); 803if (originalSemanticModel.GetOperation(castExpression, cancellationToken) is not IConversionOperation conversionOperation) 844if (rewrittenSemanticModel.GetOperation(rewrittenConditionalExpression, cancellationToken) is not IConditionalOperation rewrittenConditionalOperation) 875var operation = semanticModel.GetOperation(parentBinary, cancellationToken); 1072var operation = semanticModel.GetOperation(expression.WalkDownParentheses(), cancellationToken); 1113if (originalSemanticModel.GetOperation(currentOld, cancellationToken) is not IInterpolatedStringOperation oldInterpolationOperation) 1116if (rewrittenSemanticModel.GetOperation(currentNew, cancellationToken) is not IInterpolatedStringOperation newInterpolationOperation) 1368var operation = semanticModel.GetOperation(expression, cancellationToken); 1409semanticModel.GetOperation(invocationExpression, cancellationToken) is IInvocationOperation invocationOperation)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseImplicitTypeHelper.cs (1)
246var invocationOp = semanticModel.GetOperation(invocationExpression, cancellationToken) as IInvocationOperation;
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (1)
src\Analyzers\CSharp\CodeFixes\UseIndexOrRangeOperator\CSharpUseRangeOperatorCodeFixProvider.cs (1)
68if (semanticModel.GetOperation(currentInvocation, cancellationToken) is IInvocationOperation invocation &&
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (5)
CodeGen\CodeGenLocalFunctionTests.cs (2)
149var objectCreationOperation = model.GetOperation(creation); 150var localFunctionOperation = (ILocalFunctionOperation)model.GetOperation(localFunction);
CodeGen\CodeGenOperators.cs (3)
5409ControlFlowGraph.Create((IMethodBodyOperation)model.GetOperation(tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Calculate").Single())); 5699ControlFlowGraph.Create((IMethodBodyOperation)model.GetOperation(tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Calculate").Single())); 5735ControlFlowGraph.Create((IMethodBodyOperation)model.GetOperation(tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Where(m => m.Identifier.ValueText == "Calculate").Single()));
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (103)
Attributes\AttributeTests.cs (6)
714var operation = semanticModel.GetOperation(attrSyntax); 756var speculativeOperation = speculativeModel.GetOperation(newAttrSyntax); 821var speculativeOperation = speculativeModel.GetOperation(newAttrSyntax); 862var speculativeOperation = speculativeModel.GetOperation(newAttrSyntax); 903var speculativeOperation = speculativeModel.GetOperation(newAttrSyntax); 942var speculativeOperation = speculativeModel.GetOperation(newAttrSyntax);
FirstClassSpanTests.cs (2)
2771var op = (IConversionOperation)model.GetOperation(cast)!; 2787var op = (IConversionOperation)model.GetOperation(cast)!;
RefStructInterfacesTests.cs (51)
7582var op = (Operations.ForEachLoopOperation)model.GetOperation(foreachSyntax); 7772var op = (Operations.ForEachLoopOperation)model.GetOperation(foreachSyntax); 7992var op = (Operations.ForEachLoopOperation)model.GetOperation(foreachSyntax); 8182var op = (Operations.ForEachLoopOperation)model.GetOperation(foreachSyntax); 8375var op = (Operations.ForEachLoopOperation)model.GetOperation(foreachSyntax); 8450var op = (Operations.ForEachLoopOperation)model.GetOperation(foreachSyntax); 8654var op = (Operations.ForEachLoopOperation)model.GetOperation(foreachSyntax); 9027var op = (Operations.ForEachLoopOperation)model.GetOperation(foreachSyntax); 9231var op = (Operations.ForEachLoopOperation)model.GetOperation(foreachSyntax); 9395var op = (Operations.ForEachLoopOperation)model.GetOperation(foreachSyntax); 9595var op = (Operations.ForEachLoopOperation)model.GetOperation(foreachSyntax); 9819var op = (Operations.ForEachLoopOperation)model.GetOperation(foreachSyntax); 10028var op = (Operations.ForEachLoopOperation)model.GetOperation(foreachSyntax); 10255var op = (Operations.ForEachLoopOperation)model.GetOperation(foreachSyntax); 10357var op = (Operations.ForEachLoopOperation)model.GetOperation(foreachSyntax); 10452var op = (Operations.ForEachLoopOperation)model.GetOperation(foreachSyntax); 10638var op = (Operations.ForEachLoopOperation)model.GetOperation(foreachSyntax); 10835var op = (Operations.ForEachLoopOperation)model.GetOperation(foreachSyntax); 11076var op = (Operations.ForEachLoopOperation)model.GetOperation(foreachSyntax); 11303var op = (Operations.ForEachLoopOperation)model.GetOperation(foreachSyntax); 11515var op = (Operations.ForEachLoopOperation)model.GetOperation(foreachSyntax); 11615var op = (Operations.ForEachLoopOperation)model.GetOperation(foreachSyntax); 11710var op = (Operations.ForEachLoopOperation)model.GetOperation(foreachSyntax); 14265var op = (Operations.ForEachLoopOperation)model.GetOperation(foreachSyntax); 14606var op = (Operations.ForEachLoopOperation)model.GetOperation(foreachSyntax); 14973var op = (Operations.ForEachLoopOperation)model.GetOperation(foreachSyntax); 15316var op = (Operations.ForEachLoopOperation)model.GetOperation(foreachSyntax); 15664var op = (Operations.ForEachLoopOperation)model.GetOperation(foreachSyntax); 15741var op = (Operations.ForEachLoopOperation)model.GetOperation(foreachSyntax); 16102var op = (Operations.ForEachLoopOperation)model.GetOperation(foreachSyntax); 16766var op = (Operations.ForEachLoopOperation)model.GetOperation(foreachSyntax); 16831var op = (Operations.ForEachLoopOperation)model.GetOperation(foreachSyntax); 16896var op = (Operations.ForEachLoopOperation)model.GetOperation(foreachSyntax); 16980var op = (Operations.ForEachLoopOperation)model.GetOperation(foreachSyntax); 17068var op = (Operations.ForEachLoopOperation)model.GetOperation(foreachSyntax); 17161var op = (Operations.ForEachLoopOperation)model.GetOperation(foreachSyntax); 17258var op = (Operations.ForEachLoopOperation)model.GetOperation(foreachSyntax); 17342var op = (Operations.ForEachLoopOperation)model.GetOperation(foreachSyntax); 17769var op = (Operations.ForEachLoopOperation)model.GetOperation(foreachSyntax); 17966var op = (Operations.ForEachLoopOperation)model.GetOperation(foreachSyntax); 18190var op = (Operations.ForEachLoopOperation)model.GetOperation(foreachSyntax); 18386var op = (Operations.ForEachLoopOperation)model.GetOperation(foreachSyntax); 18587var op = (Operations.ForEachLoopOperation)model.GetOperation(foreachSyntax); 18661var op = (Operations.ForEachLoopOperation)model.GetOperation(foreachSyntax); 18871var op = (Operations.ForEachLoopOperation)model.GetOperation(foreachSyntax); 19208var op = (Operations.ForEachLoopOperation)model.GetOperation(foreachSyntax); 19379var op = (Operations.ForEachLoopOperation)model.GetOperation(foreachSyntax); 19536var op = (Operations.ForEachLoopOperation)model.GetOperation(foreachSyntax); 19704var op = (Operations.ForEachLoopOperation)model.GetOperation(foreachSyntax); 19872var op = (Operations.ForEachLoopOperation)model.GetOperation(foreachSyntax); 19976var op = (Operations.ForEachLoopOperation)model.GetOperation(foreachSyntax);
Semantics\CollectionExpressionTests.cs (2)
33550Assert.NotNull(model.GetOperation(collectionExpression)); 33591Assert.NotNull(model.GetOperation(collectionExpression));
Semantics\OutVarTests.cs (11)
1085Assert.Equal(expectedType, model.GetOperation(decl)?.Type); 3514var initializerOperation = model.GetOperation(initializer); 35950IOperation initializerOperation = model.GetOperation(initializerSyntax); 35973IOperation blockBodyOperation = model.GetOperation(blockBodySyntax); 35999Assert.Same(blockBodyOperation.Parent, model.GetOperation(expressionBodySyntax).Parent); 36003Assert.Same(blockBodyOperation.Parent, model.GetOperation(declarationSyntax)); 36094IOperation expressionBodyOperation = model.GetOperation(expressionBodySyntax); 36119IOperation blockBodyOperation = model.GetOperation(blockBodySyntax); 36125Assert.Null(model.GetOperation(propertyExpressionBodySyntax)); // https://github.com/dotnet/roslyn/issues/24900 36128Assert.Same(expressionBodyOperation.Parent, model.GetOperation(declarationSyntax)); 36202Assert.Null(model.GetOperation(node3).Parent);
Semantics\PatternMatchingTests.cs (2)
11412var operation = model.GetOperation(syntax); 11469var operation = model.GetOperation(syntax);
Semantics\PatternMatchingTests5.cs (5)
429VerifyOperationTree(comp, model.GetOperation(isPattern), @" 566VerifyOperationTree(comp, model.GetOperation(isPattern), @" 797VerifyOperationTree(comp, model.GetOperation(isPattern), @" 843VerifyOperationTree(comp, model.GetOperation(isPattern), @" 897VerifyOperationTree(comp, model.GetOperation(isPattern), @"
Semantics\PrimaryConstructorTests.cs (11)
1109var operation = model.GetOperation(baseWithargs); 1127Assert.Null(model.GetOperation(baseWithargs.Type)); 1128Assert.Null(model.GetOperation(baseWithargs.Parent)); 1129Assert.Same(operation.Parent.Parent, model.GetOperation(baseWithargs.Parent.Parent)); 1425Assert.Null(model.GetOperation(classDeclarations[0])); 1427Assert.Null(model.GetOperation(classDeclarations[1])); 1486Assert.Null(model.GetOperation(classDeclarations[0])); 1489Assert.Null(model.GetOperation(classDeclarations[1])); 1578Assert.Null(model.GetOperation(classDeclarations[1])); 1643Assert.Null(model.GetOperation(classDeclarations[0])); 2654Assert.Null(model.GetOperation(typeDeclaration));
Semantics\RecordTests.cs (13)
21182var operation = model.GetOperation(baseWithargs); 21200Assert.Null(model.GetOperation(baseWithargs.Type)); 21201Assert.Null(model.GetOperation(baseWithargs.Parent)); 21202Assert.Same(operation.Parent.Parent, model.GetOperation(baseWithargs.Parent.Parent)); 21499Assert.Null(model.GetOperation(recordDeclarations[0])); 21501Assert.Null(model.GetOperation(recordDeclarations[1])); 21560Assert.Null(model.GetOperation(recordDeclarations[0])); 21563Assert.Null(model.GetOperation(recordDeclarations[1])); 21652Assert.Null(model.GetOperation(recordDeclarations[1])); 21717Assert.Null(model.GetOperation(recordDeclarations[0])); 22918Assert.Null(model.GetOperation(recordDeclaration)); 23373Assert.Null(model.GetOperation(recordDeclaration)); 24656Assert.Null(model.GetOperation(recordDeclaration));
Microsoft.CodeAnalysis.CSharp.EndToEnd.UnitTests (2)
EndToEndTests.cs (2)
496var operation = (Microsoft.CodeAnalysis.Operations.IMethodBodyOperation)model.GetOperation(node); 867var operation = model.GetOperation(isPattern);
Microsoft.CodeAnalysis.CSharp.Features (7)
ConvertLinq\CSharpConvertLinqQueryToForEachProvider.cs (1)
907=> IsLocalOrParameterSymbol(_semanticModel.GetOperation(expression, _cancellationToken));
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.cs (1)
748var methodOperation = semanticModel.GetOperation(node, cancellationToken);
GoToDefinition\CSharpGoToDefinitionSymbolService.cs (1)
79if (semanticModel.GetOperation(gotoStatement) is not IBranchOperation gotoOperation)
InitializeParameter\CSharpInitializeMemberFromPrimaryConstructorParameterCodeRefactoringProvider.cs (2)
289var operation = semanticModel.GetOperation(propertyInitializer, cancellationToken); 299var operation = semanticModel.GetOperation(fieldInitializer, cancellationToken);
src\Analyzers\CSharp\Analyzers\UsePatternCombinators\CSharpUsePatternCombinatorsDiagnosticAnalyzer.cs (1)
78var operation = semanticModel.GetOperation(expression, cancellationToken);
src\Analyzers\CSharp\CodeFixes\UseIndexOrRangeOperator\CSharpUseRangeOperatorCodeFixProvider.cs (1)
68if (semanticModel.GetOperation(currentInvocation, cancellationToken) is IInvocationOperation invocation &&
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (33)
IOperation\IOperationTests.cs (12)
311var op = (IForLoopOperation)comp.GetSemanticModel(tree).GetOperation(tree.GetRoot().DescendantNodes().OfType<ForStatementSyntax>().Single()); 379var op = (IForEachLoopOperation)comp.GetSemanticModel(tree).GetOperation(tree.GetRoot().DescendantNodes().OfType<ForEachStatementSyntax>().Single()); 465IOperation operation1 = model.GetOperation(assignments[0]); 471IOperation operation2 = model.GetOperation(assignments[1]); 477IOperation operation3 = model.GetOperation(assignments[2]); 511var operation = model.GetOperation(statement); 560var operation = model.GetOperation(expr); 567Assert.Null(model.GetOperation(expr.Name)); 591IOperation operation = model.GetOperation(literal); 626IOperation operation = speculativeModel.GetOperation(localDecl); 670var blockOperation = semanticModel.GetOperation(exceptionBlock); 671var catchOperation = (ICatchClauseOperation)semanticModel.GetOperation(catchBlock);
IOperation\IOperationTests_IAnonymousFunctionExpression.cs (7)
412var variableDeclarationGroupOperation = (IVariableDeclarationGroupOperation)semanticModel.GetOperation(variableDeclaration); 414var lambdaOperation = (IAnonymousFunctionOperation)semanticModel.GetOperation(lambdaSyntax); 420var variableDeclarationGroupOperationSecondRequest = (IVariableDeclarationGroupOperation)semanticModel.GetOperation(variableDeclaration); 422var lambdaOperationSecondRequest = (IAnonymousFunctionOperation)semanticModel.GetOperation(lambdaSyntax); 491var lambdaOperation = (IAnonymousFunctionOperation)semanticModel.GetOperation(lambdaSyntax); 847var graphM = ControlFlowGraph.Create((IMethodBodyOperation)semanticModel.GetOperation(tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Single())); 902var graphM = ControlFlowGraph.Create((IMethodBodyOperation)semanticModel.GetOperation(tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().Single()));
IOperation\IOperationTests_IConstructorBodyOperation.cs (3)
41Assert.Null(model.GetOperation(node1)); 488Assert.Null(model.GetOperation(node1)); 1073Assert.Null(model.GetOperation(node1));
IOperation\IOperationTests_IConversionExpression.cs (1)
5293var iopTree = (IAssignmentOperation)model.GetOperation(assignment);
IOperation\IOperationTests_IFieldReferenceExpression.cs (1)
712var methodBlockOperation = model.GetOperation(methodDecl);
IOperation\IOperationTests_ILocalFunctionStatement.cs (2)
1793var graphM = ControlFlowGraph.Create((IMethodBodyOperation)semanticModel.GetOperation(tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().First())); 1848var graphM = ControlFlowGraph.Create((IMethodBodyOperation)semanticModel.GetOperation(tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().First()));
IOperation\IOperationTests_IMethodBodyOperation.cs (6)
36Assert.Null(model.GetOperation(node1)); 563Assert.Null(model.GetOperation(node1)); 705Assert.Null(model.GetOperation(node1)); 847Assert.Null(model.GetOperation(node1)); 979Assert.Null(model.GetOperation(node1)); 1125Assert.Null(model.GetOperation(node1));
IOperation\IOperationTests_ISymbolInitializer.cs (1)
39Assert.Null(semanticModel.GetOperation(node));
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (143)
Semantics\BindingTests.cs (2)
4073VerifyOperationTree(comp, model.GetOperation(ifStmt), operationString); 4081VerifyOperationTree(comp, model.GetOperation(ifStmt), operationString);
Semantics\ConstantTests.cs (1)
3522var literalOperation = model.GetOperation(initializer);
Semantics\DelegateTypeTests.cs (1)
14701var operation = (IVariableDeclaratorOperation)model.GetOperation(syntax)!;
Semantics\DynamicTests.cs (106)
4993var operation = (IDynamicInvocationOperation)model.GetOperation(call); 5117var operation = (IDynamicInvocationOperation)model.GetOperation(call); 5240var operation = (IDynamicInvocationOperation)model.GetOperation(call); 5483var operation = (IDynamicInvocationOperation)model.GetOperation(call); 5527var operation = (IDynamicInvocationOperation)model.GetOperation(call); 5704var operation = (IDynamicInvocationOperation)model.GetOperation(call); 5835var operation = (IDynamicInvocationOperation)model.GetOperation(call); 5880var operation = (IDynamicInvocationOperation)model.GetOperation(call); 6038var operation = (IDynamicIndexerAccessOperation)model.GetOperation(elementAccess); 6161var operation = (IDynamicIndexerAccessOperation)model.GetOperation(elementAccess); 6281var operation = (IDynamicIndexerAccessOperation)model.GetOperation(elementAccess); 6389var operation = (IDynamicIndexerAccessOperation)model.GetOperation(elementAccess); 6431var propertyRef = (IDynamicIndexerAccessOperation)model.GetOperation(elementAccess); 6478var propertyRef = (IDynamicIndexerAccessOperation)model.GetOperation(elementAccess); 6522var propertyRef = (IDynamicIndexerAccessOperation)model.GetOperation(elementAccess); 6567var propertyRef = (IDynamicIndexerAccessOperation)model.GetOperation(elementAccess); 6621var propertyRef = (IDynamicIndexerAccessOperation)model.GetOperation(elementAccess); 6687var propertyRef = (IDynamicIndexerAccessOperation)model.GetOperation(elementAccess); 6695var operation = (IAssignmentOperation)model.GetOperation(assignment); 6796var propertyRef = (IDynamicIndexerAccessOperation)model.GetOperation(elementAccess); 6804var operation = (IAssignmentOperation)model.GetOperation(assignment); 6906var propertyRef = (IDynamicIndexerAccessOperation)model.GetOperation(elementAccess); 6914var operation = (IAssignmentOperation)model.GetOperation(assignment); 7003var propertyRef = (IDynamicIndexerAccessOperation)model.GetOperation(elementAccess); 7011var operation = (IAssignmentOperation)model.GetOperation(assignment); 7075var propertyRef = (IDynamicIndexerAccessOperation)model.GetOperation(elementAccess); 7178var propertyRef = (IDynamicIndexerAccessOperation)model.GetOperation(elementAccess); 7188var operation = (ICompoundAssignmentOperation)model.GetOperation(assignment); 7291var propertyRef = (IDynamicIndexerAccessOperation)model.GetOperation(elementAccess); 7301var operation = (ICompoundAssignmentOperation)model.GetOperation(assignment); 7407var propertyRef = (IDynamicIndexerAccessOperation)model.GetOperation(elementAccess); 7417var operation = (ICompoundAssignmentOperation)model.GetOperation(assignment); 7520var propertyRef = (IDynamicIndexerAccessOperation)model.GetOperation(elementAccess); 7531var operation = (ICompoundAssignmentOperation)model.GetOperation(assignment); 7597var propertyRef = (IDynamicIndexerAccessOperation)model.GetOperation(elementAccess); 7702var propertyRef = (IDynamicIndexerAccessOperation)model.GetOperation(elementAccess); 7712var operation = (IIncrementOrDecrementOperation)model.GetOperation(assignment); 7808var propertyRef = (IDynamicIndexerAccessOperation)model.GetOperation(elementAccess); 7818var operation = (IIncrementOrDecrementOperation)model.GetOperation(assignment); 7912var propertyRef = (IDynamicIndexerAccessOperation)model.GetOperation(elementAccess); 7923var operation = (IIncrementOrDecrementOperation)model.GetOperation(assignment); 7983var propertyRef = (IDynamicIndexerAccessOperation)model.GetOperation(elementAccess); 7993var operation = (IIncrementOrDecrementOperation)model.GetOperation(assignment); 8089var propertyRef = (IDynamicIndexerAccessOperation)model.GetOperation(elementAccess); 8099var operation = (IIncrementOrDecrementOperation)model.GetOperation(assignment); 8194var propertyRef = (IDynamicIndexerAccessOperation)model.GetOperation(elementAccess); 8204var operation = (IIncrementOrDecrementOperation)model.GetOperation(assignment); 8299var propertyRef = (IDynamicIndexerAccessOperation)model.GetOperation(elementAccess); 8307var operation = (IAssignmentOperation)model.GetOperation(assignment); 8408var propertyRef = (IDynamicIndexerAccessOperation)model.GetOperation(elementAccess); 8416var operation = (IAssignmentOperation)model.GetOperation(assignment); 8517var propertyRef = (IDynamicIndexerAccessOperation)model.GetOperation(elementAccess); 8525var operation = (IAssignmentOperation)model.GetOperation(assignment); 8627var propertyRef = (IDynamicIndexerAccessOperation)model.GetOperation(elementAccess); 8635var operation = (IAssignmentOperation)model.GetOperation(assignment); 8736var propertyRef = (IDynamicIndexerAccessOperation)model.GetOperation(elementAccess); 8744var operation = (IAssignmentOperation)model.GetOperation(assignment); 8805var propertyRef = (IDynamicIndexerAccessOperation)model.GetOperation(elementAccess); 8813var operation = (IAssignmentOperation)model.GetOperation(assignment); 8877var propertyRef = (IDynamicIndexerAccessOperation)model.GetOperation(elementAccess); 8885var operation = (IAssignmentOperation)model.GetOperation(assignment); 8933var propertyRef = (IDynamicIndexerAccessOperation)model.GetOperation(elementAccess); 8941var operation = (IAssignmentOperation)model.GetOperation(assignment); 9023var propertyRef = (IDynamicIndexerAccessOperation)model.GetOperation(elementAccess); 9031var operation = (IAssignmentOperation)model.GetOperation(assignment); 9114var propertyRef = (IDynamicIndexerAccessOperation)model.GetOperation(elementAccess); 9122var operation = (IAssignmentOperation)model.GetOperation(assignment); 9204var propertyRef = (IDynamicIndexerAccessOperation)model.GetOperation(elementAccess); 9212var operation = (IAssignmentOperation)model.GetOperation(assignment); 9260var propertyRef = (IDynamicIndexerAccessOperation)model.GetOperation(elementAccess); 9268var operation = (IAssignmentOperation)model.GetOperation(assignment); 9321var propertyRef = (IDynamicIndexerAccessOperation)model.GetOperation(elementAccess); 9329var operation = (IMemberInitializerOperation)model.GetOperation(assignment); 9442var propertyRef = (IDynamicIndexerAccessOperation)model.GetOperation(elementAccess); 9450var operation = (IMemberInitializerOperation)model.GetOperation(assignment); 9562var propertyRef = (IDynamicIndexerAccessOperation)model.GetOperation(elementAccess); 9570var operation = (IMemberInitializerOperation)model.GetOperation(assignment); 9676var propertyRef = (IDynamicIndexerAccessOperation)model.GetOperation(elementAccess); 9684var operation = (IMemberInitializerOperation)model.GetOperation(assignment); 9787var propertyRef = (IDynamicIndexerAccessOperation)model.GetOperation(elementAccess); 9795var operation = (IMemberInitializerOperation)model.GetOperation(assignment); 9898var propertyRef = (IDynamicIndexerAccessOperation)model.GetOperation(elementAccess); 9906var operation = (IMemberInitializerOperation)model.GetOperation(assignment); 10029var propertyRef = (IDynamicIndexerAccessOperation)model.GetOperation(elementAccess); 10044var operation = (IDeconstructionAssignmentOperation)model.GetOperation(assignment); 10157var propertyRef = (IDynamicIndexerAccessOperation)model.GetOperation(elementAccess); 10172var operation = (IDeconstructionAssignmentOperation)model.GetOperation(assignment); 10285var propertyRef = (IDynamicIndexerAccessOperation)model.GetOperation(elementAccess); 10300var operation = (IDeconstructionAssignmentOperation)model.GetOperation(assignment); 10439var propertyRef = (IDynamicIndexerAccessOperation)model.GetOperation(elementAccess); 10454var operation = (IDeconstructionAssignmentOperation)model.GetOperation(assignment); 10573var propertyRef = (IDynamicIndexerAccessOperation)model.GetOperation(elementAccess); 10588var operation = (IDeconstructionAssignmentOperation)model.GetOperation(assignment); 10721var propertyRef = (IDynamicIndexerAccessOperation)model.GetOperation(elementAccess); 10736var operation = (IDeconstructionAssignmentOperation)model.GetOperation(assignment); 10991var propertyRef = (IDynamicIndexerAccessOperation)model.GetOperation(elementAccess); 11006var operation = (IDeconstructionAssignmentOperation)model.GetOperation(assignment); 11334var operation = (IDynamicInvocationOperation)model.GetOperation(call); 11387var operation = (IDynamicInvocationOperation)model.GetOperation(call); 11420Assert.Equal(OperationKind.Invalid, model.GetOperation(call).Kind); 11463var operation = (IDynamicInvocationOperation)model.GetOperation(call); 11507var operation = (IDynamicInvocationOperation)model.GetOperation(call); 11548var operation = (IDynamicInvocationOperation)model.GetOperation(call); 11600var operation = (IDynamicIndexerAccessOperation)model.GetOperation(elementAccess); 11652var operation = (IDynamicIndexerAccessOperation)model.GetOperation(elementAccess); 11692var operation = (IDynamicIndexerAccessOperation)model.GetOperation(elementAccess);
Semantics\LocalFunctionTests.cs (1)
2379model.GetOperation(declaration.Body);
Semantics\ObjectAndCollectionInitializerTests.cs (4)
4234var propertyRef = (IPropertyReferenceOperation)model.GetOperation(elementAccess); 4243var operation = (IAssignmentOperation)model.GetOperation(assignment); 4288var propertyRef = (IPropertyReferenceOperation)model.GetOperation(propertyAccess); 4297var operation = (IAssignmentOperation)model.GetOperation(assignment);
Semantics\OperatorTests.cs (1)
11420.Select(i => model.GetOperation(i));
Semantics\RecordStructTests.cs (3)
2607Assert.Null(model.GetOperation(recordDeclaration)); 6929var operation = model.GetOperation(with); 8812var operation = model.GetOperation(withExpr);
Semantics\RefFieldTests.cs (2)
28835var fieldInitializerOperation = (Microsoft.CodeAnalysis.Operations.IFieldInitializerOperation)model.GetOperation(fieldInitializerSyntax); 28878var constructorOperation = (Microsoft.CodeAnalysis.Operations.IConstructorBodyOperation)model.GetOperation(constructorSyntax);
Semantics\StackAllocInitializerTests.cs (1)
2718var operation = model.GetOperation(tree.GetRoot());
Semantics\StructConstructorTests.cs (3)
1051var operation = model.GetOperation(syntax); 1146var operation = model.GetOperation(syntax); 1243var operation = model.GetOperation(syntax);
Semantics\TopLevelStatementsTests.cs (17)
200var operation1 = model1.GetOperation(localRef.Parent); 243var operation2 = model1.GetOperation(localDecl); 260Assert.Null(model1.GetOperation(globalStatement)); 328var operation1 = model1.GetOperation(localRef.Parent); 366var operation2 = model2.GetOperation(localDecl); 411Assert.Null(model1.GetOperation(globalStatement)); 487Assert.NotNull(model1.GetOperation(tree1.GetRoot())); 488var operation1 = model1.GetOperation(localDecl); 507Assert.NotNull(model2.GetOperation(tree2.GetRoot())); 508var operation2 = model2.GetOperation(localRef); 579Assert.NotNull(model1.GetOperation(tree1.GetRoot())); 580var operation1 = model1.GetOperation(localDecl); 597var operation2 = model1.GetOperation(localRef); 1411Assert.Null(model2.GetOperation(tree2.GetRoot())); 1429Assert.Null(model2.GetOperation(tree2.GetRoot())); 9680model.GetOperation(identifier); 9681Assert.Equal(OperationKind.Literal, model.GetOperation(tree.GetRoot().DescendantNodes().OfType<LiteralExpressionSyntax>().Single()).Kind);
Semantics\Utf8StringsLiteralsTests.cs (1)
3316Assert.True(((IConversionOperation)model.GetOperation(node)).GetConversion().IsSpan);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (3)
Symbols\Source\NullablePublicAPITests.cs (2)
4735Assert.Null(model.GetOperation(s)); 4967var operation = model.GetOperation(ternary);
Symbols\SymbolEqualityTests.cs (1)
963var operation = model.GetOperation(syntaxNode);
Microsoft.CodeAnalysis.CSharp.Test.Utilities (3)
CompilationTestUtils.cs (1)
416return model.GetOperation(expression);
CSharpTestBase.cs (2)
2034var operation = model.GetOperation(syntaxNode); 2079VerifyOperationTree(compilation, model.GetOperation(syntaxNode), expectedOperationTree);
Microsoft.CodeAnalysis.CSharp.Workspaces (13)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (12)
87var castExpressionOperation = semanticModel.GetOperation(cast.Expression, cancellationToken); 196var originalOperation = originalSemanticModel.GetOperation(castNode, cancellationToken); 255var rewrittenOperation = rewrittenSemanticModel.GetOperation(rewrittenExpression.WalkDownParentheses(), cancellationToken); 756var rewrittenOperation = rewrittenSemanticModel.GetOperation(rewrittenBitwiseNotExpression, cancellationToken); 803if (originalSemanticModel.GetOperation(castExpression, cancellationToken) is not IConversionOperation conversionOperation) 844if (rewrittenSemanticModel.GetOperation(rewrittenConditionalExpression, cancellationToken) is not IConditionalOperation rewrittenConditionalOperation) 875var operation = semanticModel.GetOperation(parentBinary, cancellationToken); 1072var operation = semanticModel.GetOperation(expression.WalkDownParentheses(), cancellationToken); 1113if (originalSemanticModel.GetOperation(currentOld, cancellationToken) is not IInterpolatedStringOperation oldInterpolationOperation) 1116if (rewrittenSemanticModel.GetOperation(currentNew, cancellationToken) is not IInterpolatedStringOperation newInterpolationOperation) 1368var operation = semanticModel.GetOperation(expression, cancellationToken); 1409semanticModel.GetOperation(invocationExpression, cancellationToken) is IInvocationOperation invocationOperation)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseImplicitTypeHelper.cs (1)
246var invocationOp = semanticModel.GetOperation(invocationExpression, cancellationToken) as IInvocationOperation;
Microsoft.CodeAnalysis.Features (10)
ConvertForEachToFor\AbstractConvertForEachToForCodeRefactoringProvider.cs (1)
153if (model.GetOperation(foreachStatement, cancellationToken) is not IForEachLoopOperation operation || operation.Locals.Length != 1)
ConvertIfToSwitch\AbstractConvertIfToSwitchCodeRefactoringProvider.cs (1)
86var ifOperation = semanticModel.GetOperation(ifStatement);
InitializeParameter\AbstractAddParameterCheckCodeRefactoringProvider.cs (1)
197var operation = semanticModel.GetOperation(coalesceNode, cancellationToken);
InitializeParameter\AbstractInitializeParameterCodeRefactoringProvider.cs (2)
162var operation = semanticModel.GetOperation( 192var childOperation = semanticModel.GetOperation(child, cancellationToken);
IntroduceVariable\AbstractIntroduceVariableService.cs (2)
350var originalOperation = originalSemanticModel.GetOperation(expressionInOriginal, cancellationToken); 353var currentOperation = currentSemanticModel.GetOperation(nodeInCurrent, cancellationToken);
src\Analyzers\Core\Analyzers\ForEachCast\AbstractForEachCastDiagnosticAnalyzer.cs (1)
64if (semanticModel.GetOperation(node, cancellationToken) is not IForEachLoopOperation loopOperation)
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\SuppressMessageAttributeState.cs (1)
51var operation = (model.GetOperation(attributeSyntax, cancellationToken) as IAttributeOperation)?.Operation;
src\Analyzers\Core\Analyzers\UseAutoProperty\AbstractUseAutoPropertyAnalyzer.cs (1)
519var operation = semanticModel.GetOperation(expression, cancellationToken);
Microsoft.CodeAnalysis.Test.Utilities (8)
CommonTestBase.cs (3)
631var operation = model.GetOperation(child); 650var operation = model.GetOperation(node); 699var operation = semanticModel.GetOperation(node);
Compilation\CompilationExtensions.cs (1)
296var operation = semanticModel.GetOperation(node);
Compilation\ControlFlowGraphVerifier.cs (1)
30IOperation operationRoot = model.GetOperation(syntaxNode);
Compilation\SemanticModelExtensions.cs (1)
22IOperation operation = model.GetOperation(node);
Diagnostics\OperationTestAnalyzer.cs (2)
2141if (model.GetOperation(node) != null) 2153if (model.GetOperation(node) != null)
Microsoft.CodeAnalysis.UnitTests (1)
Diagnostics\OperationTests.cs (1)
332var operation = (IMethodBodyOperation)model.GetOperation(methodBodySyntax);
Microsoft.CodeAnalysis.VisualBasic.Features (1)
GoToDefinition\VisualBasicGoToDefinitionSymbolService.vb (1)
58Dim gotoOperation = DirectCast(semanticModel.GetOperation(goToStatement), IBranchOperation)
Microsoft.CodeAnalysis.VisualBasic.Test.Utilities (2)
BasicTestBase.vb (2)
790Dim operation = semanticModel.GetOperation(node) 923Dim operation = semanticModel.GetOperation(node)
Microsoft.CodeAnalysis.Workspaces (8)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticEquivalence.cs (2)
89var originalOperation = semanticModel1.GetOperation(node1); 92var currentOperation = semanticModel2.GetOperation(node2);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticModelExtensions.cs (1)
55return semanticModel.GetOperation(node, cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SemanticFacts\ISemanticFactsExtensions.cs (2)
70if (semanticModel.GetOperation(parentBinary) is IBinaryOperation parentBinaryOp && 71semanticModel.GetOperation(innerBinary) is IBinaryOperation innerBinaryOp)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_Negate.cs (3)
150var operation = semanticModel.GetOperation(expressionNode, cancellationToken); 275var operation = semanticModel.GetOperation(isExpression, cancellationToken); 476var operation = semanticModel.GetOperation(expression);
Microsoft.VisualStudio.LanguageServices (1)
PullMemberUp\SymbolDependentsBuilder.cs (1)
63Visit(compilation.GetSemanticModel(syntax.SyntaxTree).GetOperation(syntax, _cancellationToken));
Mvc.Api.Analyzers.Test (4)
ActualApiResponseMetadataFactoryTest.cs (4)
79var returnOperation = (IReturnOperation)compilation.GetSemanticModel(syntaxTree).GetOperation(returnStatement); 375var methodOperation = (IMethodBodyBaseOperation)compilation.GetSemanticModel(syntaxTree).GetOperation(methodSyntax); 396var returnOperation = (IReturnOperation)compilation.GetSemanticModel(syntaxTree).GetOperation(returnStatement); 415var returnOperation = (IReturnOperation)compilation.GetSemanticModel(syntaxTree).GetOperation(returnStatement);
System.Text.RegularExpressions.Generator (1)
UpgradeToGeneratedRegexCodeFixer.cs (1)
95IOperation? operation = semanticModel.GetOperation(nodeToFix, cancellationToken);