1 implementation of Arguments
Microsoft.CodeAnalysis (1)
Generated\Operations.Generated.cs (1)
5208public ImmutableArray<IArgumentOperation> Arguments { get; }
394 references to Arguments
Aspire.Hosting.Analyzers (1)
AppHostAnalyzer.cs (1)
126foreach (var argument in invocation.Arguments)
ConfigurationSchemaGenerator (3)
RuntimeSource\Configuration.Binder\Parser\ConfigurationBinder.cs (3)
81IArgumentOperation instanceArg = GetArgumentForParameterAtIndex(operation.Arguments, instanceIndex); 172ITypeOfOperation? typeOfOperation = GetArgumentForParameterAtIndex(operation.Arguments, 1).ChildOperations.FirstOrDefault() as ITypeOfOperation; 227ITypeOfOperation? typeOfOperation = GetArgumentForParameterAtIndex(operation.Arguments, 1).ChildOperations.FirstOrDefault() as ITypeOfOperation;
GenerateDocumentationAndConfigFiles (2)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\IOperationExtensions.cs (2)
38var firstArg = invocation.Arguments.FirstOrDefault(); 449=> invocationOperation.IsExtensionMethodAndHasNoInstance() ? invocationOperation.Arguments[0].Value : invocationOperation.Instance;
ILLink.RoslynAnalyzer (2)
DataFlow\LocalDataFlowVisitor.cs (2)
660=> ProcessMethodCall(operation, operation.TargetMethod, operation.Instance, operation.Arguments, state); 896argumentOperation = callOperation.Arguments[argumentIndex];
Microsoft.Analyzers.Extra (16)
AsyncCallInsideUsingBlockAnalyzer.cs (1)
209foreach (var argument in invocation.Arguments)
CallAnalysis\CallAnalyzer.Handlers.cs (1)
30if (op.Arguments.Length == target.Parameters.Length)
CallAnalysis\Fixers\LegacyLoggingFixer.cs (7)
366var t = invocationOp.Arguments[0].Value.Type!; 386parameters.Add(gen.ParameterDeclaration("exception", gen.TypeExpression(invocationOp.Arguments[details.ExceptionParamIndex].Value.Type!))); 398var paramsArg = invocationOp.Arguments[details.ArgsParamIndex]; 431invocationOp.Arguments[0].Value.Type! 436args.Add(invocationOp.Arguments[details.ExceptionParamIndex].Value.Type!); 447var paramsArg = invocationOp.Arguments[details.ArgsParamIndex]; 480foreach (var arg in invocation!.Arguments)
CallAnalysis\Fixers\LegacyLoggingFixer.FixDetails.cs (2)
44var op = invocationOp.Arguments[MessageParamIndex]; 106var op = invocationOp.Arguments[LogLevelParamIndex].Descendants().SingleOrDefault(x => x.Kind == OperationKind.Literal || x.Kind == OperationKind.FieldReference);
CallAnalysis\StartsEndsWith.cs (4)
46var s = op.Arguments[0].Value.ConstantValue.Value as string; 50if (op.Arguments.Length > 1 && op.Arguments[1].Value.ConstantValue.HasValue) 52var comp = (StringComparison)op.Arguments[1].Value.ConstantValue.Value!;
UsingToStringInLoggersAnalyzer.cs (1)
64foreach (var arg in invocation.Arguments)
Microsoft.Analyzers.Local (2)
CallAnalysis\CallAnalyzer.Handlers.cs (1)
30if (op.Arguments.Length == target.Parameters.Length)
CallAnalysis\ToInvariantString.cs (1)
41var a = op.Arguments[0];
Microsoft.AspNetCore.Analyzers (4)
MiddlewareAnalyzer.cs (2)
35invocation.Arguments.Length >= 1 && 36SymbolEqualityComparer.Default.Equals(invocation.Arguments[0].Parameter?.Type, _context.StartupSymbols.IApplicationBuilder))
ServicesAnalyzer.cs (2)
30invocation.Arguments.Length >= 1 && 31SymbolEqualityComparer.Default.Equals(invocation.Arguments[0].Parameter?.Type, _context.StartupSymbols.IServiceCollection))
Microsoft.AspNetCore.App.Analyzers (13)
Authorization\AddAuthorizationBuilderAnalyzer.cs (1)
92if (invocation is { Arguments: { Length: 2 } invocationArguments })
Kestrel\ListenOnIPv6AnyAnalyzer.cs (1)
47var addressArgument = kestrelOptionsListenInvocation?.Arguments.FirstOrDefault();
RenderTreeBuilder\RenderTreeBuilderAnalyzer.cs (1)
39foreach (var argument in invocation.Arguments)
RouteHandlers\DetectAmbiguousRoutes.cs (4)
199invocation.Arguments.Length == 2 && 200otherInvocation.Arguments.Length == 2) 206return AreArgumentsEqual(invocation.TargetMethod, invocation.Arguments, otherInvocation.Arguments);
RouteHandlers\RouteHandlerAnalyzer.cs (4)
78foreach (var argument in invocation.Arguments) 176foreach (var argument in invocation.Arguments) 202invocation.Arguments.Length == 3 && 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 (9)
ForLoopIteratorInClosureAnalyzer.cs (4)
164&& invocation.Arguments.Length >= 3) 174var valueArgument = invocation.Arguments[2].Value; 184&& valueInvocation.Arguments.Length >= 2 185&& valueInvocation.Arguments[1].Value is IDelegateCreationOperation delegateCreation
InvokeAsyncOfObjectAnalyzer.cs (2)
90if (invocation.TargetMethod.IsExtensionMethod && invocation.Arguments.Length > 0) 92return invocation.Arguments[0].Value.Type;
StateHasChangedAnalyzer.cs (1)
69foreach (var argument in invocation.Arguments)
VirtualizeItemComparerAnalyzer.cs (2)
90if (invocation.Arguments.Length >= 2) 92var nameArg = invocation.Arguments[1];
Microsoft.AspNetCore.Http.RequestDelegateGenerator (3)
RequestDelegateGenerator.Emitter.cs (1)
33var hasPatternParameter = endpoint.HttpMethod != "MapFallback" || endpoint.Operation.Arguments.Length != 2;
StaticRouteHandlerModel\InvocationOperationExtensions.cs (2)
58var routeHandlerArgumentOrdinal = invocation.Arguments.Length - 1; 59foreach (var argument in invocation.Arguments)
Microsoft.AspNetCore.Mvc.Analyzers (1)
src\aspnetcore\src\Shared\Roslyn\CodeAnalysisExtensions.cs (1)
187var firstArg = invocation.Arguments.FirstOrDefault();
Microsoft.AspNetCore.Mvc.Api.Analyzers (2)
ActualApiResponseMetadataFactory.cs (1)
122var result = InspectMethodArguments(invocation.Arguments);
src\aspnetcore\src\Shared\Roslyn\CodeAnalysisExtensions.cs (1)
187var firstArg = invocation.Arguments.FirstOrDefault();
Microsoft.CodeAnalysis (1)
Operations\ControlFlowGraphBuilder.cs (1)
5942(IOperation? visitedInstance, ImmutableArray<IArgumentOperation> visitedArguments) = VisitInstanceWithArguments(instance, operation.Arguments);
Microsoft.CodeAnalysis.Analyzers (18)
FixAnalyzers\FixerWithFixAllAnalyzer.cs (1)
264foreach (var argument in invocation.Arguments)
MetaAnalyzers\CompareSymbolsCorrectlyAnalyzer.cs (3)
192var parameters = invocationOperation.Arguments; 206invocationOperation.Arguments.Any(arg => IsSymbolType(arg.Value, symbolType))) 218!invocationOperation.Arguments.Any(arg => IsSymbolType(arg.Value, iEqualityComparer)))
MetaAnalyzers\DiagnosticDescriptorCreationAnalyzer.cs (8)
341if (invocation.Arguments.IsEmpty) 345invocation.Arguments[0].Value.WalkDownConversion() is ILocalReferenceOperation localReference) 354if (invocation.Arguments[0].Value.WalkDownConversion() is IFieldReferenceOperation fieldReference) 535=> (invocation.TargetMethod, invocation.Arguments), 599invocation.Arguments.Length == 1 && 600invocation.Arguments[0].Parameter?.Type.SpecialType == SpecialType.System_String && 601invocation.Arguments[0].Value.ConstantValue.HasValue && 602invocation.Arguments[0].Value.ConstantValue.Value is string nameOfResource)
MetaAnalyzers\Fixers\CompareSymbolsCorrectlyFix.cs (4)
103document, invocation.Syntax, invocation.TargetMethod, invocation.Arguments, IsExtensionMethodUsedAsSuch(invocation), 112&& invocation.Arguments.Length > 0 113&& invocation.Arguments[0].IsImplicit; 220var arguments = invocationOperation.Arguments.Select(argument => argument.Syntax);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\IOperationExtensions.cs (2)
38var firstArg = invocation.Arguments.FirstOrDefault(); 449=> invocationOperation.IsExtensionMethodAndHasNoInstance() ? invocationOperation.Arguments[0].Value : invocationOperation.Instance;
Microsoft.CodeAnalysis.AnalyzerUtilities (22)
src\a172c07bebba4cd8\DisposeAnalysis.DisposeDataFlowOperationVisitor.cs (1)
196invocation.Arguments[^1] == operation)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\IOperationExtensions.cs (2)
38var firstArg = invocation.Arguments.FirstOrDefault(); 449=> invocationOperation.IsExtensionMethodAndHasNoInstance() ? invocationOperation.Arguments[0].Value : invocationOperation.Instance;
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\AbstractLocation.cs (1)
159IInvocationOperation invocation => invocation.Arguments,
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\DataFlowOperationVisitor.cs (18)
979invocation.Arguments[0] == operation && 1707if (invocation.Arguments.Length == 1 && FlowBranchConditionKind == ControlFlowConditionKind.WhenFalse) 1709_ = SetValueForIsNullComparisonOperator(invocation.Arguments[0].Value, equals: false, targetAnalysisData: targetAnalysisData); 1718if (invocation.Arguments.Length == 2 && 1723leftOperand = invocation.Arguments[0].Value; 1724rightOperand = invocation.Arguments[1].Value; 1726(AnalysisEntityFactory.TryCreate(invocation.Arguments[0].Value, out var analysisEntity) && 1735if (invocation.Arguments.Length == 1 && 1741rightOperand = invocation.Arguments[0].Value; 3183PostVisitInvocation(method, operation.Arguments); 3192switch (operation.Arguments.Length) 3203var wrappedOperationValue = GetCachedAbstractValue(operation.Arguments[0].Value); 3215value = GetCachedAbstractValue(operation.Arguments.GetArgumentForParameterAtIndex(0)); 3221PostVisitInvocation(operation.TargetMethod, operation.Arguments); 3278return VisitInvocation_NonLambdaOrDelegateOrLocalFunction(operation.TargetMethod, operation.Instance, operation.Arguments, 3474VisitInvocation_LocalFunction(method, operation.Arguments, operation, defaultValue) : 3475VisitInvocation_NonLambdaOrDelegateOrLocalFunction(method, instance, operation.Arguments, 3488computeValueForInvocation: () => VisitInvocation_Lambda(lambda, operation.Arguments, operation, defaultValue),
Microsoft.CodeAnalysis.CodeStyle (10)
src\roslyn\src\Analyzers\Core\Analyzers\Helpers\HashCodeAnalyzer\HashCodeAnalyzer.OperationDeconstructor.cs (2)
80invocation.Arguments.Length == 1) 85return TryAddHashedSymbol(invocation.Arguments[0].Value, seenHash: true);
src\roslyn\src\Analyzers\Core\Analyzers\SimplifyInterpolation\AbstractSimplifyInterpolationHelpers.cs (8)
140if (invocation.Arguments.Length == 1 141|| (invocation.Arguments.Length == 2 && UsesInvariantCultureReferenceInsideFormattableStringInvariant(invocation, formatProviderArgumentIndex: 1))) 143if (invocation.Arguments[0].Value is ILiteralOperation { ConstantValue: { HasValue: true, Value: string value } } literal && 158|| (invocation.Arguments.Length == 1 && UsesInvariantCultureReferenceInsideFormattableStringInvariant(invocation, formatProviderArgumentIndex: 0))) 206return IsInvariantCultureReference(invocation.Arguments[formatProviderArgumentIndex].Value) 277var argCount = invocation.Arguments.Length; 281IsSpaceChar(invocation.Arguments[1])) 283var alignmentOp = invocation.Arguments[0].Value;
Microsoft.CodeAnalysis.CSharp.Analyzers (1)
MetaAnalyzers\CSharpSemanticModelGetDeclaredSymbolAlwaysReturnsNullAnalyzer.cs (1)
83var syntaxNodeDerivingType = invocation.Arguments.GetArgumentForParameterAtIndex(1).Value.WalkDownConversion().Type;
Microsoft.CodeAnalysis.CSharp.CodeStyle (12)
src\roslyn\src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\CSharpUseIndexOperatorDiagnosticAnalyzer.cs (2)
103if (invocationOperation.Arguments.Length != 1) 110invocationOperation.Arguments[0].Value,
src\roslyn\src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\CSharpUseRangeOperatorDiagnosticAnalyzer.cs (8)
105return invocation.Arguments.Length switch 125var startOperation = invocation.Arguments[0].Value; 167var startOperation = invocation.Arguments[0].Value; 168var lengthOperation = invocation.Arguments[1].Value; 232if (!IsSubtraction(invocation.Arguments[1].Value, out var subtraction) || 243var startOperation = invocation.Arguments[0].Value; 282var startOperation = invocation.Arguments[0].Value; 299invocation.Arguments[1].Value);
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 (9)
src\roslyn\src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordHelpers.cs (4)
46Arguments: [IArgumentOperation { Value: IOperation arg }] 299IInvocationOperation { Arguments: ImmutableArray<IArgumentOperation> args }) 632Arguments: [IArgumentOperation { Value: IOperation arg }] 769Arguments: [IMemberReferenceOperation arg]
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseIndexOrRangeOperator\CSharpUseRangeOperatorCodeFixProvider.cs (5)
161if (IsSubtraction(result.InvocationOperation.Arguments[0].Value, out var subtraction) && 170return (startExpr: null, startFromEnd: false, (ExpressionSyntax)result.InvocationOperation.Arguments[0].Value.Syntax, endFromEnd: false); 175if (IsSubtraction(result.InvocationOperation.Arguments[1].Value, out var subtraction) && 184return ((ExpressionSyntax)result.InvocationOperation.Arguments[1].Value.Syntax, startFromEnd: false, endExpr: null, endFromEnd: false); 243if (result.Op1 == result.InvocationOperation.Arguments[0].Value)
Microsoft.CodeAnalysis.CSharp.Features (19)
src\roslyn\src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\CSharpUseIndexOperatorDiagnosticAnalyzer.cs (2)
103if (invocationOperation.Arguments.Length != 1) 110invocationOperation.Arguments[0].Value,
src\roslyn\src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\CSharpUseRangeOperatorDiagnosticAnalyzer.cs (8)
105return invocation.Arguments.Length switch 125var startOperation = invocation.Arguments[0].Value; 167var startOperation = invocation.Arguments[0].Value; 168var lengthOperation = invocation.Arguments[1].Value; 232if (!IsSubtraction(invocation.Arguments[1].Value, out var subtraction) || 243var startOperation = invocation.Arguments[0].Value; 282var startOperation = invocation.Arguments[0].Value; 299invocation.Arguments[1].Value);
src\roslyn\src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordHelpers.cs (4)
46Arguments: [IArgumentOperation { Value: IOperation arg }] 299IInvocationOperation { Arguments: ImmutableArray<IArgumentOperation> args }) 632Arguments: [IArgumentOperation { Value: IOperation arg }] 769Arguments: [IMemberReferenceOperation arg]
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseIndexOrRangeOperator\CSharpUseRangeOperatorCodeFixProvider.cs (5)
161if (IsSubtraction(result.InvocationOperation.Arguments[0].Value, out var subtraction) && 170return (startExpr: null, startFromEnd: false, (ExpressionSyntax)result.InvocationOperation.Arguments[0].Value.Syntax, endFromEnd: false); 175if (IsSubtraction(result.InvocationOperation.Arguments[1].Value, out var subtraction) && 184return ((ExpressionSyntax)result.InvocationOperation.Arguments[1].Value.Syntax, startFromEnd: false, endExpr: null, endFromEnd: false); 243if (result.Op1 == result.InvocationOperation.Arguments[0].Value)
Microsoft.CodeAnalysis.CSharp.NetAnalyzers (14)
Microsoft.NetCore.Analyzers\InteropServices\CSharpDisableRuntimeMarshalling.Fixer.cs (10)
103else if (operation.Arguments[0].Value is ITypeOfOperation { TypeOperand.IsUnmanagedType: true } typeOf) 110if (operation.TargetMethod.Name == "StructureToPtr" && operation.Arguments[0].Value.Type!.IsUnmanagedType) 115(ExpressionSyntax)editor.Generator.CastExpression(editor.SemanticModel.Compilation.CreatePointerTypeSymbol(operation.Arguments[0].Value.Type!), 116operation.Arguments[1].Value.Syntax)), 117operation.Arguments[0].Value.Syntax)); 124if (operation.TargetMethod.IsGenericMethod && operation.Arguments.Length == 1) 129&& operation.Arguments.Length == 2 130&& operation.Arguments[1].Value is ITypeOfOperation typeOf) 139if (operation.Arguments.Length > 0) 142IOperation pointer = operation.Arguments[0].Value;
Microsoft.NetCore.Analyzers\Performance\CSharpRecommendCaseInsensitiveStringComparisonFixer.cs (1)
54foreach (IArgumentOperation arg in mainInvocationOperation.Arguments)
Microsoft.NetCore.Analyzers\Runtime\CSharpPreferDictionaryContainsMethods.cs (1)
23receiver = containsInvocation.Arguments[0].Value;
Microsoft.NetCore.Analyzers\Runtime\CSharpPreferStreamAsyncMemoryOverloads.Fixer.cs (2)
22if (index < invocation.Arguments.Length && 25var args = invocation.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 (17)
InitializeParameter\AbstractAddParameterCheckCodeRefactoringProvider.cs (4)
476IsParameterReference(invocation.Arguments[0].Value, parameter)) 482IsParameterReference(invocation.Arguments[1].Value, parameter)) 502Arguments: [{ Value: var argumentValue }, ..] 527if (condition is IInvocationOperation { Arguments: [{ Value: var argumentValue }] } invocation &&
InlineMethod\AbstractInlineMethodRefactoringProvider.MethodParametersInfo.cs (1)
163var allArgumentOperations = invocationOperation.Arguments;
src\roslyn\src\Analyzers\Core\Analyzers\Helpers\HashCodeAnalyzer\HashCodeAnalyzer.OperationDeconstructor.cs (2)
80invocation.Arguments.Length == 1) 85return TryAddHashedSymbol(invocation.Arguments[0].Value, seenHash: true);
src\roslyn\src\Analyzers\Core\Analyzers\SimplifyInterpolation\AbstractSimplifyInterpolationHelpers.cs (8)
140if (invocation.Arguments.Length == 1 141|| (invocation.Arguments.Length == 2 && UsesInvariantCultureReferenceInsideFormattableStringInvariant(invocation, formatProviderArgumentIndex: 1))) 143if (invocation.Arguments[0].Value is ILiteralOperation { ConstantValue: { HasValue: true, Value: string value } } literal && 158|| (invocation.Arguments.Length == 1 && UsesInvariantCultureReferenceInsideFormattableStringInvariant(invocation, formatProviderArgumentIndex: 0))) 206return IsInvariantCultureReference(invocation.Arguments[formatProviderArgumentIndex].Value) 277var argCount = invocation.Arguments.Length; 281IsSpaceChar(invocation.Arguments[1])) 283var alignmentOp = invocation.Arguments[0].Value;
ValueTracking\ValueTracker.FindReferencesProgress.cs (1)
191if (invocationOperation.Arguments.Any(
ValueTracking\ValueTracker.OperationCollector.cs (1)
108await TrackArgumentsAsync(invocationOperation.Arguments, cancellationToken).ConfigureAwait(false);
Microsoft.CodeAnalysis.NetAnalyzers (186)
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\ImplementIDisposableCorrectly.cs (4)
482if (invocationExpression.Arguments.Length != 1) 487IArgumentOperation argument = invocationExpression.Arguments[0]; 604if (invocationExpression.Arguments.Length != 1) 609IOperation argumentValue = invocationExpression.Arguments[0].Value;
Microsoft.CodeQuality.Analyzers\Maintainability\AvoidLengthCalculationWhenSlicingToEnd.cs (1)
66var argumentsInParameterOrder = invocation.Arguments.GetArgumentsInParameterOrder();
Microsoft.CodeQuality.Analyzers\Maintainability\AvoidLengthCalculationWhenSlicingToEnd.Fixer.cs (2)
46invocationOperation.Arguments.Length != 2) 57invocationOperation.Arguments.GetArgumentsInParameterOrder()[0],
Microsoft.CodeQuality.Analyzers\Maintainability\UseCrossPlatformIntrinsicsAnalyzer.cs (10)
93return (invocation.Arguments.Length == 2) && 94SymbolEqualityComparer.Default.Equals(invocation.Type, invocation.Arguments[0].Parameter?.Type) && 95SymbolEqualityComparer.Default.Equals(invocation.Type, invocation.Arguments[1].Parameter?.Type) && 96(isCommutative || (invocation.Arguments[0].Parameter?.Ordinal == 0)); 101return (invocation.Arguments.Length == 2) && 102SymbolEqualityComparer.Default.Equals(invocation.Type, invocation.Arguments[0].Parameter?.Type) && 103(invocation.Arguments[1].Parameter?.Type.SpecialType is SpecialType.System_Byte or SpecialType.System_Int32) && 104(invocation.Arguments[0].Parameter?.Ordinal == 0); 109return (invocation.Arguments.Length == 1) && 110SymbolEqualityComparer.Default.Equals(invocation.Type, invocation.Arguments[0].Parameter?.Type);
Microsoft.CodeQuality.Analyzers\QualityGuidelines\AvoidMultipleEnumerations\AvoidMultipleEnumerations.DataFlowOperationVisitor.cs (1)
280foreach (var argument in invocationOperation.Arguments)
Microsoft.CodeQuality.Analyzers\QualityGuidelines\AvoidMultipleEnumerations\AvoidMultipleEnumerationsHelpers.cs (2)
209RoslynDebug.Assert(invocationOperation.Arguments.Contains(argumentOperationToCheck)); 291RoslynDebug.Assert(invocationOperation.Arguments.Contains(argumentOperationToCheck));
Microsoft.CodeQuality.Analyzers\QualityGuidelines\DoNotPassDisposablesIntoUnawaitedTasks.cs (1)
66if (!invocation.Arguments.AnyWhere(arg => arg.Parameter?.Type?.AllInterfaces is { Length: > 0 } allInterfaces &&
Microsoft.NetCore.Analyzers\Data\ReviewSqlQueriesForSecurityVulnerabilities.cs (1)
98AnalyzeMethodCall(operationContext, invocation.TargetMethod, symbol, invocation.Arguments, invocation.Syntax, isInDbCommandConstructor, isInDataAdapterConstructor, iDbCommandType, iDataAdapterType);
Microsoft.NetCore.Analyzers\ImmutableCollections\DoNotCallToImmutableCollectionOnAnImmutableCollectionValue.cs (1)
82if (invocation.Arguments.Skip(argumentsToSkip).Any(arg => arg.ArgumentKind == ArgumentKind.Explicit))
Microsoft.NetCore.Analyzers\InteropServices\DisableRuntimeMarshallingAnalyzer.DelegateInteropUsageAnalyzer.cs (2)
59if (operation.Arguments.Length == 2 && operation.Arguments.GetArgumentForParameterAtIndex(1) is { Value: ITypeOfOperation { TypeOperand: INamedTypeSymbol { TypeKind: TypeKind.Delegate } delegateType } } arg)
Microsoft.NetCore.Analyzers\InteropServices\DisableRuntimeMarshallingAnalyzer.DisabledRuntimeMarshallingAssemblyAnalyzer.cs (4)
92"SizeOf" => invocation.TargetMethod.IsGenericMethod || (invocation.Arguments.Length > 0 && invocation.Arguments.GetArgumentForParameterAtIndex(0).Value is ITypeOfOperation { TypeOperand.IsUnmanagedType: true }), 93"StructureToPtr" => invocation.Arguments.Length > 0 && invocation.Arguments.GetArgumentForParameterAtIndex(0).Value is { Type.IsUnmanagedType: true },
Microsoft.NetCore.Analyzers\InteropServices\PlatformCompatibilityAnalyzer.cs (5)
397invocation.Arguments.Length == 1 && 398invocation.Arguments[0].Value is { } argument && 452if (invocation.Arguments.Length == 1 && 453invocation.Arguments[0].Value is IPropertyReferenceOperation propertyReference && 465foreach (var argument in invocation.Arguments)
Microsoft.NetCore.Analyzers\InteropServices\UseValidPlatformString.cs (2)
158invocation.Arguments.Length > 0 && 159invocation.Arguments[0].Value is { } argument &&
Microsoft.NetCore.Analyzers\Performance\AvoidPotentiallyExpensiveCallWhenLogging.cs (5)
92foreach (var argument in invocation.Arguments.Skip(invocation.IsExtensionMethodAndHasNoInstance() ? 1 : 0)) 314logLevelArgumentOperation = invocation.Arguments.GetArgumentForParameterAtIndex(0); 330logLevelArgumentOperation = invocation.Arguments.GetArgumentForParameterAtIndex(invocation.IsExtensionMethodAndHasNoInstance() ? 1 : 0); 354logLevelArgumentOperation = invocation.Arguments 413!IsSameLogLevel(invocation.Arguments[0]))
Microsoft.NetCore.Analyzers\Performance\CollapseMultiplePathOperations.cs (4)
110if (invocation.Arguments.IsEmpty || 157foreach (var argument in invocation.Arguments) 220foreach (var argument in invocation.Arguments) 275foreach (var argument in invocation.Arguments)
Microsoft.NetCore.Analyzers\Performance\ConstantExpectedAnalyzer.cs (1)
180foreach (var argument in invocation.Arguments)
Microsoft.NetCore.Analyzers\Performance\DoNotGuardCall.cs (1)
149invocation.Arguments.TryGetArgumentForParameterAtIndex(parameterIndex, out var argument);
Microsoft.NetCore.Analyzers\Performance\PreferConvertToHexStringOverBitConverter.cs (1)
265!HasStringReplaceArgumentsToRemoveHyphen(invocation.Arguments))
Microsoft.NetCore.Analyzers\Performance\PreferConvertToHexStringOverBitConverter.Fixer.cs (2)
89var bitConverterArgumentsInParameterOrder = bitConverterInvocation.Arguments.GetArgumentsInParameterOrder(); 118toLowerInvocation.Arguments.Select(a => a.Value.Syntax).ToArray());
Microsoft.NetCore.Analyzers\Performance\PreferDictionaryTryMethodsOverContainsKeyGuardAnalyzer.cs (8)
160var usageContext = new DictionaryUsageContext(containsOperation.Instance!, containsOperation.Arguments[0].Value, addSymbol); 206var arguments = invocation.Arguments[0].Descendants().Concat(invocation.Arguments[1].Descendants()); 339case Add or Remove when invocation.Arguments.Length >= 1 && 340IsSameConstantOrReferenceOperation(invocation.Arguments[0].Value, usageContext.ContainsKeyArgumentReference): 347&& IsSameConstantOrReferenceOperation(invocation.Arguments[0].Value, usageContext.ContainsKeyArgumentReference) 348&& invocation.Arguments[1].Value.Kind is OperationKind.Literal or OperationKind.LocalReference or OperationKind.FieldReference or OperationKind.ParameterReference or OperationKind.ConstantPattern 503IsSameConstantOrReferenceOperation(invocation.Arguments[0].Value, usageContext.ContainsKeyArgumentReference):
Microsoft.NetCore.Analyzers\Performance\RecommendCaseInsensitiveStringComparison.Analyzer.cs (2)
275Debug.Assert(!invocation.Arguments.IsEmpty); 277if (TryGetInvocationWithoutParentheses(invocation.Arguments[0].Value, out IInvocationOperation? maybeRightOffendingInvocation))
Microsoft.NetCore.Analyzers\Performance\RecommendCaseInsensitiveStringComparison.Fixer.cs (1)
146Debug.Assert(mainInvocation.Arguments.Length <= 3);
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 (2)
316IOperation? constantOperation = isInstance ? parent.Arguments[0].Value : parent.Instance; 550if (invocationOperation.Arguments.Length != 1)
Microsoft.NetCore.Analyzers\Performance\UseSearchValues.cs (2)
74Debug.Assert(invocation.Arguments.Length is 1 or 2); 75IArgumentOperation valuesArgument = invocation.Arguments[^1];
Microsoft.NetCore.Analyzers\Performance\UseSpanClearInsteadOfFill.cs (2)
69&& invocation.Arguments.Length == 1 70&& IsDefaultValue(invocation.Arguments[0]))
Microsoft.NetCore.Analyzers\Performance\UseStartsWithInsteadOfIndexOfComparisonWithZero.cs (1)
140locationsBuilder.AddRange(invocation.Arguments.Select(arg => arg.Syntax.GetLocation()));
Microsoft.NetCore.Analyzers\Performance\UseStringContainsCharOverloadWithSingleCharactersAnalyzer.cs (1)
71var argumentOperation = invocationOperation.Arguments.GetArgumentForParameterAtIndex(0);
Microsoft.NetCore.Analyzers\Performance\UseStringMethodCharOverloadWithSingleCharacters.cs (2)
166foreach (var argument in invocationOperation.Arguments) 215var argument = invocationOperation.Arguments.GetArgumentForParameterAtIndex(0);
Microsoft.NetCore.Analyzers\Runtime\AvoidConstArrays.cs (1)
83argumentOperation = invocationOperation.Arguments.FirstOrDefault();
Microsoft.NetCore.Analyzers\Runtime\AvoidRedundantRegexIsMatchBeforeMatch.cs (6)
249foreach (var arg in invocation.Arguments) 478if (isMatchInvocation.Arguments.Length != matchInvocation.Arguments.Length) 485foreach (IArgumentOperation isMatchArg in isMatchInvocation.Arguments) 493foreach (IArgumentOperation candidate in matchInvocation.Arguments) 615foreach (var arg in invocation.Arguments)
Microsoft.NetCore.Analyzers\Runtime\AvoidUnreliableStreamRead.Fixer.cs (2)
87var arguments = invocation.Arguments.GetArgumentsInParameterOrder(); 103invocation.Arguments.Where(a => !a.IsImplicit).Select(a => a.Syntax));
Microsoft.NetCore.Analyzers\Runtime\AvoidZeroLengthArrayAllocations.cs (1)
144arguments = invocation.Arguments;
Microsoft.NetCore.Analyzers\Runtime\BufferBlockCopyLengthAnalyzer.cs (1)
82ImmutableArray<IArgumentOperation> arguments = IOperationExtensions.GetArgumentsInParameterOrder(invocationOperation.Arguments);
Microsoft.NetCore.Analyzers\Runtime\CallGCSuppressFinalizeCorrectly.cs (2)
152if (!invocationExpression.Arguments.HasExactly(1)) 157if (invocationExpression.SemanticModel!.GetSymbolInfo(invocationExpression.Arguments.Single().Value.Syntax, analysisContext.CancellationToken).Symbol is not IParameterSymbol parameterSymbol || !parameterSymbol.IsThis)
Microsoft.NetCore.Analyzers\Runtime\DoNotLockOnObjectsWithWeakIdentity.cs (2)
62invocationOperation.Arguments.IsEmpty) 69invocationOperation.Arguments[0].Value is IConversionOperation conversionOperation)
Microsoft.NetCore.Analyzers\Runtime\DoNotUseReferenceEqualsWithValueTypes.cs (1)
109foreach (var argument in invocationExpression.Arguments)
Microsoft.NetCore.Analyzers\Runtime\ForwardCancellationTokenToInvocations.Analyzer.cs (4)
143invocation.Arguments, 152if (InvocationMethodTakesAToken(method, invocation.Arguments, cancellationTokenType)) 154if (ArgumentsImplicitOrNamed(cancellationTokenType, invocation.Arguments)) 162if (ArgumentsImplicitOrNamed(cancellationTokenType, invocation.Arguments))
Microsoft.NetCore.Analyzers\Runtime\ForwardCancellationTokenToInvocations.Fixer.cs (1)
100var paramsArrayType = invocation.Arguments.SingleOrDefault(a => a.ArgumentKind == ArgumentKind.ParamArray)?.Value.Type as IArrayTypeSymbol;
Microsoft.NetCore.Analyzers\Runtime\LoggerMessageDefineAnalyzer.cs (2)
151var arg = invocation.Arguments.FirstOrDefault(argument => 160foreach (var argument in invocation.Arguments)
Microsoft.NetCore.Analyzers\Runtime\NormalizeStringsToUppercase.cs (1)
82((invocation.Arguments.FirstOrDefault()?.Value as IMemberReferenceOperation)?.Member.Equals(invariantCulture) ?? false)))
Microsoft.NetCore.Analyzers\Runtime\PreferAsSpanOverSubstring.cs (1)
102foreach (var argument in invocation.Arguments)
Microsoft.NetCore.Analyzers\Runtime\PreferAsSpanOverSubstring.Fixer.cs (1)
62foreach (var argument in reportedInvocation.Arguments)
Microsoft.NetCore.Analyzers\Runtime\PreferConstCharOverConstUnitStringAnalyzer.cs (2)
63if (invocationOperation.Arguments.IsEmpty) 73ImmutableArray<IArgumentOperation> arguments = invocationOperation.Arguments;
Microsoft.NetCore.Analyzers\Runtime\PreferJsonElementParse.Fixer.cs (1)
62var arguments = invocation.Arguments.Select(arg => arg.Syntax).ToArray();
Microsoft.NetCore.Analyzers\Runtime\PreferStreamAsyncMemoryOverloads.Fixer.cs (1)
77if (invocation.Arguments.Length is not (3 or 4))
Microsoft.NetCore.Analyzers\Runtime\PreferStringContainsOverIndexOf.Fixer.cs (2)
57switch (invocationOperation.Arguments.Length) 71createChangedDocument: c => ReplaceBinaryOperationWithContains(doc, instanceOperation.Syntax, invocationOperation.Arguments, binaryOperation, c),
Microsoft.NetCore.Analyzers\Runtime\PreferTypedStringBuilderAppendOverloads.cs (2)
111if (invocation.Arguments.Length != stringParamIndex + 1 || 112invocation.Arguments[stringParamIndex] is not IArgumentOperation argument)
Microsoft.NetCore.Analyzers\Runtime\ProvideCorrectArgumentsToFormattingMethods.cs (3)
65if (info == null || invocation.Arguments.Length <= info.FormatStringIndex) 71IArgumentOperation formatStringArgument = invocation.Arguments[info.FormatStringIndex]; 112IArgumentOperation paramsArgument = invocation.Arguments[info.FormatStringIndex + 1];
Microsoft.NetCore.Analyzers\Runtime\SpecifyIFormatProvider.cs (5)
252var currentCallHasNullFormatProvider = invocationExpression.Arguments.Any(x => 273foreach (var argument in invocationExpression.Arguments) 342if (invocationOperation.Arguments.Length != 1 || 343!invocationOperation.Arguments[0].Value.ConstantValue.HasValue || 344invocationOperation.Arguments[0].Value.ConstantValue.Value is not string format)
Microsoft.NetCore.Analyzers\Runtime\TestForEmptyStringsUsingStringLength.cs (2)
76if (!invocationOperation.Arguments.IsEmpty) 169return invocation.Arguments.Any(arg => IsEmptyString(arg.Value));
Microsoft.NetCore.Analyzers\Runtime\UseAsyncMethodInAsyncContext.cs (2)
177Debug.Assert(!invocation.Arguments.IsEmpty); 179IOperation argumentValue = invocation.Arguments[0].Value;
Microsoft.NetCore.Analyzers\Runtime\UseExceptionThrowHelpers.cs (1)
400invocationOperation.Arguments is [IArgumentOperation arg] &&
Microsoft.NetCore.Analyzers\Runtime\UseOrdinalStringComparison.cs (1)
65IArgumentOperation lastArgument = operation.Arguments.Last();
Microsoft.NetCore.Analyzers\Runtime\UseRegexMembersFixer.cs (1)
72regexCall.Arguments.Select(arg => arg.Syntax)); // use the exact same arguments
Microsoft.NetCore.Analyzers\Runtime\UseSpanBasedStringConcat.Fixer.cs (1)
156foreach (var argument in substringInvocation.Arguments)
Microsoft.NetCore.Analyzers\Runtime\UseStringEqualsOverStringCompare.cs (2)
208if (invocation!.Arguments.FirstOrDefault()?.Value is ILiteralOperation { ConstantValue.Value: 0 }) 272invocation.Arguments.GetArgumentForParameterAtIndex(2).Value is ILiteralOperation literal &&
Microsoft.NetCore.Analyzers\Runtime\UseStringEqualsOverStringCompare.Fixer.cs (6)
163compareInvocation.Arguments.GetArgumentsInParameterOrder().Select(x => x.Value.Syntax)); 188var ignoreCaseLiteral = (ILiteralOperation)compareInvocation.Arguments.GetArgumentForParameterAtIndex(2).Value; 203compareInvocation.Arguments.GetArgumentForParameterAtIndex(0).Value.Syntax, 204compareInvocation.Arguments.GetArgumentForParameterAtIndex(1).Value.Syntax, 229invocation.Arguments.GetArgumentsInParameterOrder().Select(x => x.Value.Syntax)); 253compareInvocation.Arguments.GetArgumentsInParameterOrder().Select(x => x.Value.Syntax));
Microsoft.NetCore.Analyzers\Security\DataSetDataTableInSerializableObjectGraphAnalyzer.cs (1)
202.Arguments[0]
Microsoft.NetCore.Analyzers\Security\DoNotSetSwitch.cs (3)
110var values = invocationOperation.Arguments.Select(s => s.Value.ConstantValue).ToArray(); 150invocationOperation.Arguments[0].Syntax]; 153invocationOperation.Arguments[1].Syntax];
Microsoft.NetCore.Analyzers\Security\DoNotUseDSA.cs (1)
125var arguments = invocationOperation.Arguments;
Microsoft.NetCore.Analyzers\Security\SourceTriggeredTaintedDataAnalyzerBase.cs (1)
172invocationOperation.Arguments,
Microsoft.NetCore.Analyzers\Security\UseAutoValidateAntiforgeryToken.cs (1)
184.Arguments
Microsoft.NetCore.Analyzers\Security\UseContainerLevelAccessPolicy.cs (1)
126var argumentOperation = invocationOperation.Arguments.FirstOrDefault(
Microsoft.NetCore.Analyzers\Security\UseRSAWithSufficientKeySize.cs (1)
114var arguments = invocationOperation.Arguments;
Microsoft.NetCore.Analyzers\Security\UseSharedAccessProtocolHttpsOnly.cs (1)
122var protocolsArgumentOperation = invocationOperation.Arguments.FirstOrDefault(s => s.Parameter?.Name == "protocols" &&
Microsoft.NetCore.Analyzers\Tasks\DoNotConfigureAwaitWithSuppressThrowing.cs (2)
62invocation.Arguments.Length == 1 && 63invocation.Arguments[0].Value is IOperation { ConstantValue.HasValue: true } arg &&
Microsoft.NetCore.Analyzers\Tasks\DoNotCreateTaskCompletionSourceWithWrongArguments.cs (1)
61conversionOperation = MatchInvalidContinuationOptions(invocation.TargetMethod, invocation.Arguments);
Microsoft.NetCore.Analyzers\Tasks\DoNotUseNonCancelableTaskDelayWithWhenAny.cs (2)
69for (int i = 0; i < invocation.Arguments.Length; i++) 71var argument = invocation.Arguments[i].Value.WalkDownConversion();
Microsoft.NetCore.Analyzers\Tasks\DoNotUseWhenAllOrWaitAllWithSingleArgument.cs (2)
98if (invocation.Arguments.Length != 1) 103var argument = invocation.Arguments.Single();
Microsoft.NetCore.Analyzers\Tasks\DoNotUseWhenAllOrWaitAllWithSingleArgumentFixer.cs (1)
100=> ((IArrayCreationOperation)operation.Arguments[0].Value).Initializer?.ElementValues[0].Syntax!;
Microsoft.NetCore.Analyzers\Tasks\UseValueTasksCorrectly.cs (2)
476!assert.Arguments.IsEmpty && 477OperationImpliesCompletion(valueTaskSymbol, assert.Arguments[0].Value) == true)
Microsoft.NetCore.Analyzers\Usage\DoNotPassNonNullableValueToArgumentNullExceptionThrowIfNull.cs (3)
66if (invocation.Arguments[0].Value.WalkDownConversion().Type.IsNonNullableValueType() 67|| invocation.Arguments[0].Value.WalkDownConversion().Kind is OperationKind.NameOf or OperationKind.ObjectCreation or OperationKind.ObjectOrCollectionInitializer) 72if (invocation.Arguments[0].Value.WalkDownConversion().Type.IsNullableValueType())
Microsoft.NetCore.Analyzers\Usage\PreferGenericOverloads.cs (1)
157var argumentsInParameterOrder = invocation.Arguments.GetArgumentsInParameterOrder();
Microsoft.NetCore.Analyzers\Usage\ProvideCorrectArgumentToEnumHasFlag.cs (2)
49invocation.Arguments.Length == 1 && 52invocation.Arguments[0].Value is IConversionOperation conversion &&
Microsoft.NetCore.Analyzers\Usage\UseVolatileReadWrite.Fixer.cs (2)
75arguments = [GetArgumentForVolatileReadCall(invocationOperation.Arguments[0], volatileReadMethod.Parameters[0])]; 80arguments = GetArgumentForVolatileWriteCall(invocationOperation.Arguments, volatileWriteMethod.Parameters);
Microsoft.NetFramework.Analyzers\DoNotUseInsecureDtdProcessing.cs (1)
246AnalyzeMethodOverloads(context, invocation.TargetMethod, invocation.Arguments, invocation.Syntax);
Microsoft.NetFramework.Analyzers\DoNotUseInsecureXSLTScriptExecution.cs (2)
82invocation.Arguments, 238OperationKind.Invocation => ((IInvocationOperation)rhs).Arguments,
src\afc74d572e54ec72\DisposeAnalysis.DisposeDataFlowOperationVisitor.cs (1)
193invocation.Arguments[^1] == operation)
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\Compiler\Extensions\IOperationExtensions.cs (3)
39var firstArg = invocation.Arguments.FirstOrDefault(); 636=> invocationOperation.IsExtensionMethodAndHasNoInstance() ? invocationOperation.Arguments[0].Value : invocationOperation.Instance; 786foreach (IArgumentOperation argumentOperation in invocationOperation.Arguments)
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\AbstractLocation.cs (1)
158IInvocationOperation invocation => invocation.Arguments,
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\DataFlowOperationVisitor.cs (18)
976invocation.Arguments[0] == operation && 1704if (invocation.Arguments.Length == 1 && FlowBranchConditionKind == ControlFlowConditionKind.WhenFalse) 1706_ = SetValueForIsNullComparisonOperator(invocation.Arguments[0].Value, equals: false, targetAnalysisData: targetAnalysisData); 1715if (invocation.Arguments.Length == 2 && 1720leftOperand = invocation.Arguments[0].Value; 1721rightOperand = invocation.Arguments[1].Value; 1723(AnalysisEntityFactory.TryCreate(invocation.Arguments[0].Value, out var analysisEntity) && 1732if (invocation.Arguments.Length == 1 && 1738rightOperand = invocation.Arguments[0].Value; 3180PostVisitInvocation(method, operation.Arguments); 3189switch (operation.Arguments.Length) 3200var wrappedOperationValue = GetCachedAbstractValue(operation.Arguments[0].Value); 3212value = GetCachedAbstractValue(operation.Arguments.GetArgumentForParameterAtIndex(0)); 3218PostVisitInvocation(operation.TargetMethod, operation.Arguments); 3275return VisitInvocation_NonLambdaOrDelegateOrLocalFunction(operation.TargetMethod, operation.Instance, operation.Arguments, 3471VisitInvocation_LocalFunction(method, operation.Arguments, operation, defaultValue) : 3472VisitInvocation_NonLambdaOrDelegateOrLocalFunction(method, instance, operation.Arguments, 3485computeValueForInvocation: () => VisitInvocation_Lambda(lambda, operation.Arguments, operation, defaultValue),
Microsoft.CodeAnalysis.ResxSourceGenerator (2)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\IOperationExtensions.cs (2)
38var firstArg = invocation.Arguments.FirstOrDefault(); 449=> invocationOperation.IsExtensionMethodAndHasNoInstance() ? invocationOperation.Arguments[0].Value : invocationOperation.Instance;
Microsoft.CodeAnalysis.VisualBasic.NetAnalyzers (3)
Microsoft.NetCore.Analyzers\Performance\BasicRecommendCaseInsensitiveStringComparisonFixer.vb (1)
58For Each arg As IArgumentOperation In mainInvocationOperation.Arguments
Microsoft.NetCore.Analyzers\Runtime\BasicPreferStreamAsyncMemoryOverloads.Fixer.vb (2)
20If index < invocation.Arguments.Length Then 21Dim args = invocation.Arguments
Microsoft.Extensions.Configuration.Binder.SourceGeneration (3)
Parser\ConfigurationBinder.cs (3)
81IArgumentOperation instanceArg = GetArgumentForParameterAtIndex(operation.Arguments, instanceIndex); 172ITypeOfOperation? typeOfOperation = GetArgumentForParameterAtIndex(operation.Arguments, 1).ChildOperations.FirstOrDefault() as ITypeOfOperation; 227ITypeOfOperation? typeOfOperation = GetArgumentForParameterAtIndex(operation.Arguments, 1).ChildOperations.FirstOrDefault() as ITypeOfOperation;
Microsoft.Extensions.Validation.ValidationsGenerator (2)
src\768f3af0174e68df\InvocationOperationExtensions.cs (2)
58var routeHandlerArgumentOrdinal = invocation.Arguments.Length - 1; 59foreach (var argument in invocation.Arguments)
Microsoft.Interop.ComInterfaceGenerator (1)
src\runtime\src\libraries\System.Runtime.InteropServices\gen\Common\OperationExtensions.cs (1)
19foreach (IArgumentOperation argument in operation.Arguments)
Microsoft.Interop.LibraryImportGenerator (1)
src\runtime\src\libraries\System.Runtime.InteropServices\gen\Common\OperationExtensions.cs (1)
19foreach (IArgumentOperation argument in operation.Arguments)
Microsoft.Interop.LibraryImportGenerator.Downlevel (1)
src\runtime\src\libraries\System.Runtime.InteropServices\gen\Common\OperationExtensions.cs (1)
19foreach (IArgumentOperation argument in operation.Arguments)
Roslyn.Diagnostics.Analyzers (5)
ImmutableArrayBoxingAnalyzer.cs (1)
78var instance = invocation.Instance ?? invocation.Arguments.FirstOrDefault()?.Value;
PooledArrayBuilderAsRefAnalyzer.cs (1)
64var instance = invocation.Instance ?? invocation.Arguments.FirstOrDefault()?.Value;
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\IOperationExtensions.cs (2)
38var firstArg = invocation.Arguments.FirstOrDefault(); 449=> invocationOperation.IsExtensionMethodAndHasNoInstance() ? invocationOperation.Arguments[0].Value : invocationOperation.Instance;
TemporaryArrayAsRefAnalyzer.cs (1)
62var instance = invocation.Instance ?? invocation.Arguments.FirstOrDefault()?.Value;
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 (4)
UpgradeToGeneratedRegexAnalyzer.cs (1)
44ValidateParameters(inv.Arguments),
UpgradeToGeneratedRegexCodeFixer.cs (3)
157operationArguments = invocationOperation.Arguments; 234((IInvocationOperation)operation).Arguments; 279((IInvocationOperation)operation).Arguments;