1 implementation of IInvocationOperation
Microsoft.CodeAnalysis (1)
Generated\Operations.Generated.cs (1)
5152internal sealed partial class InvocationOperation : Operation, IInvocationOperation
307 references to IInvocationOperation
Aspire.Hosting.Analyzers (5)
AppHostAnalyzer.cs (5)
57var invocation = (IInvocationOperation)context.Operation; 119private static bool TryGetStringToken(IInvocationOperation invocation, IParameterSymbol modelNameParameter, out SyntaxToken token) 142private record struct ModelNameOperation(IInvocationOperation Operation, ModelType[] ModelTypes, SyntaxToken ModelNameToken) 144public static ModelNameOperation Create(IInvocationOperation operation, ModelType[] modelTypes, SyntaxToken modelNameToken)
ConfigurationSchemaGenerator (15)
RuntimeSource\Configuration.Binder\Parser\BinderInvocation.cs (4)
14private BinderInvocation(IInvocationOperation operation, Location location) 20public IInvocationOperation Operation { get; } 28return context.SemanticModel.GetOperation(invocationSyntax, cancellationToken) is IInvocationOperation operation && 52public static bool IsBindingOperation(IInvocationOperation operation)
RuntimeSource\Configuration.Binder\Parser\ConfigurationBinder.cs (4)
41IInvocationOperation operation = invocation.Operation!; 135IInvocationOperation operation = invocation.Operation!; 190IInvocationOperation operation = invocation.Operation!; 257IInvocationOperation invocationOperation = typeParseInfo.BinderInvocation!.Operation;
RuntimeSource\Configuration.Binder\Parser\OptionsBuilderConfigurationExtensions.cs (1)
44IInvocationOperation operation = invocation.Operation!;
RuntimeSource\Configuration.Binder\Parser\OptionsConfigurationServiceCollectionExtensions.cs (1)
17IInvocationOperation operation = invocation.Operation!;
RuntimeSource\Configuration.Binder\Specs\InterceptorInfo.cs (5)
63public void RegisterInterceptor_ConfigBinder_Bind(MethodsToGen overload, ComplexTypeSpec type, IInvocationOperation invocation) 89public void RegisterInterceptor(MethodsToGen overload, IInvocationOperation operation) 136public void RegisterInterceptor(MethodsToGen overload, ComplexTypeSpec type, IInvocationOperation invocation) 158public void RegisterInvocation(IInvocationOperation invocation) => 169public InvocationLocationInfo(MethodsToGen interceptor, IInvocationOperation invocation)
ILLink.RoslynAnalyzer (6)
COMAnalyzer.cs (2)
40 var invocationOperation = (IInvocationOperation) operationContext.Operation;
DataFlow\LocalDataFlowVisitor.cs (4)
348 case IInvocationOperation: 552 public override TValue VisitInvocation (IInvocationOperation operation, LocalDataFlowState<TValue, TContext, TValueLattice, TContextLattice> state) 581 case IInvocationOperation: 773 case IInvocationOperation callOperation:
Microsoft.Analyzers.Extra (39)
AsyncCallInsideUsingBlockAnalyzer.cs (7)
77.OfType<IInvocationOperation>() 81foreach (var invocation in invocations) 94return TaskWaitInvoked((operation as IInvocationOperation)!); 128bool IsReturnTypeTask(IInvocationOperation operation) 164.OfType<IInvocationOperation>() 197private static bool TaskWaitInvoked(IInvocationOperation invocation) 207private static bool SymbolInArguments(IInvocationOperation invocation, ILocalSymbol symbol)
CallAnalysis\Arrays.cs (1)
101static void HandleMethod(OperationAnalysisContext context, IInvocationOperation op) => HandleSuspectType(context, (INamedTypeSymbol)op.TargetMethod.ReturnType, op.Syntax.GetLocation());
CallAnalysis\CallAnalyzer.Handlers.cs (2)
23var op = (IInvocationOperation)context.Operation;
CallAnalysis\CallAnalyzer.Registrar.cs (5)
33public void RegisterMethod(IMethodSymbol method, Action<OperationAnalysisContext, IInvocationOperation> action) 50public void RegisterMethods(string typeName, string methodName, Action<OperationAnalysisContext, IInvocationOperation> action) 66public void RegisterMethods(Dictionary<string, string[]> methods, Action<OperationAnalysisContext, IInvocationOperation> action) 165public void RegisterInterfaceMethod(IMethodSymbol method, Action<OperationAnalysisContext, IInvocationOperation> action) 200public void RegisterInterfaceMethods(Dictionary<string, string[]> methods, Action<OperationAnalysisContext, IInvocationOperation> action)
CallAnalysis\CallAnalyzer.State.cs (2)
16public readonly Dictionary<IMethodSymbol, List<Action<OperationAnalysisContext, IInvocationOperation>>> Methods = new(SymbolEqualityComparer.Default); 32public List<Action<OperationAnalysisContext, IInvocationOperation>> Actions { get; } = [];
CallAnalysis\Fixers\LegacyLoggingFixer.cs (10)
96var invocationOp = GetOperation(sm, invocationExpression, cancellationToken) as IInvocationOperation; 141var invocationOp = (invocationSM.GetOperation(invocationExpression, cancellationToken) as IInvocationOperation)!; 363IInvocationOperation invocationOp, 427private static List<ITypeSymbol> MakeArgumentList(FixDetails details, IInvocationOperation invocationOp) 475var invocation = sm.GetOperation(invocationExpression, cancellationToken) as IInvocationOperation; 578var invocationOp = (invocationSM.GetOperation(invocationExpression, cancellationToken) as IInvocationOperation)!;
CallAnalysis\Fixers\LegacyLoggingFixer.FixDetails.cs (1)
36IInvocationOperation invocationOp,
CallAnalysis\LegacyLogging.cs (1)
36static void Handle(OperationAnalysisContext context, IInvocationOperation op)
CallAnalysis\Split.cs (1)
26static void Handle(OperationAnalysisContext context, IInvocationOperation op)
CallAnalysis\StartsEndsWith.cs (1)
44static void Handle(OperationAnalysisContext context, IInvocationOperation op)
CallAnalysis\StaticTime.cs (1)
50static void HandleMethod(OperationAnalysisContext context, IInvocationOperation op)
CallAnalysis\ValueTuple.cs (1)
40static void HandleMethod(OperationAnalysisContext context, IInvocationOperation op)
ConditionalAccessAnalyzer.cs (2)
66var invocation = (IInvocationOperation)op.Operation;
UsingToStringInLoggersAnalyzer.cs (4)
40var invocation = (IInvocationOperation)context.Operation; 62private static IEnumerable<Diagnostic> AnalyzeLogger(IInvocationOperation invocation) 66if (arg.Value is IInvocationOperation argOperation
Microsoft.Analyzers.Local (10)
CallAnalysis\CallAnalyzer.Handlers.cs (2)
23var op = (IInvocationOperation)context.Operation;
CallAnalysis\CallAnalyzer.Registrar.cs (5)
33public void RegisterMethod(IMethodSymbol method, Action<OperationAnalysisContext, IInvocationOperation> action) 50public void RegisterMethods(string typeName, string methodName, Action<OperationAnalysisContext, IInvocationOperation> action) 66public void RegisterMethods(Dictionary<string, string[]> methods, Action<OperationAnalysisContext, IInvocationOperation> action) 165public void RegisterInterfaceMethod(IMethodSymbol method, Action<OperationAnalysisContext, IInvocationOperation> action) 200public void RegisterInterfaceMethods(Dictionary<string, string[]> methods, Action<OperationAnalysisContext, IInvocationOperation> action)
CallAnalysis\CallAnalyzer.State.cs (2)
16public readonly Dictionary<IMethodSymbol, List<Action<OperationAnalysisContext, IInvocationOperation>>> Methods = new(SymbolEqualityComparer.Default); 32public List<Action<OperationAnalysisContext, IInvocationOperation>> Actions { get; } = [];
CallAnalysis\ToInvariantString.cs (1)
39static void Handle(OperationAnalysisContext context, IInvocationOperation op)
Microsoft.AspNetCore.Analyzers (7)
CompilationFeatureDetector.cs (1)
47.OfType<IInvocationOperation>()
MiddlewareAnalyzer.cs (1)
33if (context.Operation is IInvocationOperation invocation &&
MiddlewareItem.cs (2)
11public MiddlewareItem(IInvocationOperation operation) 16public IInvocationOperation Operation { get; }
ServicesAnalyzer.cs (1)
28if (context.Operation is IInvocationOperation invocation &&
ServicesItem.cs (2)
11public ServicesItem(IInvocationOperation operation) 16public IInvocationOperation Operation { get; }
Microsoft.AspNetCore.App.Analyzers (37)
Authorization\AddAuthorizationBuilderAnalyzer.cs (7)
55var invocation = (IInvocationOperation)context.Operation; 68private static bool IsCompatibleWithAuthorizationBuilder(IInvocationOperation invocation, AuthorizationOptionsTypes authorizationOptionsTypes) 88private static bool TryGetConfigureArgumentOperation(IInvocationOperation invocation, [NotNullWhen(true)] out IArgumentOperation? configureArgumentOperation) 153if (expressionStatementOperation is IInvocationOperation { TargetMethod.ContainingType: { } invokedMethodContainingType } 213if (operation is IInvocationOperation invocationOperation 223private static bool IsLastCallInChain(IInvocationOperation invocation)
Http\HeaderDictionaryAddAnalyzer.cs (2)
32var invocation = (IInvocationOperation)context.Operation;
Kestrel\ListenOnIPv6AnyAnalyzer.cs (4)
42if (!IsKestrelServerOptionsType(nodeOperation, out var kestrelOptionsListenInvocation)) 108private static bool IsKestrelServerOptionsType(IOperation? operation, out IInvocationOperation? kestrelOptionsListenInvocation) 110var result = operation is IInvocationOperation // searching type `Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServerOptions` 140kestrelOptionsListenInvocation = result ? (IInvocationOperation)operation! : null;
RenderTreeBuilder\RenderTreeBuilderAnalyzer.cs (2)
32var invocation = (IInvocationOperation)context.Operation;
RouteHandlers\DetectAmbiguousRoutes.cs (5)
62if (current.Parent is IArgumentOperation { Parent: IInvocationOperation invocationOperation } && 78IInvocationOperation or 93private static bool IsAllowedEndpointBuilderMethod(IInvocationOperation invocationOperation, WellKnownTypes wellKnownTypes) 194if (builder is IInvocationOperation invocation && other is IInvocationOperation otherInvocation)
RouteHandlers\DetectMisplacedLambdaAttribute.cs (2)
77if (returnStatement.ReturnedValue is IInvocationOperation invocationReturn) 88if (expression.Operation is IInvocationOperation invocationExpression)
RouteHandlers\DisallowMvcBindArgumentsOnParameters.cs (1)
19IInvocationOperation invocation,
RouteHandlers\DisallowReturningActionResultFromMapMethods.cs (2)
19IInvocationOperation invocationOperation, 29IInvocationOperation invocationOperation,
RouteHandlers\RouteHandlerAnalyzer.cs (6)
70var invocation = (IInvocationOperation)context.Operation; 173private static bool TryGetStringToken(IInvocationOperation invocation, out SyntaxToken token) 197IInvocationOperation invocation, 221private record struct MapOperation(IOperation? Builder, IInvocationOperation Operation, RouteUsageModel RouteUsageModel) 223public static MapOperation Create(IInvocationOperation operation, RouteUsageModel routeUsageModel)
src\Shared\Roslyn\CodeAnalysisExtensions.cs (1)
178this IInvocationOperation invocation,
WebApplicationBuilder\WebApplicationBuilderAnalyzer.cs (5)
74var invocation = (IInvocationOperation)context.Operation; 255static Diagnostic CreateDiagnostic(DiagnosticDescriptor descriptor, IInvocationOperation operation) 313IInvocationOperation invocation, 362private static bool HasInvocationInBody(string disallowedMethodName, IInvocationOperation invocation)
Microsoft.AspNetCore.Components.Analyzers (1)
InternalUsageAnalyzer.cs (1)
64IInvocationOperation invocation => invocation.TargetMethod,
Microsoft.AspNetCore.Components.SdkAnalyzers (1)
InternalUsageAnalyzer.cs (1)
64IInvocationOperation invocation => invocation.TargetMethod,
Microsoft.AspNetCore.Http.RequestDelegateGenerator (10)
RequestDelegateGenerator.cs (1)
28if (operation.IsValidOperation(wellKnownTypes, out var invocationOperation))
RequestDelegateGeneratorSuppressor.cs (1)
60if (operation.IsValidOperation(wellKnownTypes, out var invocationOperation))
StaticRouteHandlerModel\Endpoint.cs (4)
19public Endpoint(IInvocationOperation operation, WellKnownTypes wellKnownTypes, SemanticModel semanticModel) 108public IInvocationOperation Operation { get; } 150private static (string, int, int) GetLocation(IInvocationOperation operation) 171private static string GetHttpMethod(IInvocationOperation operation)
StaticRouteHandlerModel\InvocationOperationExtensions.cs (4)
26public static bool IsValidOperation(this IOperation? operation, WellKnownTypes wellKnownTypes, [NotNullWhen(true)] out IInvocationOperation? invocationOperation) 29if (operation is IInvocationOperation targetOperation && 42public static bool TryGetRouteHandlerMethod(this IInvocationOperation invocation, SemanticModel semanticModel, [NotNullWhen(true)] out IMethodSymbol? method) 53public static bool TryGetRouteHandlerArgument(this IInvocationOperation invocation, [NotNullWhen(true)] out IArgumentOperation? argumentOperation)
Microsoft.AspNetCore.Mvc.Analyzers (4)
AvoidHtmlPartialAnalyzer.cs (1)
23var method = ((IInvocationOperation)context.Operation).TargetMethod;
src\Shared\Roslyn\CodeAnalysisExtensions.cs (1)
178this IInvocationOperation invocation,
TagHelpersInCodeBlocksAnalyzer.cs (2)
53var invocationOperation = (IInvocationOperation)awaitOperation.Operation;
Microsoft.AspNetCore.Mvc.Api.Analyzers (3)
ActualApiResponseMetadataFactory.cs (2)
93if (defaultStatusCodeAttribute is null && returnedValue is IInvocationOperation invocationOperation) 119case IInvocationOperation invocation:
src\Shared\Roslyn\CodeAnalysisExtensions.cs (1)
178this IInvocationOperation invocation,
Microsoft.CodeAnalysis (14)
Generated\OperationKind.Generated.cs (2)
61/// <summary>Indicates an <see cref="IInvocationOperation"/>.</summary> 127[Obsolete("ICollectionElementInitializerOperation has been replaced with " + nameof(IInvocationOperation) + " and " + nameof(IDynamicInvocationOperation), error: true)]
Generated\Operations.Generated.cs (11)
748/// 3 <see cref="IInvocationOperation" /> nodes, each of which will be a call to the corresponding <c>Add</c> method 756/// Similar to the C# example, <c>New C() From {1, 2, 3}</c> will have 3 <see cref="IInvocationOperation" /> 1763/// <see cref="IInvocationOperation" /> and <see cref="IDynamicInvocationOperation" />, as appropriate. 1766/// None. This API has been obsoleted in favor of <see cref="IInvocationOperation" /> and <see cref="IDynamicInvocationOperation" />. 1777[Obsolete("ICollectionElementInitializerOperation has been replaced with " + nameof(IInvocationOperation) + " and " + nameof(IDynamicInvocationOperation), error: true)] 3709/// This can be an <see cref="IInvocationOperation" /> or <see cref="IDynamicInvocationOperation" /> for valid code, and <see cref="IInvalidOperation" /> for invalid code. 10901public override IOperation VisitInvocation(IInvocationOperation operation, object? argument) 11437public virtual void VisitInvocation(IInvocationOperation operation) => DefaultVisit(operation); 11466[Obsolete("ICollectionElementInitializerOperation has been replaced with " + nameof(IInvocationOperation) + " and " + nameof(IDynamicInvocationOperation), error: true)] 11576public virtual TResult? VisitInvocation(IInvocationOperation operation, TArgument argument) => DefaultVisit(operation, argument); 11605[Obsolete("ICollectionElementInitializerOperation has been replaced with " + nameof(IInvocationOperation) + " and " + nameof(IDynamicInvocationOperation), error: true)]
Operations\ControlFlowGraphBuilder.cs (1)
5927public override IOperation VisitInvocation(IInvocationOperation operation, int? captureIdForResult)
Microsoft.CodeAnalysis.CodeStyle (22)
src\Analyzers\Core\Analyzers\Helpers\HashCodeAnalyzer\HashCodeAnalyzer.OperationDeconstructor.cs (1)
61case IInvocationOperation invocation:
src\Analyzers\Core\Analyzers\QualifyMemberAccess\AbstractQualifyMemberAccessDiagnosticAnalyzer.cs (3)
69case IInvocationOperation invocationOperation: 112IInvocationOperation invocationOperation => invocationOperation.TargetMethod.Kind, 143IInvocationOperation invocationOperation => IsStaticMemberOrIsLocalFunctionHelper(invocationOperation.TargetMethod),
src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (1)
424var targetMethod = ((IInvocationOperation)operationContext.Operation).TargetMethod.OriginalDefinition;
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.BlockAnalyzer.cs (1)
320if (operation.Parent is IInvocationOperation)
src\Analyzers\Core\Analyzers\SimplifyInterpolation\AbstractSimplifyInterpolationHelpers.cs (5)
81if (expression is IInvocationOperation { TargetMethod.Name: nameof(ToString) } invocation && 131private static bool UsesInvariantCultureReferenceInsideFormattableStringInvariant(IInvocationOperation invocation, int formatProviderArgumentIndex) 164Parent: IInvocationOperation 196if (expression is IInvocationOperation invocation && 235private static bool HasNonImplicitInstance(IInvocationOperation invocation, [NotNullWhen(true)] out IOperation? instance)
src\Analyzers\Core\Analyzers\SimplifyLinqExpression\AbstractSimplifyLinqExpressionDiagnosticAnalyzer.cs (9)
49protected abstract IInvocationOperation? TryGetNextInvocationInChain(IInvocationOperation invocation); 129if (context.Operation is not IInvocationOperation invocation) 137if (TryGetNextInvocationInChain(invocation) is not IInvocationOperation nextInvocation || 177bool IsWhereLinqMethod(IInvocationOperation invocation) 180bool IsSelectLinqMethod(IInvocationOperation invocation) 183bool IsInvocationNonEnumerableReturningLinqMethod(IInvocationOperation invocation) 186ITypeSymbol? TryGetSymbolOfMemberAccess(IInvocationOperation invocation) 198string? TryGetMethodName(IInvocationOperation invocation)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.DataFlowAnalyzer.FlowGraphAnalysisData.cs (1)
252if (added && operation is IInvocationOperation invocation)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.Walker.cs (1)
320public override void VisitInvocation(IInvocationOperation operation)
Microsoft.CodeAnalysis.CSharp.CodeStyle (21)
src\Analyzers\CSharp\Analyzers\MakeStructMemberReadOnly\CSharpMakeStructMemberReadOnlyAnalyzer.cs (1)
352if (operation is IInvocationOperation invocationOperation)
src\Analyzers\CSharp\Analyzers\SimplifyLinqExpression\CSharpSimplifyLinqExpressionDiagnosticAnalyzer.cs (3)
21protected override IInvocationOperation? TryGetNextInvocationInChain(IInvocationOperation invocation) 24=> invocation.Parent is IArgumentOperation { Parent: IInvocationOperation nextInvocation } ? nextInvocation : null;
src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\CSharpUseIndexOperatorDiagnosticAnalyzer.cs (2)
102var invocationOperation = (IInvocationOperation)context.Operation;
src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\CSharpUseRangeOperatorDiagnosticAnalyzer.cs (9)
82var result = AnalyzeInvocation((IInvocationOperation)operation, infoCache); 92public static Result? AnalyzeInvocation(IInvocationOperation invocation, InfoCache infoCache) 115IInvocationOperation invocation, 138IInvocationOperation invocation, 160IInvocationOperation invocation, 223IInvocationOperation invocation, 272IInvocationOperation invocation, 303private static bool IsValidIndexing(IInvocationOperation invocation, InfoCache infoCache, IMethodSymbol targetMethod) 339private static bool IsWriteableIndexer(IInvocationOperation invocation, IPropertySymbol indexer)
src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\CSharpUseRangeOperatorDiagnosticAnalyzer.Result.cs (2)
28IInvocationOperation invocationOperation, 36public readonly IInvocationOperation InvocationOperation = invocationOperation;
src\Analyzers\CSharp\Analyzers\UsePatternCombinators\CSharpUsePatternCombinatorsDiagnosticAnalyzer.cs (1)
93var isSafe = pattern.Target.UnwrapImplicitConversion() is not Operations.IInvocationOperation;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (2)
1422if (operation is IInvocationOperation { TargetMethod.RefKind: not RefKind.Ref }) 1447semanticModel.GetOperation(invocationExpression, cancellationToken) is IInvocationOperation invocationOperation)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseImplicitTypeHelper.cs (1)
236if (semanticModel.GetOperation(invocationExpression, cancellationToken) is not IInvocationOperation invocationOp)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (5)
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordHelpers.cs (4)
42ReturnedValue: IInvocationOperation 299IInvocationOperation { Arguments: ImmutableArray<IArgumentOperation> args }) 629if (operation is not IInvocationOperation 766(true, IInvocationOperation
src\Analyzers\CSharp\CodeFixes\UseIndexOrRangeOperator\CSharpUseRangeOperatorCodeFixProvider.cs (1)
69if (semanticModel.GetOperation(currentInvocation, cancellationToken) is IInvocationOperation invocation &&
Microsoft.CodeAnalysis.CSharp.Features (24)
ImplementInterface\CSharpImplementExplicitlyCodeRefactoringProvider.cs (1)
108IInvocationOperation invocation => invocation.Instance,
src\Analyzers\CSharp\Analyzers\MakeStructMemberReadOnly\CSharpMakeStructMemberReadOnlyAnalyzer.cs (1)
352if (operation is IInvocationOperation invocationOperation)
src\Analyzers\CSharp\Analyzers\SimplifyLinqExpression\CSharpSimplifyLinqExpressionDiagnosticAnalyzer.cs (3)
21protected override IInvocationOperation? TryGetNextInvocationInChain(IInvocationOperation invocation) 24=> invocation.Parent is IArgumentOperation { Parent: IInvocationOperation nextInvocation } ? nextInvocation : null;
src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\CSharpUseIndexOperatorDiagnosticAnalyzer.cs (2)
102var invocationOperation = (IInvocationOperation)context.Operation;
src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\CSharpUseRangeOperatorDiagnosticAnalyzer.cs (9)
82var result = AnalyzeInvocation((IInvocationOperation)operation, infoCache); 92public static Result? AnalyzeInvocation(IInvocationOperation invocation, InfoCache infoCache) 115IInvocationOperation invocation, 138IInvocationOperation invocation, 160IInvocationOperation invocation, 223IInvocationOperation invocation, 272IInvocationOperation invocation, 303private static bool IsValidIndexing(IInvocationOperation invocation, InfoCache infoCache, IMethodSymbol targetMethod) 339private static bool IsWriteableIndexer(IInvocationOperation invocation, IPropertySymbol indexer)
src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\CSharpUseRangeOperatorDiagnosticAnalyzer.Result.cs (2)
28IInvocationOperation invocationOperation, 36public readonly IInvocationOperation InvocationOperation = invocationOperation;
src\Analyzers\CSharp\Analyzers\UsePatternCombinators\CSharpUsePatternCombinatorsDiagnosticAnalyzer.cs (1)
93var isSafe = pattern.Target.UnwrapImplicitConversion() is not Operations.IInvocationOperation;
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordHelpers.cs (4)
42ReturnedValue: IInvocationOperation 299IInvocationOperation { Arguments: ImmutableArray<IArgumentOperation> args }) 629if (operation is not IInvocationOperation 766(true, IInvocationOperation
src\Analyzers\CSharp\CodeFixes\UseIndexOrRangeOperator\CSharpUseRangeOperatorCodeFixProvider.cs (1)
69if (semanticModel.GetOperation(currentInvocation, cancellationToken) is IInvocationOperation invocation &&
Microsoft.CodeAnalysis.CSharp.IOperation.UnitTests (2)
IOperation\IOperationTests_IArgument.cs (2)
3068var invocation = (IInvocationOperation)operation;
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (1)
Semantics\TopLevelStatementsTests.cs (1)
202Assert.IsAssignableFrom<IInvocationOperation>(operation1);
Microsoft.CodeAnalysis.CSharp.Workspaces (3)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (2)
1422if (operation is IInvocationOperation { TargetMethod.RefKind: not RefKind.Ref }) 1447semanticModel.GetOperation(invocationExpression, cancellationToken) is IInvocationOperation invocationOperation)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseImplicitTypeHelper.cs (1)
236if (semanticModel.GetOperation(invocationExpression, cancellationToken) is not IInvocationOperation invocationOp)
Microsoft.CodeAnalysis.Features (30)
InitializeParameter\AbstractAddParameterCheckCodeRefactoringProvider.cs (1)
296if (condition is IInvocationOperation invocation &&
InlineMethod\AbstractInlineMethodRefactoringProvider.cs (4)
223var invocationOperation = semanticModel.GetOperation(calleeInvocationNode, cancellationToken) as IInvocationOperation; 253IInvocationOperation invocationOperation) 296IInvocationOperation invocationOperation,
InlineMethod\AbstractInlineMethodRefactoringProvider.MethodParametersInfo.cs (1)
159IInvocationOperation invocationOperation,
src\Analyzers\Core\Analyzers\Helpers\HashCodeAnalyzer\HashCodeAnalyzer.OperationDeconstructor.cs (1)
61case IInvocationOperation invocation:
src\Analyzers\Core\Analyzers\QualifyMemberAccess\AbstractQualifyMemberAccessDiagnosticAnalyzer.cs (3)
69case IInvocationOperation invocationOperation: 112IInvocationOperation invocationOperation => invocationOperation.TargetMethod.Kind, 143IInvocationOperation invocationOperation => IsStaticMemberOrIsLocalFunctionHelper(invocationOperation.TargetMethod),
src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (1)
424var targetMethod = ((IInvocationOperation)operationContext.Operation).TargetMethod.OriginalDefinition;
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.BlockAnalyzer.cs (1)
320if (operation.Parent is IInvocationOperation)
src\Analyzers\Core\Analyzers\SimplifyInterpolation\AbstractSimplifyInterpolationHelpers.cs (5)
81if (expression is IInvocationOperation { TargetMethod.Name: nameof(ToString) } invocation && 131private static bool UsesInvariantCultureReferenceInsideFormattableStringInvariant(IInvocationOperation invocation, int formatProviderArgumentIndex) 164Parent: IInvocationOperation 196if (expression is IInvocationOperation invocation && 235private static bool HasNonImplicitInstance(IInvocationOperation invocation, [NotNullWhen(true)] out IOperation? instance)
src\Analyzers\Core\Analyzers\SimplifyLinqExpression\AbstractSimplifyLinqExpressionDiagnosticAnalyzer.cs (9)
49protected abstract IInvocationOperation? TryGetNextInvocationInChain(IInvocationOperation invocation); 129if (context.Operation is not IInvocationOperation invocation) 137if (TryGetNextInvocationInChain(invocation) is not IInvocationOperation nextInvocation || 177bool IsWhereLinqMethod(IInvocationOperation invocation) 180bool IsSelectLinqMethod(IInvocationOperation invocation) 183bool IsInvocationNonEnumerableReturningLinqMethod(IInvocationOperation invocation) 186ITypeSymbol? TryGetSymbolOfMemberAccess(IInvocationOperation invocation) 198string? TryGetMethodName(IInvocationOperation invocation)
ValueTracking\ValueTracker.FindReferencesProgress.cs (1)
184if (operation is not IInvocationOperation invocationOperation)
ValueTracking\ValueTracker.OperationCollector.cs (3)
28IInvocationOperation invocationOperation => VisitInvocationAsync(invocationOperation, cancellationToken), 104private async Task VisitInvocationAsync(IInvocationOperation invocationOperation, CancellationToken cancellationToken) 242or IInvocationOperation)
Microsoft.CodeAnalysis.Test.Utilities (21)
Compilation\ControlFlowGraphVerifier.cs (2)
931Parent: IInvocationOperation 1729case IInvocationOperation invocation:
Compilation\OperationTreeVerifier.cs (3)
819public override void VisitInvocation(IInvocationOperation operation) 821LogString(nameof(IInvocationOperation)); 1044else if (operation.Parent is IInvocationOperation invocation && invocation.Instance == operation)
Compilation\TestOperationVisitor.cs (2)
529public override void VisitInvocation(IInvocationOperation operation) 1354Assert.True(operation.AppendCall is IInvocationOperation or IDynamicInvocationOperation or IInvalidOperation);
Diagnostics\BoxingOperationAnalyzer.cs (2)
60IInvocationOperation invocation = (IInvocationOperation)operation;
Diagnostics\CouldHaveMoreSpecificTypeAnalyzer.cs (2)
87IInvocationOperation invocation = (IInvocationOperation)operationContext.Operation;
Diagnostics\FieldCouldBeReadOnlyAnalyzer.cs (2)
75IInvocationOperation invocation = (IInvocationOperation)operationContext.Operation;
Diagnostics\LocalCouldBeConstAnalyzer.cs (2)
68IInvocationOperation invocation = (IInvocationOperation)operationContext.Operation;
Diagnostics\OperationTestAnalyzer.cs (6)
543IInvocationOperation invocation = (IInvocationOperation)operationContext.Operation; 1100IInvocationOperation invocation = (IInvocationOperation)operationContext.Operation; 1400memberSymbol = ((IInvocationOperation)operation).TargetMethod; 1401receiver = ((IInvocationOperation)operation).Instance;
Microsoft.CodeAnalysis.VisualBasic.CodeStyle (3)
src\Analyzers\VisualBasic\Analyzers\SimplifyLinqExpression\VisualBasicSimplifyLinqExpressionDiagnosticAnalyzer.vb (3)
21Protected Overrides Function TryGetNextInvocationInChain(invocation As IInvocationOperation) As IInvocationOperation 24Return TryCast(invocation.Parent, IInvocationOperation)
Microsoft.CodeAnalysis.VisualBasic.Features (3)
src\Analyzers\VisualBasic\Analyzers\SimplifyLinqExpression\VisualBasicSimplifyLinqExpressionDiagnosticAnalyzer.vb (3)
21Protected Overrides Function TryGetNextInvocationInChain(invocation As IInvocationOperation) As IInvocationOperation 24Return TryCast(invocation.Parent, IInvocationOperation)
Microsoft.CodeAnalysis.Workspaces (2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.DataFlowAnalyzer.FlowGraphAnalysisData.cs (1)
252if (added && operation is IInvocationOperation invocation)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.Walker.cs (1)
320public override void VisitInvocation(IInvocationOperation operation)
Microsoft.Interop.ComInterfaceGenerator (10)
Analyzers\RuntimeComApiUsageWithSourceGeneratedComAnalyzer.cs (9)
53var methodsOfInterest = new Dictionary<ISymbol, ImmutableArray<Func<IInvocationOperation, (ITypeSymbol, Location)?>>>(SymbolEqualityComparer.Default); 106var operation = (IInvocationOperation)context.Operation; 108if (methodsOfInterest.TryGetValue(operation.TargetMethod.OriginalDefinition, out ImmutableArray<Func<IInvocationOperation, (ITypeSymbol, Location)?>> discoverers)) 110foreach (Func<IInvocationOperation, (ITypeSymbol, Location)?> discoverer in discoverers) 186else if (operand is IInvocationOperation invocation && invocation.TargetMethod.Equals(getObjectForIUnknown, SymbolEqualityComparer.Default)) 200static Func<IInvocationOperation, (ITypeSymbol Type, Location location)?> CreateArgumentTypeLookup(int ordinal) => invocation => invocation.GetArgumentByOrdinal(ordinal).Value switch 206static Func<IInvocationOperation, (ITypeSymbol Type, Location location)?> CreateTypeArgumentTypeLookup(int ordinal) => invocation => 235static Func<IInvocationOperation, (ITypeSymbol Type, Location location)?> CreateTypeOfArgumentTypeLookup(int ordinal) => invocation => invocation.GetArgumentByOrdinal(ordinal).Value switch
src\libraries\System.Runtime.InteropServices\gen\Common\OperationExtensions.cs (1)
12public static IArgumentOperation? GetArgumentByOrdinal(this IInvocationOperation operation, int ordinal)
Microsoft.Interop.LibraryImportGenerator (1)
src\libraries\System.Runtime.InteropServices\gen\Common\OperationExtensions.cs (1)
12public static IArgumentOperation? GetArgumentByOrdinal(this IInvocationOperation operation, int ordinal)
Microsoft.Interop.LibraryImportGenerator.Downlevel (1)
src\libraries\System.Runtime.InteropServices\gen\Common\OperationExtensions.cs (1)
12public static IArgumentOperation? GetArgumentByOrdinal(this IInvocationOperation operation, int ordinal)
Microsoft.VisualStudio.LanguageServices (1)
PullMemberUp\SymbolDependentsBuilder.cs (1)
81if (operation is IInvocationOperation methodReferenceOp &&
Roslyn.Compilers.VisualBasic.IOperation.UnitTests (1)
IOperation\IOperationTests_IArgument.vb (1)
1093Dim invocation = CType(result.operation, IInvocationOperation)
System.Private.CoreLib.Generators (1)
IntrinsicsInSystemPrivateCoreLibAnalyzer.cs (1)
193IInvocationOperation iOperation => iOperation.TargetMethod,
System.Text.RegularExpressions.Generator (3)
UpgradeToGeneratedRegexAnalyzer.cs (2)
93IInvocationOperation invocationOperation = (IInvocationOperation)context.Operation;
UpgradeToGeneratedRegexCodeFixer.cs (1)
162if (operation is IInvocationOperation invocationOperation) // When using a Regex static method