1 implementation of IArgumentOperation
Microsoft.CodeAnalysis (1)
Generated\Operations.Generated.cs (1)
7952internal sealed partial class ArgumentOperation : Operation, IArgumentOperation
670 references to IArgumentOperation
Aspire.Hosting.Analyzers (2)
AppHostAnalyzer.cs (2)
125IArgumentOperation? argumentOperation = null; 126foreach (var argument in invocation.Arguments)
ConfigurationSchemaGenerator (4)
RuntimeSource\Configuration.Binder\Parser\ConfigurationBinder.cs (4)
81IArgumentOperation instanceArg = GetArgumentForParameterAtIndex(operation.Arguments, instanceIndex); 120private static IArgumentOperation GetArgumentForParameterAtIndex(ImmutableArray<IArgumentOperation> arguments, int parameterIndex) 122foreach (var argument in arguments)
GenerateDocumentationAndConfigFiles (9)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\IOperationExtensions.cs (7)
38var firstArg = invocation.Arguments.FirstOrDefault(); 491this ImmutableArray<IArgumentOperation> arguments, 493[NotNullWhen(true)] out IArgumentOperation? result) 498foreach (var argument in arguments) 511public static IArgumentOperation GetArgumentForParameterAtIndex( 512this ImmutableArray<IArgumentOperation> arguments, 515if (TryGetArgumentForParameterAtIndex(arguments, parameterIndex, out var result))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\OperationExtensions.cs (1)
162else if (operation.Parent is IArgumentOperation argumentOperation)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.Walker.cs (1)
358public override void VisitArgument(IArgumentOperation operation)
ILLink.RoslynAnalyzer (9)
DataFlow\FeatureChecksVisitor.cs (1)
42public override FeatureChecksValue VisitArgument(IArgumentOperation operation, StateValue state)
DataFlow\LocalDataFlowVisitor.cs (7)
187return ProcessMethodCall(operation, method, null, ImmutableArray<IArgumentOperation>.Empty, state); 323foreach (var val in propertyRef.Arguments) 731foreach (var val in operation.Arguments) 797public override TValue VisitArgument(IArgumentOperation operation, LocalDataFlowState<TValue, TContext, TValueLattice, TContextLattice> state) 892IArgumentOperation argumentOperation; 926ImmutableArray<IArgumentOperation> arguments, 946foreach (var argument in arguments)
IOperationExtensions.cs (1)
136else if (operation.Parent is IArgumentOperation argumentOperation)
Microsoft.Analyzers.Extra (6)
AsyncCallInsideUsingBlockAnalyzer.cs (1)
209foreach (var argument in invocation.Arguments)
CallAnalysis\Fixers\LegacyLoggingFixer.cs (3)
398var paramsArg = invocationOp.Arguments[details.ArgsParamIndex]; 447var paramsArg = invocationOp.Arguments[details.ArgsParamIndex]; 480foreach (var arg in invocation!.Arguments)
CallAnalysis\Fixers\LegacyLoggingFixer.FixDetails.cs (1)
44var op = invocationOp.Arguments[MessageParamIndex];
UsingToStringInLoggersAnalyzer.cs (1)
64foreach (var arg in invocation.Arguments)
Microsoft.Analyzers.Local (1)
CallAnalysis\ToInvariantString.cs (1)
41var a = op.Arguments[0];
Microsoft.AspNetCore.App.Analyzers (16)
Authorization\AddAuthorizationBuilderAnalyzer.cs (3)
70if (TryGetConfigureArgumentOperation(invocation, out var configureArgumentOperation) 88private static bool TryGetConfigureArgumentOperation(IInvocationOperation invocation, [NotNullWhen(true)] out IArgumentOperation? configureArgumentOperation) 101private static bool TryGetConfigureDelegateCreationOperation(IArgumentOperation configureArgumentOperation, [NotNullWhen(true)] out IDelegateCreationOperation? configureDelegateCreationOperation)
Kestrel\ListenOnIPv6AnyAnalyzer.cs (1)
47var addressArgument = kestrelOptionsListenInvocation?.Arguments.FirstOrDefault();
RenderTreeBuilder\RenderTreeBuilderAnalyzer.cs (1)
39foreach (var argument in invocation.Arguments)
RouteHandlers\DetectAmbiguousRoutes.cs (5)
62if (current.Parent is IArgumentOperation { Parent: IInvocationOperation invocationOperation } && 77IArgumentOperation or 235private static bool AreArgumentsEqual(IMethodSymbol method, ImmutableArray<IArgumentOperation> arguments1, ImmutableArray<IArgumentOperation> arguments2) 271static IOperation? GetParameterArgument(IParameterSymbol parameter, ImmutableArray<IArgumentOperation> arguments)
RouteHandlers\RouteHandlerAnalyzer.cs (4)
78foreach (var argument in invocation.Arguments) 175IArgumentOperation? argumentOperation = null; 176foreach (var argument in invocation.Arguments) 227var builderArgument = operation.Arguments.SingleOrDefault(a => a.Parameter?.Ordinal == 0);
src\aspnetcore\src\Shared\Roslyn\CodeAnalysisExtensions.cs (1)
187var firstArg = invocation.Arguments.FirstOrDefault();
WebApplicationBuilder\WebApplicationBuilderAnalyzer.cs (1)
366foreach (var argument in invocation.Arguments)
Microsoft.AspNetCore.Components.Analyzers (3)
ForLoopIteratorInClosureAnalyzer.cs (1)
247if (currentOperation is IArgumentOperation
StateHasChangedAnalyzer.cs (1)
69foreach (var argument in invocation.Arguments)
VirtualizeItemComparerAnalyzer.cs (1)
92var nameArg = invocation.Arguments[1];
Microsoft.AspNetCore.Http.RequestDelegateGenerator (5)
StaticRouteHandlerModel\InvocationOperationExtensions.cs (5)
32targetOperation.TryGetRouteHandlerArgument(out var routeHandlerParameter) && 45if (invocation.TryGetRouteHandlerArgument(out var argument)) 53public static bool TryGetRouteHandlerArgument(this IInvocationOperation invocation, [NotNullWhen(true)] out IArgumentOperation? argumentOperation) 59foreach (var argument in invocation.Arguments) 92IArgumentOperation argument => ResolveMethodFromOperation(argument.Value, semanticModel),
Microsoft.AspNetCore.Mvc.Analyzers (1)
src\aspnetcore\src\Shared\Roslyn\CodeAnalysisExtensions.cs (1)
187var firstArg = invocation.Arguments.FirstOrDefault();
Microsoft.AspNetCore.Mvc.Api.Analyzers (3)
ActualApiResponseMetadataFactory.cs (2)
191private static (int? statusCode, ITypeSymbol? returnType) InspectMethodArguments(ImmutableArray<IArgumentOperation> arguments) 196foreach (var argument in arguments)
src\aspnetcore\src\Shared\Roslyn\CodeAnalysisExtensions.cs (1)
187var firstArg = invocation.Arguments.FirstOrDefault();
Microsoft.CodeAnalysis (78)
Generated\OperationKind.Generated.cs (1)
182/// <summary>Indicates an <see cref="IArgumentOperation"/>.</summary>
Generated\Operations.Generated.cs (21)
663ImmutableArray<IArgumentOperation> Arguments { get; } 797ImmutableArray<IArgumentOperation> Arguments { get; } 1006ImmutableArray<IArgumentOperation> Arguments { get; } 1291ImmutableArray<IArgumentOperation> Arguments { get; } 3756ImmutableArray<IArgumentOperation> Arguments { get; } 3960/// <see cref="IArgumentOperation" />; otherwise, they can be any operation. 3967/// That final argument will be represented by an <see cref="IArgumentOperation" /> whose 'Value' is an 4019/// which contains the elements as they appear in source. This will appear as the 'Value' of an <see cref="IArgumentOperation" /> 5050internal RaiseEventOperation(IEventReferenceOperation eventReference, ImmutableArray<IArgumentOperation> arguments, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit) 5057public ImmutableArray<IArgumentOperation> Arguments { get; } 5194internal InvocationOperation(IMethodSymbol targetMethod, ITypeSymbol? constrainedToType, IOperation? instance, bool isVirtual, ImmutableArray<IArgumentOperation> arguments, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 5208public ImmutableArray<IArgumentOperation> Arguments { get; } 5496internal PropertyReferenceOperation(IPropertySymbol property, ITypeSymbol? constrainedToType, ImmutableArray<IArgumentOperation> arguments, IOperation? instance, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 5506public ImmutableArray<IArgumentOperation> Arguments { get; } 5957internal ObjectCreationOperation(IMethodSymbol? constructor, IObjectOrCollectionInitializerOperation? initializer, ImmutableArray<IArgumentOperation> arguments, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, ConstantValue? constantValue, bool isImplicit) 5968public ImmutableArray<IArgumentOperation> Arguments { get; } 10330internal FunctionPointerInvocationOperation(IOperation target, ImmutableArray<IArgumentOperation> arguments, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit) 10338public ImmutableArray<IArgumentOperation> Arguments { get; } 11228public override IOperation VisitArgument(IArgumentOperation operation, object? argument) 11570public virtual void VisitArgument(IArgumentOperation operation) => DefaultVisit(operation); 11711public virtual TResult? VisitArgument(IArgumentOperation operation, TArgument argument) => DefaultVisit(operation, argument);
Operations\ControlFlowGraphBuilder.cs (46)
2045private ImmutableArray<IArgumentOperation> VisitArguments(ImmutableArray<IArgumentOperation> arguments, bool instancePushed) 2053private void VisitAndPushArguments(ImmutableArray<IArgumentOperation> arguments, bool instancePushed) 2100private IArgumentOperation RewriteArgumentFromArray(IOperation visitedArgument, int index, ImmutableArray<IArgumentOperation> args) 3354ImmutableArray<IArgumentOperation>.Empty, semanticModel: null, value.Syntax, 3965private void HandleUsingOperationParts(IOperation resources, IOperation body, IMethodSymbol? disposeMethod, ImmutableArray<IArgumentOperation> disposeArguments, ImmutableArray<ILocalSymbol> locals, bool isAsynchronous, 4123private void AddDisposingFinally(IOperation resource, bool requiresRuntimeConversion, ITypeSymbol iDisposable, IMethodSymbol? disposeMethod, ImmutableArray<IArgumentOperation> disposeArguments, bool isAsynchronous) 4188ImmutableArray<IArgumentOperation> args; 4197args = ImmutableArray<IArgumentOperation>.Empty; 4242disposeArguments: ImmutableArray<IArgumentOperation>.Empty, 4256arguments: ImmutableArray<IArgumentOperation>.Empty, 4354ImmutableArray.Create<IArgumentOperation>( 4382ImmutableArray.Create<IArgumentOperation>( 4437ImmutableArray.Create<IArgumentOperation>( 4706InvocationOperation makeInvocationDroppingInstanceForStaticMethods(IMethodSymbol method, IOperation instance, ImmutableArray<IArgumentOperation> arguments) 4711InvocationOperation makeInvocation(SyntaxNode syntax, IMethodSymbol method, IOperation? instanceOpt, ImmutableArray<IArgumentOperation> arguments) 4721ImmutableArray<IArgumentOperation> makeArguments(ImmutableArray<IArgumentOperation> arguments, ref IOperation? instance) 4736return ImmutableArray<IArgumentOperation>.Empty; 4817var builder = ArrayBuilder<IArgumentOperation>.GetInstance(parametersCount, fillWithValue: null!); 5942(IOperation? visitedInstance, ImmutableArray<IArgumentOperation> visitedArguments) = VisitInstanceWithArguments(instance, operation.Arguments); 5957(IOperation visitedInstance, ImmutableArray<IArgumentOperation> visitedArguments) handlePointerAndArguments( 5958IOperation targetPointer, ImmutableArray<IArgumentOperation> arguments) 5962ImmutableArray<IArgumentOperation> visitedArguments = VisitArguments(arguments, instancePushed: false); 5969private (IOperation? visitedInstance, ImmutableArray<IArgumentOperation> visitedArguments) VisitInstanceWithArguments(IOperation? instance, ImmutableArray<IArgumentOperation> arguments) 5977ImmutableArray<IArgumentOperation> visitedArguments = VisitArguments(arguments, instancePushed: hasInstance); 5995ImmutableArray<IArgumentOperation> visitedArgs = VisitArguments(operation.Arguments, instancePushed: false); 6254ImmutableArray<IArgumentOperation> propertyArguments = PopArray(propertyReference.Arguments, RewriteArgumentFromArray); 6314foreach (var argument in propertyReference.Arguments) 6411IOperation visitedTarget = new PropertyReferenceOperation(propertyReference.Property, propertyReference.ConstrainedToType, ImmutableArray<IArgumentOperation>.Empty, visitedPropertyInstance, 6557if (operation.ConstructArguments.Any(a => a is IArgumentOperation) && !operation.ConstructArguments.All(a => a is IArgumentOperation)) 6563var arguments = operation.ConstructArguments.As<IArgumentOperation>(); 6847IArgumentOperation? outParameterArgument = null; 7197(IOperation? visitedInstance, ImmutableArray<IArgumentOperation> visitedArguments) = VisitInstanceWithArguments(instance, operation.Arguments); 7279ImmutableArray<IArgumentOperation> arguments; 7283var builder = ArrayBuilder<IArgumentOperation>.GetInstance(propertySymbol.Parameters.Length); 7299arguments = ImmutableArray<IArgumentOperation>.Empty; 7387(IOperation? visitedInstance, ImmutableArray<IArgumentOperation> visitedArguments) = 7839matchFailureCtor, initializer: null, ImmutableArray<IArgumentOperation>.Empty, semanticModel: null, operation.Syntax, 7947public override IOperation VisitArgument(IArgumentOperation operation, int? captureIdForResult) 7977isVirtual: true, arguments: ImmutableArray<IArgumentOperation>.Empty, 8079var visitedValue = new PropertyReferenceOperation(property, constrainedToType: null, ImmutableArray<IArgumentOperation>.Empty, oldInstance, 8105var target = new PropertyReferenceOperation(property, constrainedToType: null, ImmutableArray<IArgumentOperation>.Empty, implicitReceiver,
Operations\DisposeOperationInfo.cs (2)
12public readonly ImmutableArray<IArgumentOperation> DisposeArguments; 14public DisposeOperationInfo(IMethodSymbol? disposeMethod, ImmutableArray<IArgumentOperation> disposeArguments)
Operations\Loops\ForEachLoopOperationInfo.cs (8)
38public readonly ImmutableArray<IArgumentOperation> GetEnumeratorArguments; 39public readonly ImmutableArray<IArgumentOperation> MoveNextArguments; 40public readonly ImmutableArray<IArgumentOperation> CurrentArguments; 41public readonly ImmutableArray<IArgumentOperation> DisposeArguments; 56ImmutableArray<IArgumentOperation> getEnumeratorArguments = default, 57ImmutableArray<IArgumentOperation> moveNextArguments = default, 58ImmutableArray<IArgumentOperation> currentArguments = default, 59ImmutableArray<IArgumentOperation> disposeArguments = default)
Microsoft.CodeAnalysis.Analyzers (42)
FixAnalyzers\FixerWithFixAllAnalyzer.cs (1)
264foreach (var argument in invocation.Arguments)
MetaAnalyzers\DiagnosticDescriptorCreationAnalyzer_IdRangeAndCategoryValidation.cs (3)
67IArgumentOperation argument, 138ImmutableArray<IArgumentOperation> creationArguments, 147foreach (var argument in creationArguments)
MetaAnalyzers\DiagnosticDescriptorCreationAnalyzer_ReleaseTracking.cs (1)
276IArgumentOperation ruleIdArgument,
MetaAnalyzers\DiagnosticDescriptorCreationAnalyzer.cs (27)
31using PooledLocalizabeStringsConcurrentDictionary = PooledConcurrentDictionary<INamedTypeSymbol, PooledConcurrentSet<(IFieldSymbol field, IArgumentOperation argument)>>; 528[NotNullWhen(returnValue: true)] out ImmutableArray<IArgumentOperation> creationArguments) 617ImmutableArray<IArgumentOperation> creationArguments, 625IArgumentOperation? titleArgument = creationArguments.FirstOrDefault(a => a.Parameter?.Name.Equals("title", StringComparison.OrdinalIgnoreCase) == true); 639private static void AnalyzeTitleCore(string title, IArgumentOperation argumentOperation, Location fixLocation, Action<Diagnostic> reportDiagnostic) 665IArgumentOperation argumentOperation, 720ImmutableArray<IArgumentOperation> creationArguments, 727var messageArgument = creationArguments.FirstOrDefault(a => a.Parameter?.Name.Equals("messageFormat", StringComparison.OrdinalIgnoreCase) == true); 736private static void AnalyzeMessageCore(string message, IArgumentOperation argumentOperation, Location fixLocation, Action<Diagnostic> reportDiagnostic) 767ImmutableArray<IArgumentOperation> creationArguments, 774IArgumentOperation? descriptionArgument = creationArguments.FirstOrDefault(a => a.Parameter?.Name.Equals("description", StringComparison.OrdinalIgnoreCase) == true); 783private static void AnalyzeDescriptionCore(string description, IArgumentOperation argumentOperation, Location fixLocation, Action<Diagnostic> reportDiagnostic) 804IArgumentOperation argument, 805Action<string, IArgumentOperation, Location, Action<Diagnostic>> analyzeStringValueCore, 834var builder = localizableStringsMap.GetOrAdd(containingType, _ => PooledConcurrentSet<(IFieldSymbol, IArgumentOperation)>.GetInstance()); 842Action<string, IArgumentOperation, Location, Action<Diagnostic>> analyzeStringValueCore, 845IArgumentOperation argument, 860Action<string, IArgumentOperation, Location, Action<Diagnostic>> analyzeLocalizableStringValueCore, 884IArgumentOperation argumentOperation, 1029ImmutableArray<IArgumentOperation> creationArguments, 1035foreach (var argument in creationArguments) 1056ImmutableArray<IArgumentOperation> creationArguments, 1066var argument = creationArguments.FirstOrDefault( 1107private static (bool? isEnabledByDefault, DiagnosticSeverity? defaultSeverity) GetDefaultSeverityAndEnabledByDefault(Compilation compilation, ImmutableArray<IArgumentOperation> creationArguments) 1115foreach (var argument in creationArguments) 1184ImmutableArray<IArgumentOperation> creationArguments, 1200foreach (var argument in creationArguments)
MetaAnalyzers\Fixers\CompareSymbolsCorrectlyFix.cs (1)
117ImmutableArray<IArgumentOperation> arguments, bool isUsedAsExtensionMethod, Func<SyntaxGenerator, IEnumerable<SyntaxNode>, SyntaxNode> getReplacementNode,
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\IOperationExtensions.cs (7)
38var firstArg = invocation.Arguments.FirstOrDefault(); 491this ImmutableArray<IArgumentOperation> arguments, 493[NotNullWhen(true)] out IArgumentOperation? result) 498foreach (var argument in arguments) 511public static IArgumentOperation GetArgumentForParameterAtIndex( 512this ImmutableArray<IArgumentOperation> arguments, 515if (TryGetArgumentForParameterAtIndex(arguments, parameterIndex, out var result))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\OperationExtensions.cs (1)
162else if (operation.Parent is IArgumentOperation argumentOperation)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.Walker.cs (1)
358public override void VisitArgument(IArgumentOperation operation)
Microsoft.CodeAnalysis.AnalyzerUtilities (82)
src\1e7e9f16bf7f1945\ValueContentAnalysis.ValueContentDataFlowOperationVisitor.cs (1)
273ImmutableArray<IArgumentOperation> visitedArguments,
src\2e2796bccd1466f6\TaintedDataAnalysis.TaintedDataOperationVisitor.cs (16)
252IEnumerable<IArgumentOperation> taintedArguments = GetTaintedArguments(operation.Arguments); 264ImmutableArray<IArgumentOperation> visitedArguments, 278IEnumerable<IArgumentOperation> taintedArguments = GetTaintedArguments(visitedArguments); 320IArgumentOperation? argumentOperation = visitedArguments.FirstOrDefault(o => o.Parameter?.Name == taintedTarget); 399IArgumentOperation? thenSanitizedTargetOperation = visitedArguments.FirstOrDefault(o => o.Parameter?.Name == thenSanitizedTarget); 423public override TaintedDataAbstractValue VisitInvocation_LocalFunction(IMethodSymbol localFunction, ImmutableArray<IArgumentOperation> visitedArguments, IOperation originalOperation, TaintedDataAbstractValue defaultValue) 428IEnumerable<IArgumentOperation> taintedArguments = GetTaintedArguments(visitedArguments); 437public override TaintedDataAbstractValue VisitInvocation_Lambda(IFlowAnonymousFunctionOperation lambda, ImmutableArray<IArgumentOperation> visitedArguments, IOperation originalOperation, TaintedDataAbstractValue defaultValue) 442IEnumerable<IArgumentOperation> taintedArguments = GetTaintedArguments(visitedArguments); 460IArgumentOperation operation, 560IEnumerable<IArgumentOperation> taintedArguments, 568foreach (IArgumentOperation taintedArgument in taintedArguments) 631ImmutableArray<IArgumentOperation> arguments, 683private static bool IsMethodArgumentASink(IMethodSymbol method, IEnumerable<SinkInfo> infosForType, IArgumentOperation taintedArgument, [NotNullWhen(returnValue: true)] out HashSet<SinkKind>? sinkKinds) 753private IEnumerable<IArgumentOperation> GetTaintedArguments(ImmutableArray<IArgumentOperation> arguments)
src\66dd3055a1c91c38\PointsToAnalysis.PointsToDataFlowOperationVisitor.cs (6)
287protected override PointsToAbstractValue ComputeAnalysisValueForEscapedRefOrOutArgument(AnalysisEntity analysisEntity, IArgumentOperation operation, PointsToAbstractValue defaultValue) 300protected override void PostProcessArgument(IArgumentOperation operation, bool isEscaped) 943ImmutableArray<IArgumentOperation> visitedArguments, 954foreach (var argument in visitedArguments) 1028ImmutableArray<IArgumentOperation> visitedArguments, 1038ImmutableArray<IArgumentOperation> visitedArguments,
src\683181b2796de991\ParameterValidationAnalysis.ParameterValidationDataFlowOperationVisitor.cs (6)
253ImmutableArray<IArgumentOperation> visitedArguments, 265ImmutableArray<IArgumentOperation> visitedArguments, 276ImmutableArray<IArgumentOperation> visitedArguments, 285private void ProcessRegularInvocationOrCreation(IMethodSymbol? targetMethod, ImmutableArray<IArgumentOperation> arguments, IOperation operation) 324foreach (var argument in arguments) 343foreach (var argument in arguments)
src\97c55a67c449f67c\GlobalFlowStateValueSetFlowOperationVisitor.cs (1)
111ImmutableArray<IArgumentOperation> visitedArguments,
src\a03b2aad21e28a8a\PropertySetAnalysis.PropertySetDataFlowOperationVisitor.cs (8)
164foreach (IArgumentOperation argumentOperation in operation.Arguments) 177foreach (IArgumentOperation argumentOperation in operation.Arguments) 456public override PropertySetAbstractValue VisitInvocation_NonLambdaOrDelegateOrLocalFunction(IMethodSymbol method, IOperation? visitedInstance, ImmutableArray<IArgumentOperation> visitedArguments, bool invokedAsDelegate, IOperation originalOperation, PropertySetAbstractValue defaultValue) 463foreach (IArgumentOperation visitedArgument in visitedArguments) 514ImmutableArray<IArgumentOperation> visitedArguments, 530foreach (IArgumentOperation argumentOperation in visitedArguments) 635public override PropertySetAbstractValue VisitInvocation_LocalFunction(IMethodSymbol localFunction, ImmutableArray<IArgumentOperation> visitedArguments, IOperation originalOperation, PropertySetAbstractValue defaultValue) 643public override PropertySetAbstractValue VisitInvocation_Lambda(IFlowAnonymousFunctionOperation lambda, ImmutableArray<IArgumentOperation> visitedArguments, IOperation originalOperation, PropertySetAbstractValue defaultValue)
src\a172c07bebba4cd8\DisposeAnalysis.DisposeDataFlowOperationVisitor.cs (3)
188protected override DisposeAbstractValue ComputeAnalysisValueForEscapedRefOrOutArgument(IArgumentOperation operation, DisposeAbstractValue defaultValue) 260ImmutableArray<IArgumentOperation> visitedArguments, 327protected override void PostProcessArgument(IArgumentOperation operation, bool isEscaped)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\IOperationExtensions.cs (7)
38var firstArg = invocation.Arguments.FirstOrDefault(); 491this ImmutableArray<IArgumentOperation> arguments, 493[NotNullWhen(true)] out IArgumentOperation? result) 498foreach (var argument in arguments) 511public static IArgumentOperation GetArgumentForParameterAtIndex( 512this ImmutableArray<IArgumentOperation> arguments, 515if (TryGetArgumentForParameterAtIndex(arguments, parameterIndex, out var result))
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\CopyAnalysis\CopyAnalysis.CopyDataFlowOperationVisitor.cs (1)
317protected override CopyAbstractValue ComputeAnalysisValueForEscapedRefOrOutArgument(AnalysisEntity analysisEntity, IArgumentOperation operation, CopyAbstractValue defaultValue)
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\DisposeAnalysis\DisposeAnalysisHelper.cs (1)
160operation.Parent is IArgumentOperation argument && argument.Parameter?.RefKind == RefKind.Out) &&
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\TaintedDataAnalysis\SourceInfo.cs (1)
16internal delegate bool MethodMatcher(string methodName, ImmutableArray<IArgumentOperation> arguments);
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\TaintedDataAnalysis\TaintedDataSymbolMapExtensions.cs (2)
37ImmutableArray<IArgumentOperation> arguments, 185ImmutableArray<IArgumentOperation> arguments,
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\AbstractLocation.cs (2)
163_ => ImmutableArray<IArgumentOperation>.Empty, 166foreach (var argument in arguments)
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\AbstractLocationDataFlowOperationVisitor.cs (1)
67protected override TAbstractAnalysisValue ComputeAnalysisValueForEscapedRefOrOutArgument(IArgumentOperation operation, TAbstractAnalysisValue defaultValue)
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\AnalysisEntityDataFlowOperationVisitor.cs (2)
64protected sealed override TAbstractAnalysisValue ComputeAnalysisValueForEscapedRefOrOutArgument(IArgumentOperation operation, TAbstractAnalysisValue defaultValue) 80protected virtual TAbstractAnalysisValue ComputeAnalysisValueForEscapedRefOrOutArgument(AnalysisEntity analysisEntity, IArgumentOperation operation, TAbstractAnalysisValue defaultValue)
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\AnalysisEntityFactory.cs (1)
198case IArgumentOperation argument:
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\DataFlowOperationVisitor.cs (21)
49private readonly HashSet<IArgumentOperation> _pendingArgumentsToReset; 50private readonly List<IArgumentOperation> _pendingArgumentsToPostProcess; 977private bool IsContractCheckArgument(IArgumentOperation operation) 1216protected virtual TAbstractAnalysisValue ComputeAnalysisValueForEscapedRefOrOutArgument(IArgumentOperation operation, TAbstractAnalysisValue defaultValue) 1491Debug.Assert(IsContractCheckArgument((IArgumentOperation)operation)); 1669case IArgumentOperation argument: 2205ImmutableArray<IArgumentOperation> arguments, 2402foreach (var argument in arguments) 2519foreach (var argument in arguments) 2550IParameterSymbol GetMappedParameterForArgument(IArgumentOperation argumentOperation) 2783foreach (IArgumentOperation argumentOperation in pendingArguments) 3072public sealed override TAbstractAnalysisValue VisitArgument(IArgumentOperation operation, object? argument) 3097protected virtual void PostProcessArgument(IArgumentOperation operation, bool isEscaped) 3104/// This method resets the analysis data for an object instance passed around as an <see cref="IArgumentOperation"/> 3107private void PostProcessEscapedArgument(IArgumentOperation operation) 3227void PostVisitInvocation(IMethodSymbol targetMethod, ImmutableArray<IArgumentOperation> arguments) 3252void ProcessInterlockedOperation(IMethodSymbol targetMethod, ImmutableArray<IArgumentOperation> arguments, INamedTypeSymbol interlockedType) 3267foreach (var argument in arguments) 3536ImmutableArray<IArgumentOperation> visitedArguments, 3578ImmutableArray<IArgumentOperation> visitedArguments, 3596ImmutableArray<IArgumentOperation> visitedArguments,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\OperationExtensions.cs (1)
162else if (operation.Parent is IArgumentOperation argumentOperation)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.Walker.cs (1)
358public override void VisitArgument(IArgumentOperation operation)
Microsoft.CodeAnalysis.CodeStyle (5)
src\roslyn\src\Analyzers\Core\Analyzers\SimplifyInterpolation\AbstractSimplifyInterpolationDiagnosticAnalyzer.cs (1)
69conversion.Parent is IArgumentOperation { Parent: IInvocationOperation invocation } &&
src\roslyn\src\Analyzers\Core\Analyzers\SimplifyInterpolation\AbstractSimplifyInterpolationHelpers.cs (2)
235return Unwrap(interpolatedStringOperation?.Parent, towardsParent: true) is IArgumentOperation 322private static bool IsSpaceChar(IArgumentOperation argument)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\OperationExtensions.cs (1)
162else if (operation.Parent is IArgumentOperation argumentOperation)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.Walker.cs (1)
358public override void VisitArgument(IArgumentOperation operation)
Microsoft.CodeAnalysis.CSharp (24)
Operations\CSharpOperationFactory_Methods.cs (12)
36internal IArgumentOperation CreateArgumentOperation(ArgumentKind kind, IParameterSymbol? parameter, BoundExpression expression) 194internal ImmutableArray<IArgumentOperation> DeriveArguments(BoundNode containingExpression) 264private ImmutableArray<IArgumentOperation> DeriveArguments( 276return ImmutableArray<IArgumentOperation>.Empty; 288private static ImmutableArray<IArgumentOperation> MakeArgumentsInEvaluationOrder( 308ArrayBuilder<IArgumentOperation> argumentsBuilder = ArrayBuilder<IArgumentOperation>.GetInstance(arguments.Length); 359private static ImmutableArray<IArgumentOperation> BuildArgumentsInEvaluationOrder( 368ArrayBuilder<IArgumentOperation> argumentsInEvaluationBuilder = ArrayBuilder<IArgumentOperation>.GetInstance(parameters.Length); 443arguments: ImmutableArray<IArgumentOperation>.Empty, 455ImmutableArray<IArgumentOperation>.Empty,
Operations\CSharpOperationFactory.cs (12)
464ImmutableArray<IArgumentOperation> arguments = DeriveArguments(boundCall); 622var arguments = ImmutableArray<IArgumentOperation>.Empty; 644ImmutableArray<IArgumentOperation> arguments = DeriveArguments(boundIndexerAccess); 737ImmutableArray<IArgumentOperation> arguments = DeriveArguments(boundObjectCreationExpression); 894ImmutableArray<IArgumentOperation> arguments; 912arguments = ImmutableArray<IArgumentOperation>.Empty; 942ImmutableArray<IArgumentOperation> arguments = DeriveArguments(boundCollectionElementInitializer); 1998ImmutableArray<IArgumentOperation> createArgumentOperations(MethodArgumentInfo? info) 2006return ImmutableArray<IArgumentOperation>.Empty; 2973reference = new PropertyReferenceOperation(property.GetPublicSymbol(), constrainedToType: null, ImmutableArray<IArgumentOperation>.Empty, 3006private ImmutableArray<IArgumentOperation> CreateDisposeArguments(MethodArgumentInfo patternDisposeInfo) 3013return ImmutableArray<IArgumentOperation>.Empty;
Microsoft.CodeAnalysis.CSharp.CodeStyle (3)
src\roslyn\src\Analyzers\CSharp\Analyzers\SimplifyLinqExpression\CSharpSimplifyLinqExpressionDiagnosticAnalyzer.cs (1)
29=> invocation.Parent is IArgumentOperation { Parent: IInvocationOperation nextInvocation } ? nextInvocation : null;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (1)
1633var argument = invocationOperation.Arguments.FirstOrDefault(a => Equals(originalParameter, a.Parameter));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseImplicitTypeHelper.cs (1)
223var argumentOp = invocationOp.Arguments.FirstOrDefault(a => a.Syntax == argument);
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (5)
src\roslyn\src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordHelpers.cs (5)
46Arguments: [IArgumentOperation { Value: IOperation arg }] 299IInvocationOperation { Arguments: ImmutableArray<IArgumentOperation> args }) 303foreach (var arg in args) 373Arguments: ImmutableArray<IArgumentOperation> { IsEmpty: true }, 632Arguments: [IArgumentOperation { Value: IOperation arg }]
Microsoft.CodeAnalysis.CSharp.Features (6)
src\roslyn\src\Analyzers\CSharp\Analyzers\SimplifyLinqExpression\CSharpSimplifyLinqExpressionDiagnosticAnalyzer.cs (1)
29=> invocation.Parent is IArgumentOperation { Parent: IInvocationOperation nextInvocation } ? nextInvocation : null;
src\roslyn\src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordHelpers.cs (5)
46Arguments: [IArgumentOperation { Value: IOperation arg }] 299IInvocationOperation { Arguments: ImmutableArray<IArgumentOperation> args }) 303foreach (var arg in args) 373Arguments: ImmutableArray<IArgumentOperation> { IsEmpty: true }, 632Arguments: [IArgumentOperation { Value: IOperation arg }]
Microsoft.CodeAnalysis.CSharp.NetAnalyzers (11)
Microsoft.NetCore.Analyzers\Performance\CSharpRecommendCaseInsensitiveStringComparisonFixer.cs (1)
54foreach (IArgumentOperation arg in mainInvocationOperation.Arguments)
Microsoft.NetCore.Analyzers\Performance\CSharpUseStringMethodCharOverloadWithSingleCharacters.Fixer.cs (3)
33var argumentOperation = model.GetOperation(argument) as IArgumentOperation; 78.Select(arg => (arg, operation: model.GetOperation(arg) as IArgumentOperation))
Microsoft.NetCore.Analyzers\Runtime\CSharpForwardCancellationTokenToInvocations.Analyzer.cs (1)
34protected override bool ArgumentsImplicitOrNamed(INamedTypeSymbol cancellationTokenType, ImmutableArray<IArgumentOperation> arguments)
Microsoft.NetCore.Analyzers\Runtime\CSharpForwardCancellationTokenToInvocations.Fixer.cs (1)
40protected override bool IsArgumentNamed(IArgumentOperation argumentOperation)
Microsoft.NetCore.Analyzers\Runtime\CSharpPreferStreamAsyncMemoryOverloads.Fixer.cs (1)
41IArgumentOperation? operation = args.FirstOrDefault(argOperation =>
Microsoft.NetCore.Analyzers\Runtime\CSharpUseSpanBasedStringConcat.Fixer.cs (1)
29private protected override bool IsNamedArgument(IArgumentOperation argumentOperation)
Microsoft.NetCore.Analyzers\Usage\CSharpUseVolatileReadWriteFixer.cs (3)
19protected override SyntaxNode GetArgumentForVolatileReadCall(IArgumentOperation argument, IParameterSymbol volatileReadParameter) 30protected override IEnumerable<SyntaxNode> GetArgumentForVolatileWriteCall(ImmutableArray<IArgumentOperation> arguments, ImmutableArray<IParameterSymbol> volatileWriteParameters) 32foreach (var argument in arguments)
Microsoft.CodeAnalysis.CSharp.Workspaces (2)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (1)
1633var argument = invocationOperation.Arguments.FirstOrDefault(a => Equals(originalParameter, a.Parameter));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseImplicitTypeHelper.cs (1)
223var argumentOp = invocationOp.Arguments.FirstOrDefault(a => a.Syntax == argument);
Microsoft.CodeAnalysis.Features (14)
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (1)
5930? (oldModel.RequiredModel.GetOperation(oldLambda.Parent, cancellationToken) as IArgumentOperation)?.Parameter
InlineMethod\AbstractInlineMethodRefactoringProvider.MethodParametersInfo.cs (5)
429private static async Task<ImmutableArray<IArgumentOperation>> GetArgumentsReadOnlyOnceAsync( 431ImmutableArray<IArgumentOperation> arguments, 435using var _ = ArrayBuilder<IArgumentOperation>.GetInstance(out var builder); 436foreach (var argument in arguments) 495IArgumentOperation argumentOperation)
src\roslyn\src\Analyzers\Core\Analyzers\SimplifyInterpolation\AbstractSimplifyInterpolationDiagnosticAnalyzer.cs (1)
69conversion.Parent is IArgumentOperation { Parent: IInvocationOperation invocation } &&
src\roslyn\src\Analyzers\Core\Analyzers\SimplifyInterpolation\AbstractSimplifyInterpolationHelpers.cs (2)
235return Unwrap(interpolatedStringOperation?.Parent, towardsParent: true) is IArgumentOperation 322private static bool IsSpaceChar(IArgumentOperation argument)
ValueTracking\ValueTracker.OperationCollector.cs (5)
32IArgumentOperation argumentOperation => ShouldTrackArgument(argumentOperation) ? VisitAsync(argumentOperation.Value, cancellationToken) : Task.CompletedTask, 119if (IsContainedIn<IArgumentOperation>(operation, out var argumentOperation) && argumentOperation.Parameter is not null) 182private async Task TrackArgumentsAsync(ImmutableArray<IArgumentOperation> argumentOperations, CancellationToken cancellationToken) 227private static bool ShouldTrackArgument(IArgumentOperation argumentOperation)
Microsoft.CodeAnalysis.NetAnalyzers (263)
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\ImplementIDisposableCorrectly.cs (1)
487IArgumentOperation argument = invocationExpression.Arguments[0];
Microsoft.CodeQuality.Analyzers\Maintainability\AvoidDeadConditionalCode.cs (1)
89&& (op.Parent is not IArgumentOperation { Parent: IInvocationOperation invocation } ||
Microsoft.CodeQuality.Analyzers\Maintainability\AvoidLengthCalculationWhenSlicingToEnd.cs (6)
67var startArgument = argumentsInParameterOrder[0]; 68var lengthArgument = argumentsInParameterOrder[1]; 103bool ArgumentHasSideEffects(IArgumentOperation argument) 111bool StartIsSubtractedFromLength(IArgumentOperation startArgument, IArgumentOperation lengthArgument, IPropertyReferenceOperation lengthProperty) 261public bool HasLengthPropertyOnInstance(IArgumentOperation argument, IOperation? instance, [NotNullWhen(true)] out IPropertyReferenceOperation? lengthProperty)
Microsoft.CodeQuality.Analyzers\Maintainability\AvoidLengthCalculationWhenSlicingToEnd.Fixer.cs (1)
67IArgumentOperation argument,
Microsoft.CodeQuality.Analyzers\Maintainability\DoNotIgnoreMethodResults.cs (2)
316IArgumentOperation? argumentOperation = enclosingBlock.GetAncestor<IArgumentOperation>(OperationKind.Argument);
Microsoft.CodeQuality.Analyzers\Maintainability\UseNameofInPlaceOfString.cs (2)
55var argument = (IArgumentOperation)context.Operation;
Microsoft.CodeQuality.Analyzers\QualityGuidelines\AvoidDuplicateElementInitialization.cs (2)
80private static ImmutableArray<object> GetConstantArgumentValues(ImmutableArray<IArgumentOperation> arguments) 83foreach (var argument in arguments)
Microsoft.CodeQuality.Analyzers\QualityGuidelines\AvoidMultipleEnumerations\AvoidMultipleEnumerations.DataFlowOperationVisitor.cs (1)
280foreach (var argument in invocationOperation.Arguments)
Microsoft.CodeQuality.Analyzers\QualityGuidelines\AvoidMultipleEnumerations\AvoidMultipleEnumerationsHelpers.cs (6)
128if (operation.Parent is IArgumentOperation parentArgumentOperation) 206IArgumentOperation argumentOperationToCheck, 216IArgumentOperation argumentOperation, 225IArgumentOperation argumentOperation, 272if (operation is IArgumentOperation { Parent: IInvocationOperation invocationOperation } argumentOperation) 286IArgumentOperation argumentOperationToCheck,
Microsoft.CodeQuality.Analyzers\QualityGuidelines\DoNotPassDisposablesIntoUnawaitedTasks.cs (2)
82IList<IArgumentOperation> disposableArguments) 170private static IEnumerable<ILocalReferenceOperation> GetLocalReferencesFromArguments(IList<IArgumentOperation> args)
Microsoft.NetCore.Analyzers\Data\ReviewSqlQueriesForSecurityVulnerabilities.cs (4)
132ImmutableArray<IArgumentOperation> arguments, 160var vulnerableArgumentsBuilder = ImmutableArray.CreateBuilder<IArgumentOperation>(); 162foreach (var argument in potentials) 182foreach (var argument in vulnerableArguments)
Microsoft.NetCore.Analyzers\InteropServices\PlatformCompatibilityAnalyzer.cs (3)
465foreach (var argument in invocation.Arguments) 1340if (operation.Parent is IArgumentOperation argumentOperation && UsedInCreatingNotSupportedException(argumentOperation, notSupportedExceptionType)) 1439private static bool UsedInCreatingNotSupportedException(IArgumentOperation operation, ITypeSymbol? notSupportedExceptionType)
Microsoft.NetCore.Analyzers\InteropServices\PlatformCompatibilityAnalyzer.OperationVisitor.cs (5)
43internal bool TryParseGuardAttributes(ISymbol symbol, ref GlobalFlowStateAnalysisValueSet value, ImmutableArray<IArgumentOperation> visitedArguments) 77private static bool HasAnyGuardAttribute(ImmutableArray<AttributeData> attributes, ImmutableArray<IArgumentOperation> methodArguments, [NotNullWhen(true)] out SmallDictionary<string, Versions>? mappedAttributes) 181ImmutableArray<IArgumentOperation> visitedArguments, 266if (TryParseGuardAttributes(operation.Field, ref value, ImmutableArray<IArgumentOperation>.Empty)) 278if (TryParseGuardAttributes(operation.Property, ref value, ImmutableArray<IArgumentOperation>.Empty))
Microsoft.NetCore.Analyzers\InteropServices\PlatformCompatibilityAnalyzer.Value.cs (4)
42ImmutableArray<IArgumentOperation> arguments, 193ImmutableArray<IArgumentOperation> arguments, 202foreach (var argument in arguments.GetArgumentsInParameterOrder().Skip(skip)) 216static bool TryDecodeOSVersionPart(IArgumentOperation argument, ValueContentAnalysisResult? valueContentAnalysisResult, out int osVersionPart)
Microsoft.NetCore.Analyzers\Performance\AvoidPotentiallyExpensiveCallWhenLogging.cs (5)
77if (!symbols.IsLogInvocation(invocation, out var logLevel, out var logLevelArgumentOperation) || 92foreach (var argument in invocation.Arguments.Skip(invocation.IsExtensionMethodAndHasNoInstance() ? 1 : 0)) 303public bool IsLogInvocation(IInvocationOperation invocation, out int logLevel, out IArgumentOperation? logLevelArgumentOperation) 371public bool IsGuardedByIsEnabled(IInvocationOperation logInvocation, int logLevel, IArgumentOperation? logLevelArgumentOperation) 450bool IsSameLogLevel(IArgumentOperation isEnabledArgument)
Microsoft.NetCore.Analyzers\Performance\AvoidSingleUseOfLocalJsonSerializerOptions.cs (4)
84return operation.Parent is IArgumentOperation argumentOperation && 88private static bool IsArgumentForJsonSerializer(IArgumentOperation argumentOperation, INamedTypeSymbol jsonSerializerSymbol) 195if (operation.Parent is IArgumentOperation arg && arg.Parent is IInvocationOperation inv) 299if (currentOperation is IArgumentOperation)
Microsoft.NetCore.Analyzers\Performance\CollapseMultiplePathOperations.cs (4)
157foreach (var argument in invocation.Arguments) 195if (current is IArgumentOperation) 220foreach (var argument in invocation.Arguments) 275foreach (var argument in invocation.Arguments)
Microsoft.NetCore.Analyzers\Performance\ConstantExpectedAnalyzer.cs (8)
180foreach (var argument in invocation.Arguments) 474public abstract bool ValidateValue(IArgumentOperation argument, Optional<object?> constant, [NotNullWhen(false)] out Diagnostic? validationDiagnostics); 476public static bool ValidateConstant(IArgumentOperation argument, Optional<object?> constant, [NotNullWhen(false)] out Diagnostic? validationDiagnostics) 488public abstract bool ValidateParameterIsWithinRange(ConstantExpectedParameter subsetCandidate, IArgumentOperation argument, [NotNullWhen(false)] out Diagnostic? validationDiagnostics); 489protected Diagnostic CreateConstantInvalidConstantRuleDiagnostic(IArgumentOperation argument) => argument.CreateDiagnostic(CA1857.ConstantInvalidConstantRule, Parameter.Type.ToDisplayString()); 490protected static Diagnostic CreateConstantOutOfBoundsRuleDiagnostic(IArgumentOperation argument, string minText, string maxText) => argument.CreateDiagnostic(CA1857.ConstantOutOfBoundsRule, minText, maxText); 497public override bool ValidateParameterIsWithinRange(ConstantExpectedParameter subsetCandidate, IArgumentOperation argument, [NotNullWhen(false)] out Diagnostic? validationDiagnostics) 509public override bool ValidateValue(IArgumentOperation argument, Optional<object?> constant, [NotNullWhen(false)] out Diagnostic? validationDiagnostics)
Microsoft.NetCore.Analyzers\Performance\ConstantExpectedAnalyzer.UnmanagedHelper.cs (2)
184public override bool ValidateParameterIsWithinRange(ConstantExpectedParameter subsetCandidate, IArgumentOperation argument, [NotNullWhen(false)] out Diagnostic? validationDiagnostics) 204public override bool ValidateValue(IArgumentOperation argument, Optional<object?> constant, [NotNullWhen(false)] out Diagnostic? validationDiagnostics)
Microsoft.NetCore.Analyzers\Performance\DoNotGuardCall.cs (2)
145private static IArgumentOperation? GetFirstNonInstanceArgument(IInvocationOperation invocation) 149invocation.Arguments.TryGetArgumentForParameterAtIndex(parameterIndex, out var argument);
Microsoft.NetCore.Analyzers\Performance\PreferConvertToHexStringOverBitConverter.cs (1)
333private bool HasStringReplaceArgumentsToRemoveHyphen(ImmutableArray<IArgumentOperation> arguments)
Microsoft.NetCore.Analyzers\Performance\PreferReadOnlySpanOverSpan.cs (5)
166if (invocation.Parent is IArgumentOperation arg) 191return propRef.Parent is IArgumentOperation arg && IsArgumentSafe(parameter, arg, readOnlySpan, readOnlyMemory, memoryExtensions); 204case IArgumentOperation argument: 295if (propRef.Parent is IArgumentOperation argument && 325IArgumentOperation argument,
Microsoft.NetCore.Analyzers\Performance\RecommendCaseInsensitiveStringComparison.Analyzer.cs (1)
350else if (descendant is IArgumentOperation argumentDescendant && argumentDescendant.Value is IInvocationOperation argumentInvocationDescendant)
Microsoft.NetCore.Analyzers\Performance\UseCompositeFormat.cs (2)
124if (!invocation.Arguments.TryGetArgumentForParameterAtIndex(stringIndex, out IArgumentOperation? arg)) 172foreach (IArgumentOperation? arg in invocation.Arguments)
Microsoft.NetCore.Analyzers\Performance\UseConcreteTypeAnalyzer.Collector.cs (1)
213foreach (var arg in op.Arguments)
Microsoft.NetCore.Analyzers\Performance\UseCountProperly.cs (1)
277else if (parentOperation is IArgumentOperation argumentOperation &&
Microsoft.NetCore.Analyzers\Performance\UseSearchValues.cs (1)
75IArgumentOperation valuesArgument = invocation.Arguments[^1];
Microsoft.NetCore.Analyzers\Performance\UseSearchValues.Fixer.cs (4)
181private static IArgumentOperation? GetArgumentOperationAncestorOrSelf(IOperation operation) => 182(operation as IArgumentOperation) ?? 183operation.GetAncestor<IArgumentOperation>(OperationKind.Argument); 276if (newOperation is IArgumentOperation argumentOperation)
Microsoft.NetCore.Analyzers\Performance\UseSpanClearInsteadOfFill.cs (1)
78private static bool IsDefaultValue(IArgumentOperation argumentOperation)
Microsoft.NetCore.Analyzers\Performance\UseStringContainsCharOverloadWithSingleCharactersAnalyzer.cs (2)
71var argumentOperation = invocationOperation.Arguments.GetArgumentForParameterAtIndex(0); 85static bool CheckForViolation(IArgumentOperation primaryArgument)
Microsoft.NetCore.Analyzers\Performance\UseStringMethodCharOverloadWithSingleCharacters.cs (4)
119TryGetChar(invocationOperation, out var stringArgument, out var c)) 166foreach (var argument in invocationOperation.Arguments) 209[NotNullWhen(true)] out IArgumentOperation? stringArgument, 215var argument = invocationOperation.Arguments.GetArgumentForParameterAtIndex(0);
Microsoft.NetCore.Analyzers\Performance\UseStringMethodCharOverloadWithSingleCharacters.Fixer.cs (1)
61protected static bool PreserveArgument(IArgumentOperation? argument)
Microsoft.NetCore.Analyzers\Runtime\AvoidConstArrays.cs (3)
51IArgumentOperation? argumentOperation; 60argumentOperation = arrayCreationOperation.GetAncestor<IArgumentOperation>(OperationKind.Argument); 76&& invocationDescendants.Any(x => x is IArgumentOperation))
Microsoft.NetCore.Analyzers\Runtime\AvoidRedundantRegexIsMatchBeforeMatch.cs (8)
249foreach (var arg in invocation.Arguments) 275foreach (var arg in propRef.Arguments) 325foreach (var arg in objCreation.Arguments) 485foreach (IArgumentOperation isMatchArg in isMatchInvocation.Arguments) 492IArgumentOperation? matchArg = null; 493foreach (IArgumentOperation candidate in matchInvocation.Arguments) 615foreach (var arg in invocation.Arguments) 668if (operation is IArgumentOperation argOp &&
Microsoft.NetCore.Analyzers\Runtime\AvoidZeroLengthArrayAllocations.cs (2)
140var arguments = ImmutableArray<IArgumentOperation>.Empty; 175var lastArgument = arguments.LastOrDefault();
Microsoft.NetCore.Analyzers\Runtime\BufferBlockCopyLengthAnalyzer.cs (5)
82ImmutableArray<IArgumentOperation> arguments = IOperationExtensions.GetArgumentsInParameterOrder(invocationOperation.Arguments); 84IArgumentOperation sourceArgument = arguments[0]; 85IArgumentOperation destinationArgument = arguments[2]; 86IArgumentOperation countArgument = arguments[4]; 88bool CheckArgumentArrayType(IArgumentOperation targetArgument, IPropertyReferenceOperation lengthPropertyArgument)
Microsoft.NetCore.Analyzers\Runtime\DoNotPassLiteralsAsLocalizedParameters.cs (2)
70var argument = (IArgumentOperation)operationContext.Operation;
Microsoft.NetCore.Analyzers\Runtime\DoNotUseReferenceEqualsWithValueTypes.cs (1)
109foreach (var argument in invocationExpression.Arguments)
Microsoft.NetCore.Analyzers\Runtime\ForwardCancellationTokenToInvocations.Analyzer.cs (7)
43protected abstract bool ArgumentsImplicitOrNamed(INamedTypeSymbol cancellationTokenType, ImmutableArray<IArgumentOperation> arguments); 269ImmutableArray<IArgumentOperation> arguments, 280private static bool AnyArgument<TArg>(ImmutableArray<IArgumentOperation> arguments, Func<IArgumentOperation, TArg, bool> predicate, TArg arg) 297ImmutableArray<IArgumentOperation> arguments, 317ImmutableArray<IArgumentOperation> arguments, 324IArgumentOperation? paramsArgument = arguments.FirstOrDefault(a => a.ArgumentKind == ArgumentKind.ParamArray);
Microsoft.NetCore.Analyzers\Runtime\ForwardCancellationTokenToInvocations.Fixer.cs (1)
37protected abstract bool IsArgumentNamed(IArgumentOperation argumentOperation);
Microsoft.NetCore.Analyzers\Runtime\InstantiateArgumentExceptionsCorrectly.cs (1)
108foreach (IArgumentOperation argument in creation.Arguments)
Microsoft.NetCore.Analyzers\Runtime\LoggerMessageDefineAnalyzer.cs (2)
151var arg = invocation.Arguments.FirstOrDefault(argument => 160foreach (var argument in invocation.Arguments)
Microsoft.NetCore.Analyzers\Runtime\PreferAsSpanOverSubstring.cs (3)
62var argument = (IArgumentOperation)context.Operation; 102foreach (var argument in invocation.Arguments)
Microsoft.NetCore.Analyzers\Runtime\PreferAsSpanOverSubstring.Fixer.cs (1)
62foreach (var argument in reportedInvocation.Arguments)
Microsoft.NetCore.Analyzers\Runtime\PreferConstCharOverConstUnitString.Fixer.cs (1)
35if (operation is IArgumentOperation argumentOperation)
Microsoft.NetCore.Analyzers\Runtime\PreferConstCharOverConstUnitStringAnalyzer.cs (2)
73ImmutableArray<IArgumentOperation> arguments = invocationOperation.Arguments; 74IArgumentOperation firstArgument = arguments[0];
Microsoft.NetCore.Analyzers\Runtime\PreferStringContainsOverIndexOf.Fixer.cs (2)
76async Task<Document> ReplaceBinaryOperationWithContains(Document document, SyntaxNode syntaxNode, ImmutableArray<IArgumentOperation> indexOfMethodArguments, IBinaryOperation binaryOperation, CancellationToken cancellationToken) 85var firstArgument = indexOfMethodArguments[0];
Microsoft.NetCore.Analyzers\Runtime\PreferTypedStringBuilderAppendOverloads.cs (1)
112invocation.Arguments[stringParamIndex] is not IArgumentOperation argument)
Microsoft.NetCore.Analyzers\Runtime\PreferTypedStringBuilderAppendOverloads.Fixer.cs (2)
37if (operation is IArgumentOperation arg && 54else if (operation is IArgumentOperation argOp &&
Microsoft.NetCore.Analyzers\Runtime\ProvideCorrectArgumentsToFormattingMethods.cs (2)
71IArgumentOperation formatStringArgument = invocation.Arguments[info.FormatStringIndex]; 112IArgumentOperation paramsArgument = invocation.Arguments[info.FormatStringIndex + 1];
Microsoft.NetCore.Analyzers\Runtime\SpecifyIFormatProvider.cs (1)
273foreach (var argument in invocationExpression.Arguments)
Microsoft.NetCore.Analyzers\Runtime\UseExceptionThrowHelpers.cs (5)
292if (objectCreationOperation.Arguments is [IArgumentOperation arg, ..] && 322ImmutableArray<IArgumentOperation> args = creationOperation.Arguments; 332ImmutableArray<IArgumentOperation> args = objectCreationOperation.Arguments; 358static bool IsNullOrEmptyMessage(IArgumentOperation arg) => 400invocationOperation.Arguments is [IArgumentOperation arg] &&
Microsoft.NetCore.Analyzers\Runtime\UseOrdinalStringComparison.cs (1)
65IArgumentOperation lastArgument = operation.Arguments.Last();
Microsoft.NetCore.Analyzers\Runtime\UseSpanBasedStringConcat.Fixer.cs (4)
32private protected abstract bool IsNamedArgument(IArgumentOperation argumentOperation); 129if (TryGetNamedStartIndexArgument(symbols, invocation, out var namedStartIndexArgument)) 152bool TryGetNamedStartIndexArgument(in RequiredSymbols symbols, IInvocationOperation substringInvocation, [NotNullWhen(true)] out IArgumentOperation? namedStartIndexArgument) 156foreach (var argument in substringInvocation.Arguments)
Microsoft.NetCore.Analyzers\Security\DoNotInstallRootCert.cs (2)
157var argumentOperation = (IArgumentOperation)operationAnalysisContext.Operation;
Microsoft.NetCore.Analyzers\Security\DoNotUseWeakKDFAlgorithm.cs (1)
76var hashAlgorithmNameArgumentOperation = objectCreationOperation.Arguments.FirstOrDefault(s => s.Parameter?.Name == "hashAlgorithm");
Microsoft.NetCore.Analyzers\Security\DoNotUseWeakKDFInsufficientIterationCount.cs (2)
154var argumentOperation = (IArgumentOperation)operationAnalysisContext.Operation;
Microsoft.NetCore.Analyzers\Security\SetHttpOnlyForHttpCookie.cs (2)
131IArgumentOperation argumentOperation = (IArgumentOperation)operationAnalysisContext.Operation;
Microsoft.NetCore.Analyzers\Security\SslProtocolsAnalyzer.cs (1)
116case IArgumentOperation argumentOperation:
Microsoft.NetCore.Analyzers\Security\UseContainerLevelAccessPolicy.cs (1)
126var argumentOperation = invocationOperation.Arguments.FirstOrDefault(
Microsoft.NetCore.Analyzers\Security\UseSecureCookiesASPNetCore.cs (2)
152var argumentOperation = (IArgumentOperation)operationAnalysisContext.Operation;
Microsoft.NetCore.Analyzers\Security\UseSharedAccessProtocolHttpsOnly.cs (1)
122var protocolsArgumentOperation = invocationOperation.Arguments.FirstOrDefault(s => s.Parameter?.Name == "protocols" &&
Microsoft.NetCore.Analyzers\Tasks\DoNotCreateTaskCompletionSourceWithWrongArguments.cs (1)
71IConversionOperation? MatchInvalidContinuationOptions(IMethodSymbol? targetMethod, ImmutableArray<IArgumentOperation> arguments) =>
Microsoft.NetCore.Analyzers\Tasks\DoNotCreateTaskCompletionSourceWithWrongArguments.Fixer.cs (1)
66model.GetOperationWalkingUpParentChain(expression, cancellationToken) is IArgumentOperation arg &&
Microsoft.NetCore.Analyzers\Tasks\DoNotUseWhenAllOrWaitAllWithSingleArgument.cs (1)
103var argument = invocation.Arguments.Single();
Microsoft.NetCore.Analyzers\Tasks\UseValueTasksCorrectly.cs (2)
159var arg = (IArgumentOperation)operation.Parent;
Microsoft.NetCore.Analyzers\Usage\PreferGenericOverloads.cs (2)
146ImmutableArray<IArgumentOperation> otherArguments) 189public ImmutableArray<IArgumentOperation> OtherArguments { get; }
Microsoft.NetCore.Analyzers\Usage\UseVolatileReadWrite.Fixer.cs (2)
94protected abstract SyntaxNode GetArgumentForVolatileReadCall(IArgumentOperation argument, IParameterSymbol volatileReadParameter); 96protected abstract IEnumerable<SyntaxNode> GetArgumentForVolatileWriteCall(ImmutableArray<IArgumentOperation> arguments, ImmutableArray<IParameterSymbol> volatileWriteParameters);
Microsoft.NetFramework.Analyzers\DoNotUseInsecureDtdProcessing.cs (2)
251private void AnalyzeMethodOverloads(OperationAnalysisContext context, IMethodSymbol method, ImmutableArray<IArgumentOperation> arguments, SyntaxNode expressionSyntax) 279IArgumentOperation arg = arguments[xmlReaderSettingsIndex];
Microsoft.NetFramework.Analyzers\DoNotUseInsecureXSLTScriptExecution.cs (2)
114ImmutableArray<IArgumentOperation> arguments, Action<TContext, Diagnostic> reportDiagnostic, TContext context) 240_ => ImmutableArray<IArgumentOperation>.Empty,
src\0437c1690f5501bd\CopyAnalysis.CopyDataFlowOperationVisitor.cs (1)
317protected override CopyAbstractValue ComputeAnalysisValueForEscapedRefOrOutArgument(AnalysisEntity analysisEntity, IArgumentOperation operation, CopyAbstractValue defaultValue)
src\11b41c7305441175\PropertySetAnalysis.PropertySetDataFlowOperationVisitor.cs (8)
161foreach (IArgumentOperation argumentOperation in operation.Arguments) 174foreach (IArgumentOperation argumentOperation in operation.Arguments) 453public override PropertySetAbstractValue VisitInvocation_NonLambdaOrDelegateOrLocalFunction(IMethodSymbol method, IOperation? visitedInstance, ImmutableArray<IArgumentOperation> visitedArguments, bool invokedAsDelegate, IOperation originalOperation, PropertySetAbstractValue defaultValue) 460foreach (IArgumentOperation visitedArgument in visitedArguments) 511ImmutableArray<IArgumentOperation> visitedArguments, 527foreach (IArgumentOperation argumentOperation in visitedArguments) 632public override PropertySetAbstractValue VisitInvocation_LocalFunction(IMethodSymbol localFunction, ImmutableArray<IArgumentOperation> visitedArguments, IOperation originalOperation, PropertySetAbstractValue defaultValue) 640public override PropertySetAbstractValue VisitInvocation_Lambda(IFlowAnonymousFunctionOperation lambda, ImmutableArray<IArgumentOperation> visitedArguments, IOperation originalOperation, PropertySetAbstractValue defaultValue)
src\40daf5e1cab76dff\TaintedDataAnalysis.TaintedDataOperationVisitor.cs (16)
250IEnumerable<IArgumentOperation> taintedArguments = GetTaintedArguments(operation.Arguments); 262ImmutableArray<IArgumentOperation> visitedArguments, 276IEnumerable<IArgumentOperation> taintedArguments = GetTaintedArguments(visitedArguments); 318IArgumentOperation? argumentOperation = visitedArguments.FirstOrDefault(o => o.Parameter?.Name == taintedTarget); 397IArgumentOperation? thenSanitizedTargetOperation = visitedArguments.FirstOrDefault(o => o.Parameter?.Name == thenSanitizedTarget); 421public override TaintedDataAbstractValue VisitInvocation_LocalFunction(IMethodSymbol localFunction, ImmutableArray<IArgumentOperation> visitedArguments, IOperation originalOperation, TaintedDataAbstractValue defaultValue) 426IEnumerable<IArgumentOperation> taintedArguments = GetTaintedArguments(visitedArguments); 435public override TaintedDataAbstractValue VisitInvocation_Lambda(IFlowAnonymousFunctionOperation lambda, ImmutableArray<IArgumentOperation> visitedArguments, IOperation originalOperation, TaintedDataAbstractValue defaultValue) 440IEnumerable<IArgumentOperation> taintedArguments = GetTaintedArguments(visitedArguments); 458IArgumentOperation operation, 558IEnumerable<IArgumentOperation> taintedArguments, 566foreach (IArgumentOperation taintedArgument in taintedArguments) 629ImmutableArray<IArgumentOperation> arguments, 681private static bool IsMethodArgumentASink(IMethodSymbol method, IEnumerable<SinkInfo> infosForType, IArgumentOperation taintedArgument, [NotNullWhen(returnValue: true)] out HashSet<SinkKind>? sinkKinds) 751private IEnumerable<IArgumentOperation> GetTaintedArguments(ImmutableArray<IArgumentOperation> arguments)
src\40daf5e1cab76dff\TaintedDataSymbolMapExtensions.cs (2)
36ImmutableArray<IArgumentOperation> arguments, 184ImmutableArray<IArgumentOperation> arguments,
src\440320f3f10733a8\ValueContentAnalysis.ValueContentDataFlowOperationVisitor.cs (1)
272ImmutableArray<IArgumentOperation> visitedArguments,
src\47c588c5b8785708\ParameterValidationAnalysis.ParameterValidationDataFlowOperationVisitor.cs (6)
251ImmutableArray<IArgumentOperation> visitedArguments, 263ImmutableArray<IArgumentOperation> visitedArguments, 274ImmutableArray<IArgumentOperation> visitedArguments, 283private void ProcessRegularInvocationOrCreation(IMethodSymbol? targetMethod, ImmutableArray<IArgumentOperation> arguments, IOperation operation) 322foreach (var argument in arguments) 341foreach (var argument in arguments)
src\8ce1f4f68b646e6d\GlobalFlowStateValueSetFlowOperationVisitor.cs (1)
110ImmutableArray<IArgumentOperation> visitedArguments,
src\9382845807600969\AbstractLocationDataFlowOperationVisitor.cs (1)
66protected override TAbstractAnalysisValue ComputeAnalysisValueForEscapedRefOrOutArgument(IArgumentOperation operation, TAbstractAnalysisValue defaultValue)
src\9382845807600969\AnalysisEntityDataFlowOperationVisitor.cs (2)
63protected sealed override TAbstractAnalysisValue ComputeAnalysisValueForEscapedRefOrOutArgument(IArgumentOperation operation, TAbstractAnalysisValue defaultValue) 79protected virtual TAbstractAnalysisValue ComputeAnalysisValueForEscapedRefOrOutArgument(AnalysisEntity analysisEntity, IArgumentOperation operation, TAbstractAnalysisValue defaultValue)
src\afc74d572e54ec72\DisposeAnalysis.DisposeDataFlowOperationVisitor.cs (3)
185protected override DisposeAbstractValue ComputeAnalysisValueForEscapedRefOrOutArgument(IArgumentOperation operation, DisposeAbstractValue defaultValue) 257ImmutableArray<IArgumentOperation> visitedArguments, 324protected override void PostProcessArgument(IArgumentOperation operation, bool isEscaped)
src\ffd9070534249528\PointsToAnalysis.PointsToDataFlowOperationVisitor.cs (6)
284protected override PointsToAbstractValue ComputeAnalysisValueForEscapedRefOrOutArgument(AnalysisEntity analysisEntity, IArgumentOperation operation, PointsToAbstractValue defaultValue) 297protected override void PostProcessArgument(IArgumentOperation operation, bool isEscaped) 940ImmutableArray<IArgumentOperation> visitedArguments, 951foreach (var argument in visitedArguments) 1025ImmutableArray<IArgumentOperation> visitedArguments, 1035ImmutableArray<IArgumentOperation> visitedArguments,
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\Compiler\Extensions\IOperationExtensions.cs (13)
39var firstArg = invocation.Arguments.FirstOrDefault(); 786foreach (IArgumentOperation argumentOperation in invocationOperation.Arguments) 852this ImmutableArray<IArgumentOperation> arguments, 854[NotNullWhen(true)] out IArgumentOperation? result) 859foreach (var argument in arguments) 872public static IArgumentOperation GetArgumentForParameterAtIndex( 873this ImmutableArray<IArgumentOperation> arguments, 876if (TryGetArgumentForParameterAtIndex(arguments, parameterIndex, out var result)) 889public static ImmutableArray<IArgumentOperation> GetArgumentsInParameterOrder( 890this ImmutableArray<IArgumentOperation> arguments) 892using var parameterOrderedArguments = ArrayBuilder<IArgumentOperation>.GetInstance(arguments.Length, null!); 894foreach (var argument in arguments) 1024else if (operation.Parent is IArgumentOperation argumentOperation)
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\Compiler\Lightup\IFunctionPointerInvocationOperationWrapper.cs (4)
22private static readonly Func<IOperation, ImmutableArray<IArgumentOperation>> ArgumentsAccessor = LightupHelpers.CreateOperationPropertyAccessor<IOperation, ImmutableArray<IArgumentOperation>>(WrappedType, nameof(Arguments), fallbackResult: ImmutableArray<IArgumentOperation>.Empty); 53public ImmutableArray<IArgumentOperation> Arguments => ArgumentsAccessor(WrappedOperation);
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\FlowAnalysis\FlowAnalysis\Analysis\DisposeAnalysis\DisposeAnalysisHelper.cs (1)
159operation.Parent is IArgumentOperation argument && argument.Parameter?.RefKind == RefKind.Out) &&
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\FlowAnalysis\FlowAnalysis\Analysis\TaintedDataAnalysis\SourceInfo.cs (1)
15internal delegate bool MethodMatcher(string methodName, ImmutableArray<IArgumentOperation> arguments);
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\AbstractLocation.cs (2)
162_ => ImmutableArray<IArgumentOperation>.Empty, 165foreach (var argument in arguments)
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\AnalysisEntityFactory.cs (1)
196case IArgumentOperation argument:
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\DataFlowOperationVisitor.cs (23)
46private readonly HashSet<IArgumentOperation> _pendingArgumentsToReset; 47private readonly List<IArgumentOperation> _pendingArgumentsToPostProcess; 274_pendingArgumentsToReset = new HashSet<IArgumentOperation>(); 275_pendingArgumentsToPostProcess = new List<IArgumentOperation>(); 974private bool IsContractCheckArgument(IArgumentOperation operation) 1213protected virtual TAbstractAnalysisValue ComputeAnalysisValueForEscapedRefOrOutArgument(IArgumentOperation operation, TAbstractAnalysisValue defaultValue) 1488Debug.Assert(IsContractCheckArgument((IArgumentOperation)operation)); 1666case IArgumentOperation argument: 2202ImmutableArray<IArgumentOperation> arguments, 2399foreach (var argument in arguments) 2516foreach (var argument in arguments) 2547IParameterSymbol GetMappedParameterForArgument(IArgumentOperation argumentOperation) 2780foreach (IArgumentOperation argumentOperation in pendingArguments) 3069public sealed override TAbstractAnalysisValue VisitArgument(IArgumentOperation operation, object? argument) 3094protected virtual void PostProcessArgument(IArgumentOperation operation, bool isEscaped) 3101/// This method resets the analysis data for an object instance passed around as an <see cref="IArgumentOperation"/> 3104private void PostProcessEscapedArgument(IArgumentOperation operation) 3224void PostVisitInvocation(IMethodSymbol targetMethod, ImmutableArray<IArgumentOperation> arguments) 3249void ProcessInterlockedOperation(IMethodSymbol targetMethod, ImmutableArray<IArgumentOperation> arguments, INamedTypeSymbol interlockedType) 3264foreach (var argument in arguments) 3533ImmutableArray<IArgumentOperation> visitedArguments, 3575ImmutableArray<IArgumentOperation> visitedArguments, 3593ImmutableArray<IArgumentOperation> visitedArguments,
Microsoft.CodeAnalysis.ResxSourceGenerator (9)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\IOperationExtensions.cs (7)
38var firstArg = invocation.Arguments.FirstOrDefault(); 491this ImmutableArray<IArgumentOperation> arguments, 493[NotNullWhen(true)] out IArgumentOperation? result) 498foreach (var argument in arguments) 511public static IArgumentOperation GetArgumentForParameterAtIndex( 512this ImmutableArray<IArgumentOperation> arguments, 515if (TryGetArgumentForParameterAtIndex(arguments, parameterIndex, out var result))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\OperationExtensions.cs (1)
162else if (operation.Parent is IArgumentOperation argumentOperation)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.Walker.cs (1)
358public override void VisitArgument(IArgumentOperation operation)
Microsoft.CodeAnalysis.VisualBasic (8)
VisualBasicExtensions.vb (8)
1398''' Gets the underlying <see cref="Conversion"/> information for InConversion of <see cref="IArgumentOperation"/> that was created from Visual Basic code. 1402''' <exception cref="ArgumentException">If the <see cref="IArgumentOperation"/> was not created from Visual Basic code.</exception> 1404Public Function GetInConversion(argument As IArgumentOperation) As Conversion 1410NameOf(IArgumentOperation)), 1416''' Gets the underlying <see cref="Conversion"/> information for OutConversion of <see cref="IArgumentOperation"/> that was created from Visual Basic code. 1420''' <exception cref="ArgumentException">If the <see cref="IArgumentOperation"/> was not created from Visual Basic code.</exception> 1422Public Function GetOutConversion(argument As IArgumentOperation) As Conversion 1428NameOf(IArgumentOperation)),
Microsoft.CodeAnalysis.VisualBasic.NetAnalyzers (8)
Microsoft.NetCore.Analyzers\Performance\BasicRecommendCaseInsensitiveStringComparisonFixer.vb (1)
58For Each arg As IArgumentOperation In mainInvocationOperation.Arguments
Microsoft.NetCore.Analyzers\Performance\BasicUseStringMethodCharOverloadWithSingleCharacters.Fixer.vb (2)
27Dim argumentOperation = TryCast(model.GetOperation(argument), IArgumentOperation) 70Select(Function(arg) (arg, operation:=TryCast(model.GetOperation(arg), IArgumentOperation))).
Microsoft.NetCore.Analyzers\Runtime\BasicForwardCancellationTokenToInvocations.Analyzer.vb (1)
39Protected Overrides Function ArgumentsImplicitOrNamed(cancellationTokenType As INamedTypeSymbol, arguments As ImmutableArray(Of IArgumentOperation)) As Boolean
Microsoft.NetCore.Analyzers\Runtime\BasicForwardCancellationTokenToInvocations.Fixer.vb (1)
40Protected Overrides Function IsArgumentNamed(argumentOperation As IArgumentOperation) As Boolean
Microsoft.NetCore.Analyzers\Runtime\BasicUseSpanBasedStringConcat.Fixer.vb (1)
29Private Protected Overrides Function IsNamedArgument(argumentOperation As IArgumentOperation) As Boolean
Microsoft.NetCore.Analyzers\Usage\BasicUseVolatileReadWriteFixer.vb (2)
17Protected Overrides Function GetArgumentForVolatileReadCall(argument As IArgumentOperation, volatileReadParameter as IParameterSymbol) As SyntaxNode 26Protected Overrides Iterator Function GetArgumentForVolatileWriteCall(arguments As ImmutableArray(Of IArgumentOperation), volatileWriteParameters As ImmutableArray(Of IParameterSymbol)) As IEnumerable(Of SyntaxNode)
Microsoft.CodeAnalysis.Workspaces (2)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\OperationExtensions.cs (1)
162else if (operation.Parent is IArgumentOperation argumentOperation)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.Walker.cs (1)
358public override void VisitArgument(IArgumentOperation operation)
Microsoft.Extensions.Configuration.Binder.SourceGeneration (4)
Parser\ConfigurationBinder.cs (4)
81IArgumentOperation instanceArg = GetArgumentForParameterAtIndex(operation.Arguments, instanceIndex); 120private static IArgumentOperation GetArgumentForParameterAtIndex(ImmutableArray<IArgumentOperation> arguments, int parameterIndex) 122foreach (var argument in arguments)
Microsoft.Extensions.Validation.ValidationsGenerator (5)
src\768f3af0174e68df\InvocationOperationExtensions.cs (5)
32targetOperation.TryGetRouteHandlerArgument(out var routeHandlerParameter) && 45if (invocation.TryGetRouteHandlerArgument(out var argument)) 53public static bool TryGetRouteHandlerArgument(this IInvocationOperation invocation, [NotNullWhen(true)] out IArgumentOperation? argumentOperation) 59foreach (var argument in invocation.Arguments) 92IArgumentOperation argument => ResolveMethodFromOperation(argument.Value, semanticModel),
Microsoft.Interop.ComInterfaceGenerator (4)
src\runtime\src\libraries\System.Runtime.InteropServices\gen\Common\OperationExtensions.cs (4)
12public static IArgumentOperation? GetArgumentByOrdinal(this IInvocationOperation operation, int ordinal) 19foreach (IArgumentOperation argument in operation.Arguments) 28public static IArgumentOperation? GetArgumentByOrdinal(this IObjectCreationOperation operation, int ordinal) 35foreach (IArgumentOperation argument in operation.Arguments)
Microsoft.Interop.LibraryImportGenerator (8)
Analyzers\CustomMarshallerAttributeAnalyzer.cs (3)
649IArgumentOperation? managedTypeArgument = attrCreation.GetArgumentByOrdinal(0); 670IArgumentOperation? marshallerTypeArgument = attrCreation.GetArgumentByOrdinal(2); 688var marshalModeArgument = attrCreation.GetArgumentByOrdinal(1);
Analyzers\NativeMarshallingAttributeAnalyzer.cs (1)
90IArgumentOperation marshallerEntryPointTypeArgument = attrCreation.GetArgumentByOrdinal(0);
src\runtime\src\libraries\System.Runtime.InteropServices\gen\Common\OperationExtensions.cs (4)
12public static IArgumentOperation? GetArgumentByOrdinal(this IInvocationOperation operation, int ordinal) 19foreach (IArgumentOperation argument in operation.Arguments) 28public static IArgumentOperation? GetArgumentByOrdinal(this IObjectCreationOperation operation, int ordinal) 35foreach (IArgumentOperation argument in operation.Arguments)
Microsoft.Interop.LibraryImportGenerator.Downlevel (4)
src\runtime\src\libraries\System.Runtime.InteropServices\gen\Common\OperationExtensions.cs (4)
12public static IArgumentOperation? GetArgumentByOrdinal(this IInvocationOperation operation, int ordinal) 19foreach (IArgumentOperation argument in operation.Arguments) 28public static IArgumentOperation? GetArgumentByOrdinal(this IObjectCreationOperation operation, int ordinal) 35foreach (IArgumentOperation argument in operation.Arguments)
Roslyn.Diagnostics.Analyzers (10)
AbstractDoNotCopyValue.cs (1)
392public override void VisitArgument(IArgumentOperation operation)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\IOperationExtensions.cs (7)
38var firstArg = invocation.Arguments.FirstOrDefault(); 491this ImmutableArray<IArgumentOperation> arguments, 493[NotNullWhen(true)] out IArgumentOperation? result) 498foreach (var argument in arguments) 511public static IArgumentOperation GetArgumentForParameterAtIndex( 512this ImmutableArray<IArgumentOperation> arguments, 515if (TryGetArgumentForParameterAtIndex(arguments, parameterIndex, out var result))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\OperationExtensions.cs (1)
162else if (operation.Parent is IArgumentOperation argumentOperation)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.Walker.cs (1)
358public override void VisitArgument(IArgumentOperation operation)
Roslyn.Diagnostics.CSharp.Analyzers (3)
CSharpDoNotUseDebugAssertForInterpolatedStrings.cs (1)
68invocation.Arguments is [_, IArgumentOperation { Value: IInterpolatedStringOperation { ConstantValue.HasValue: false } }])
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (1)
1633var argument = invocationOperation.Arguments.FirstOrDefault(a => Equals(originalParameter, a.Parameter));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseImplicitTypeHelper.cs (1)
223var argumentOp = invocationOp.Arguments.FirstOrDefault(a => a.Syntax == argument);
System.Text.RegularExpressions.Generator (11)
UpgradeToGeneratedRegexAnalyzer.cs (2)
90internal static bool ValidateParameters(ImmutableArray<IArgumentOperation> arguments) 102IArgumentOperation argument = arguments[i];
UpgradeToGeneratedRegexCodeFixer.cs (9)
154ImmutableArray<IArgumentOperation> operationArguments; 231ImmutableArray<IArgumentOperation> operationArguments = 276ImmutableArray<IArgumentOperation> operationArguments = 290ImmutableArray<IArgumentOperation> operationArguments, 379private static string? GetRegexPatternFromArgument(ImmutableArray<IArgumentOperation> arguments) => 384private static RegexOptions GetRegexOptionsFromArgument(ImmutableArray<IArgumentOperation> arguments) 386IArgumentOperation? optionsArgument = arguments.SingleOrDefault(arg => arg.Parameter?.Name == UpgradeToGeneratedRegexAnalyzer.OptionsArgumentName); 396private static SyntaxNode? GeneratePatternOrOptionsArgumentNode(ImmutableArray<IArgumentOperation> arguments, SyntaxGenerator generator, string parameterName) 398if (arguments.SingleOrDefault(arg => arg.Parameter?.Name == parameterName) is IArgumentOperation argument)