Implemented interface member:
982 references to Count
GenerateDocumentationAndConfigFiles (12)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\RefactoringHelpers\AbstractRefactoringHelpers.cs (1)
437if (variables.Count == 1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\LightweightOverloadResolution.cs (10)
54if (arguments.Count > 0) 78for (var i = 0; i < arguments.Count; i++) 86for (var argumentIndex = 0; argumentIndex < arguments.Count; argumentIndex++) 163for (var i = 0; i < arguments.Count; i++) 166for (var i = 0; i < arguments.Count; i++) 169if (parameterIndex >= 0 && parameterIndex < arguments.Count) 187Contract.ThrowIfTrue(argumentToParameterMap.Count != arguments.Count); 193for (var argumentIndex = 0; argumentIndex < arguments.Count; argumentIndex++) 260for (var i = 0; i < arguments.Count - 1; i++) 268return arguments.Count - 1;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.State.cs (1)
65if (variables.Count != 1)
ILLink.CodeFixProvider (2)
RequiresUnsafeCodeFixProvider.cs (2)
173localDecl.Declaration.Variables.Count == 1 && 220if (localDeclStmt.Declaration.Variables.Count == 1)
Microsoft.AspNetCore.App.Analyzers (1)
RouteEmbeddedLanguage\Infrastructure\RouteUsageDetector.cs (1)
325if (index >= argumentList.Arguments.Count)
Microsoft.AspNetCore.App.CodeFixes (5)
Authorization\AddAuthorizationBuilderFixer.cs (2)
61if (diagnosticTarget is InvocationExpressionSyntax { ArgumentList.Arguments: { Count: 1 } arguments, Expression: MemberAccessExpressionSyntax { Name.Identifier: { } identifierToken } memberAccessExpression } 87if (configureAction is InvocationExpressionSyntax { ArgumentList.Arguments: { Count: 2 } configureArguments, Expression: MemberAccessExpressionSyntax { Name.Identifier.Text: "AddPolicy" } })
Http\HeaderDictionaryAddFixer.cs (1)
120ArgumentList.Arguments: { Count: 2 } arguments
Kestrel\ListenOnIPv6AnyFixer.cs (2)
47if (argumentSyntax.Parent?.Parent is not InvocationExpressionSyntax { ArgumentList.Arguments.Count: > 1 } invocationExpressionSyntax) 58if (adjustedArgumentList is null || adjustedArgumentList.Arguments.Count == 0)
Microsoft.AspNetCore.OpenApi.SourceGenerators (1)
XmlCommentGenerator.Parser.cs (1)
157var argumentsCount = invocationExpression.ArgumentList.Arguments.Count;
Microsoft.CodeAnalysis (17)
Syntax\SeparatedSyntaxList.cs (15)
229return this[this.Count - 1]; 236return this[this.Count - 1]; 249for (int i = 0, n = this.Count; i < n; i++) 262for (int i = 0, n = this.Count; i < n; i++) 275for (int i = 0, n = this.Count; i < n; i++) 288for (int i = this.Count - 1; i >= 0; i--) 301for (int i = this.Count - 1; i >= 0; i--) 319for (int i = 0; i < this.Count; i++) 366return Insert(this.Count, node); 375return InsertRange(this.Count, nodes); 405if (index < 0 || index > this.Count) 411int insertionIndex = index < this.Count ? nodesWithSeps.IndexOf(this[index]) : nodesWithSeps.Count; 472if (index < 0 || index > this.Count) 522if (index >= 0 && index < this.Count) 543if (index >= 0 && index < this.Count)
Syntax\SeparatedSyntaxList.Enumerator.cs (1)
32if (newIndex < _list.Count)
Syntax\SeparatedSyntaxListExtensions.cs (1)
14int n = list.Count;
Microsoft.CodeAnalysis.Analyzers (12)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\RefactoringHelpers\AbstractRefactoringHelpers.cs (1)
437if (variables.Count == 1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\LightweightOverloadResolution.cs (10)
54if (arguments.Count > 0) 78for (var i = 0; i < arguments.Count; i++) 86for (var argumentIndex = 0; argumentIndex < arguments.Count; argumentIndex++) 163for (var i = 0; i < arguments.Count; i++) 166for (var i = 0; i < arguments.Count; i++) 169if (parameterIndex >= 0 && parameterIndex < arguments.Count) 187Contract.ThrowIfTrue(argumentToParameterMap.Count != arguments.Count); 193for (var argumentIndex = 0; argumentIndex < arguments.Count; argumentIndex++) 260for (var i = 0; i < arguments.Count - 1; i++) 268return arguments.Count - 1;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.State.cs (1)
65if (variables.Count != 1)
Microsoft.CodeAnalysis.AnalyzerUtilities (11)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\RefactoringHelpers\AbstractRefactoringHelpers.cs (1)
437if (variables.Count == 1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\LightweightOverloadResolution.cs (10)
54if (arguments.Count > 0) 78for (var i = 0; i < arguments.Count; i++) 86for (var argumentIndex = 0; argumentIndex < arguments.Count; argumentIndex++) 163for (var i = 0; i < arguments.Count; i++) 166for (var i = 0; i < arguments.Count; i++) 169if (parameterIndex >= 0 && parameterIndex < arguments.Count) 187Contract.ThrowIfTrue(argumentToParameterMap.Count != arguments.Count); 193for (var argumentIndex = 0; argumentIndex < arguments.Count; argumentIndex++) 260for (var i = 0; i < arguments.Count - 1; i++) 268return arguments.Count - 1;
Microsoft.CodeAnalysis.CodeStyle (26)
src\roslyn\src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (1)
247errorCodeNodes.Count > 0)
src\roslyn\src\Analyzers\Core\Analyzers\UseCoalesceExpression\AbstractUseCoalesceExpressionForIfNullCheckDiagnosticAnalyzer.cs (1)
168if (declarators.Count != 1)
src\roslyn\src\Analyzers\Core\Analyzers\UseCollectionInitializer\UpdateExpressionState.cs (8)
190if (arguments.Count == 1) 195if (arguments.Count == 2 && 249Contract.ThrowIfTrue(arguments.Count == 0); 267if (arguments.Count > 1) 278if (arguments.Count != 1) 303if (arguments.Count < 1) 306if (requiredArgumentName != null && arguments.Count != 1) 382if (supportedArgumentCount >= 0 && elementAccessArguments.Count != supportedArgumentCount)
src\roslyn\src\Analyzers\Core\Analyzers\UseIsNullCheck\AbstractUseIsNullForReferenceEqualsDiagnosticAnalyzer.cs (1)
90if (arguments.Count != 2)
src\roslyn\src\Analyzers\Core\Analyzers\UseNullPropagation\AbstractUseNullPropagationDiagnosticAnalyzer.cs (1)
343if (arguments.Count != 2)
src\roslyn\src\Analyzers\Core\Analyzers\ValidateFormatString\AbstractValidateFormatStringDiagnosticAnalyzer.cs (3)
138var numberOfArguments = arguments.Count; 229if (parameterWithMatchingName.Ordinal >= arguments.Count) 236if (parameterWithMatchingName.IsParams && parameters.Length != arguments.Count)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\RefactoringHelpers\AbstractRefactoringHelpers.cs (1)
437if (variables.Count == 1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\LightweightOverloadResolution.cs (10)
54if (arguments.Count > 0) 78for (var i = 0; i < arguments.Count; i++) 86for (var argumentIndex = 0; argumentIndex < arguments.Count; argumentIndex++) 163for (var i = 0; i < arguments.Count; i++) 166for (var i = 0; i < arguments.Count; i++) 169if (parameterIndex >= 0 && parameterIndex < arguments.Count) 187Contract.ThrowIfTrue(argumentToParameterMap.Count != arguments.Count); 193for (var argumentIndex = 0; argumentIndex < arguments.Count; argumentIndex++) 260for (var i = 0; i < arguments.Count - 1; i++) 268return arguments.Count - 1;
Microsoft.CodeAnalysis.CodeStyle.Fixes (5)
src\roslyn\src\Analyzers\Core\CodeFixes\AddExplicitCast\Fixer.cs (1)
130for (var i = 0; i < arguments.Count; i++)
src\roslyn\src\Analyzers\Core\CodeFixes\AddParameter\AbstractAddParameterCodeFixProvider.cs (2)
209if (isNamedArgument || NonParamsParameterCount(method) < arguments.Count) 443for (int i = 0, n = arguments.Count; i < n; i++)
src\roslyn\src\Analyzers\Core\CodeFixes\RemoveUnusedParametersAndValues\AbstractRemoveUnusedValuesCodeFixProvider.cs (1)
636if (variables.Count == 1 &&
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.State.cs (1)
65if (variables.Count != 1)
Microsoft.CodeAnalysis.CSharp (107)
Binder\Binder_AnonymousTypes.cs (1)
27int fieldCount = initializers.Count;
Binder\Binder_Constraints.cs (2)
129for (int i = 0, n = constraintsSyntax.Count; i < n; i++) 367var builder = ArrayBuilder<TypeParameterConstraintClause>.GetInstance(typeParameterList.Parameters.Count);
Binder\Binder_Crefs.cs (4)
253int extensionArity = extensionTypeArguments?.Arguments.Count ?? 0; 436memberName = parameterListSyntax != null && parameterListSyntax.Parameters.Count == 1 442if (operatorTokenKind is SyntaxKind.PlusPlusToken or SyntaxKind.MinusMinusToken && parameterListSyntax?.Parameters.Count == 0) 1132ArrayBuilder<ParameterSymbol> parameterBuilder = ArrayBuilder<ParameterSymbol>.GetInstance(parameterListSyntax.Parameters.Count);
Binder\Binder_Deconstruct.cs (1)
779var builder = ArrayBuilder<DeconstructionVariable>.GetInstance(component.Arguments.Count);
Binder\Binder_Expressions.cs (12)
996int count = tuple.Variables.Count; 1039int numElements = arguments.Count; 1053var boundArguments = ArrayBuilder<BoundExpression>.GetInstance(arguments.Count); 1054var elementTypesWithAnnotations = ArrayBuilder<TypeWithAnnotations>.GetInstance(arguments.Count); 1055var elementLocations = ArrayBuilder<Location>.GetInstance(arguments.Count); 1121int numElements = arguments.Count; 1684Debug.Assert(node.Arity == typeArgumentList.Count); 4613rankSpecifiers[0].Sizes.Count != 1) 5348var builder = ArrayBuilder<BoundNode>.GetInstance(syntax.Elements.Count); 5851var initializers = ArrayBuilder<BoundExpression>.GetInstance(initializerSyntax.Expressions.Count); 7810bool rightHasTypeArguments = typeArgumentsSyntax.Count > 0; 7937var typeArguments = typeArgumentsSyntax.Count > 0 ? BindTypeArguments(typeArgumentsSyntax, diagnostics) : default(ImmutableArray<TypeWithAnnotations>);
Binder\Binder_Lambda.cs (4)
145for (int i = 0, n = parameterSyntaxList.Count; i < n; i++) 191if (parameterCount == parameterSyntaxList.Count && 266var discardsBuilder = ArrayBuilder<bool>.GetInstance(parameters.Count); 327if (parameterSyntaxList.Count > 0)
Binder\Binder_Patterns.cs (15)
718var builder = ArrayBuilder<BoundPattern>.GetInstance(subpatterns.Count); 1594var patternsBuilder = ArrayBuilder<BoundPositionalSubpattern>.GetInstance(positionalClause.Subpatterns.Count); 1616positionalClause.Subpatterns.Count, inputPlaceholder, positionalClause, 1682for (int i = 0; i < node.Subpatterns.Count; i++) 1771if (elementTypesWithAnnotations.Length != node.Subpatterns.Count && !hasErrors) 1773diagnostics.Add(ErrorCode.ERR_WrongNumberOfSubpatterns, node.Location, declType, elementTypesWithAnnotations.Length, node.Subpatterns.Count); 1778for (int i = 0; i < node.Subpatterns.Count; i++) 2012var subPatterns = ArrayBuilder<BoundPositionalSubpattern>.GetInstance(tupleDesignation.Variables.Count); 2034tupleDesignation.Variables.Count, inputPlaceholder, node, deconstructDiagnostics, 2054hasErrors = outPlaceholders.IsDefault || tupleDesignation.Variables.Count != outPlaceholders.Length; 2056for (int i = 0; i < tupleDesignation.Variables.Count; i++) 2075if (elementTypes.Length != tupleDesignation.Variables.Count && !hasErrors) 2078strippedInputType, elementTypes.Length, tupleDesignation.Variables.Count); 2081for (int i = 0; i < tupleDesignation.Variables.Count; i++) 2125var builder = ArrayBuilder<BoundPropertySubpattern>.GetInstance(node.Subpatterns.Count);
Binder\Binder_Statements.cs (4)
736int variableCount = variableList.Count; 836((VariableDeclarationSyntax)declarationNode).Variables.Count > 1 && !declarationNode.HasErrors) 2875int count = variables.Count; 2906int count = statements.Count;
Binder\Binder_Symbols.cs (6)
674if (!permitDimensions && dimension.Count != 0 && dimension[0].Kind() != SyntaxKind.OmittedArraySizeExpression) 692int numElements = syntax.Elements.Count; 1362Debug.Assert(typeArguments.Count > 0); 1363var args = ArrayBuilder<TypeWithAnnotations>.GetInstance(typeArguments.Count); 1422Error(diagnostics, ErrorCode.ERR_BadArity, typeSyntax, type, MessageID.IDS_SK_TYPE.Localize(), typeArgumentsSyntax.Count); 1454Error(diagnostics, ErrorCode.ERR_BadArity, syntax, plainName, MessageID.IDS_MethodGroup.Localize(), typeArgumentsSyntax.Count);
Binder\EarlyWellKnownAttributeBinder.cs (1)
67return objectCreation.Initializer == null && (objectCreation.ArgumentList?.Arguments.Count ?? 0) == 0;
Binder\ExpressionListVariableBinder.cs (1)
22Debug.Assert(expressions.Count > 0);
Binder\ExpressionVariableFinder.cs (2)
115Debug.Assert(nodes.Count > 0); 581if (nodes.Count == 0)
Binder\FixedStatementBinder.cs (1)
33var locals = new ArrayBuilder<LocalSymbol>(_syntax.Declaration.Variables.Count);
Binder\ForLoopBinder.cs (1)
103if (incrementors.Count > 0)
Binder\LocalBinderFactory.cs (2)
484if (node.ArgumentList?.Arguments.Count > 0) 627if (incrementors.Count > 0)
Binder\UsingStatementBinder.cs (1)
42var locals = ArrayBuilder<LocalSymbol>.GetInstance(declarationSyntax.Variables.Count);
Binder\WithCrefTypeParametersBinder.cs (1)
129for (int i = typeArguments.Count - 1; i >= 0; i--)
Compilation\MemberSemanticModel.cs (3)
402forStmt.Incrementors.Count > 0) 1134Debug.Assert(index < anonymousObjectCreation.Initializers.Count); 2278((VariableDeclarationSyntax)parent).Variables.Count == 1)
Declarations\DeclarationTreeBuilder.cs (1)
916var cnt = members.Count;
Lowering\Instrumentation\DebugInfoInjector.cs (1)
215original.Syntax is RecordDeclarationSyntax { ParameterList.Parameters.Count: > 0 })
Lowering\Instrumentation\DebugInfoInjector_SequencePoints.cs (1)
154if (declarationSyntax.Variables.Count == 1)
Lowering\Instrumentation\Instrumenter.cs (1)
216((LocalDeclarationStatementSyntax)original.Syntax).Declaration.Variables.Count == 1));
Lowering\LocalRewriter\LocalRewriter_LocalDeclaration.cs (1)
78((LocalDeclarationStatementSyntax)originalOpt.Syntax).Declaration.Variables.Count == 1)))
Symbols\Attributes\SourceAttributeData.cs (2)
140Debug.Assert(this.AttributeConstructor.ParameterCount <= attributeSyntax.ArgumentList.Arguments.Count); 159Debug.Assert(sourceArgIndex < attributeSyntax.ArgumentList!.Arguments.Count);
Symbols\ConstraintsHelper.cs (3)
683Debug.Assert(typeArgumentsSyntax.Count == 0 /*omitted*/ || typeArgumentsSyntax.Count == type.Arity); 703var location = ordinal < typeArgumentsSyntax.Count ? typeArgumentsSyntax[ordinal].Location : args.Location;
Symbols\Extensions\SynthesizedExtensionMarker.cs (1)
68int count = parameterList.Parameters.Count;
Symbols\FunctionPointers\FunctionPointerMethodSymbol.cs (4)
31if (syntax.ParameterList.Parameters.Count == 0) 148case { CallingConventions: { Count: 1 } specifiers }: 161case { CallingConventions: { Count: 0 } } unmanagedList: 533_parameters = syntax.ParameterList.Parameters.Count > 1
Symbols\MemberSymbolExtensions.cs (1)
652if (initializerSyntax.ArgumentList.Arguments.Count > 0 || !type.IsValueType)
Symbols\Source\LocalFunctionSymbol.cs (1)
442for (int ordinal = 0; ordinal < typeParameters.Count; ordinal++)
Symbols\Source\ParameterHelpers.cs (3)
40lastIndex: syntax.Parameters.Count - 1, 107lastIndex: syntax.Parameters.Count - 1, 132parametersList.Count - 2,
Symbols\Source\SourceDestructorSymbol.cs (1)
50Debug.Assert(syntax.ParameterList.Parameters.Count == 0);
Symbols\Source\SourceFixedFieldSymbol.cs (2)
73if (arguments.Count == 0 || arguments[0].Expression.Kind() == SyntaxKind.OmittedArraySizeExpression) 79if (arguments.Count > 1)
Symbols\Source\SourceMemberContainerSymbol.cs (1)
4950var typesBuilder = ArrayBuilder<TypeSyntax>.GetInstance(parameterList.Parameters.Count);
Symbols\Source\SourceMemberFieldSymbol.cs (1)
534else if (fieldSyntax.Declaration.Variables.Count > 1)
Symbols\Source\SourceNamedTypeSymbol_Enum.cs (1)
57if (types.Count > 0)
Symbols\Source\SourceNamedTypeSymbol_Extension.cs (1)
1091int count = parameterList.Parameters.Count;
Symbols\Source\SourceOrdinaryMethodSymbol.cs (1)
1161for (int ordinal = 0; ordinal < typeParameters.Count; ordinal++)
Symbols\Source\SourcePropertySymbol.cs (1)
626if (parameterSyntaxOpt.Parameters.Count < 1)
Symbols\Source\SourceUserDefinedConversionSymbol.cs (1)
81if (syntax.ParameterList.Parameters.Count != 1)
Symbols\Symbol_Attributes.cs (1)
626attributesToBindCount += attributesToBind.Count;
Symbols\Synthesized\Records\SynthesizedPrimaryConstructor.cs (1)
31if (syntax.PrimaryConstructorBaseTypeIfClass is not PrimaryConstructorBaseTypeSyntax { ArgumentList.Arguments.Count: not 0 })
Syntax\ArrayRankSpecifierSyntax.cs (1)
13return this.Sizes.Count;
Syntax\CSharpPragmaWarningStateMap.cs (2)
109if (currentPragmaDirective.ErrorCodes.Count == 0) 118for (int x = 0; x < currentPragmaDirective.ErrorCodes.Count; x++)
Syntax\CSharpSyntaxRewriter.cs (1)
173var count = list.Count;
Syntax\DelegateDeclarationSyntax.cs (1)
17return this.TypeParameterList == null ? 0 : this.TypeParameterList.Parameters.Count;
Syntax\MethodDeclarationSyntax.cs (1)
17return this.TypeParameterList == null ? 0 : this.TypeParameterList.Parameters.Count;
Syntax\NameSyntax.cs (1)
17return this is GenericNameSyntax ? ((GenericNameSyntax)this).TypeArgumentList.Arguments.Count : 0;
Syntax\SyntaxExtensions.cs (3)
440for (int i = functionPointerTypeSyntax.ParameterList.Parameters.Count - 1; i >= 0; i--) 449for (int i = tupleTypeSyntax.Elements.Count - 1; i >= 0; i--) 464for (int i = genericNameSyntax.TypeArgumentList.Arguments.Count - 1; i >= 0; i--)
Syntax\SyntaxNodeExtensions.cs (1)
57node.ArgumentList.Arguments.Count == 1)
Syntax\SyntaxReplacer.cs (1)
449if (index >= 0 && index < list.Count)
Syntax\TypeDeclarationSyntax.cs (1)
17return this.TypeParameterList == null ? 0 : this.TypeParameterList.Parameters.Count;
Microsoft.CodeAnalysis.CSharp.CodeStyle (60)
src\roslyn\src\Analyzers\CSharp\Analyzers\InlineDeclaration\CSharpInlineDeclarationDiagnosticAnalyzer.cs (1)
236var reportNode = localDeclaration.Variables.Count == 1
src\roslyn\src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryDiscardDesignation\CSharpRemoveUnnecessaryDiscardDesignationDiagnosticAnalyzer.cs (1)
83if (recursivePattern.PositionalPatternClause is { Subpatterns.Count: 1 })
src\roslyn\src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryLambdaExpression\CSharpRemoveUnnecessaryLambdaExpressionDiagnosticAnalyzer.cs (4)
93if (parameters.Count != invocation.ArgumentList.Arguments.Count) 97for (int i = 0, n = parameters.Count; i < n; i++) 149if (invokedMethod.TypeArguments.Length != invokedTypeArguments.Count)
src\roslyn\src\Analyzers\CSharp\Analyzers\RemoveUnusedMembers\CSharpRemoveUnusedMembersDiagnosticAnalyzer.cs (2)
56Parent: FieldDeclarationSyntax { Declaration.Variables.Count: 0 } or 57EventFieldDeclarationSyntax { Declaration.Variables.Count: 0 }
src\roslyn\src\Analyzers\CSharp\Analyzers\SimplifyPropertyPattern\SimplifyPropertyPatternHelpers.cs (1)
32PropertyPatternClause.Subpatterns: { Count: 1 } subpatterns
src\roslyn\src\Analyzers\CSharp\Analyzers\UseAutoProperty\CSharpUseAutoPropertyAnalyzer.cs (1)
233return fieldDeclaration.Declaration.Variables.Count == 1
src\roslyn\src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForArrayDiagnosticAnalyzer.cs (1)
94if (expression.Initializer is { Expressions.Count: > 0 } &&
src\roslyn\src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForBuilderDiagnosticAnalyzer.cs (3)
148argumentIndex == arguments.Count ? declarator.Identifier : 149argumentIndex == arguments.Count - 1 && arguments[argumentIndex] is { RefKindKeyword.RawKind: (int)SyntaxKind.OutKeyword, Expression: DeclarationExpressionSyntax { Designation: SingleVariableDesignationSyntax singleVariable } } 218memberAccess.Parent is InvocationExpressionSyntax { ArgumentList.Arguments.Count: 0 } invocationExpression &&
src\roslyn\src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForFluentDiagnosticAnalyzer.cs (5)
235if (objectCreation.ArgumentList is { Arguments.Count: 1 }) 252else if (objectCreation.ArgumentList is null or { Arguments.Count: 0 }) 359Contract.ThrowIfTrue(useSpread && arguments.Count != 1); 364for (var i = arguments.Count - 1; i >= 0; i--) 419if (invocation.ArgumentList.Arguments.Count > 0)
src\roslyn\src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (11)
786if (sizeValue != initializer.Expressions.Count) 954arguments.Count == 1) 963return arguments.Count == 0; 967return arguments.Count == originalCreateMethod.Parameters.Length; 973if (arguments.Count >= 2) 990if (arguments.Count == 1 && 1037if (objectCreation.ArgumentList is { Arguments.Count: > 0 }) 1041if (objectCreation.Initializer.IsKind(SyntaxKind.ObjectCreationExpression) && objectCreation.Initializer.Expressions.Count > 0) 1139if (invocation.ArgumentList.Arguments.Count != 0) 1144TypeArgumentList.Arguments.Count: 1, 1206Contract.ThrowIfTrue(arguments.Count != 1);
src\roslyn\src\Analyzers\CSharp\Analyzers\UseCollectionInitializer\CSharpUseCollectionInitializerAnalyzer.cs (8)
39initializerElementCount = initializer.Expressions.Count; 62Left: ImplicitElementAccessSyntax { ArgumentList.Arguments.Count: 1 } 85if (argumentList is null || argumentList.Arguments.Count == 0) 95if (argumentList.Arguments.Count != 1) 122if (argumentList.Arguments.Count != 1) 162var individualElementCount = _objectCreationExpression.Initializer?.Expressions.Count ?? 0; 178individualElementCount += invocation.ArgumentList.Arguments.Count; 244if (invocationExpression.ArgumentList.Arguments.Count != 0)
src\roslyn\src\Analyzers\CSharp\Analyzers\UseCompoundAssignment\CSharpUseCompoundCoalesceAssignmentDiagnosticAnalyzer.cs (1)
193else if (condition is InvocationExpressionSyntax { ArgumentList.Arguments.Count: 2 } invocation)
src\roslyn\src\Analyzers\CSharp\Analyzers\UseImplicitlyTypedLambdaExpression\CSharpUseImplicitlyTypedLambdaExpressionDiagnosticAnalyzer.cs (1)
71if (explicitLambda.ParameterList.Parameters.Count == 0 ||
src\roslyn\src\Analyzers\CSharp\Analyzers\UseLocalFunction\CSharpUseLocalFunctionDiagnosticAnalyzer.cs (2)
90if (localDeclaration.Declaration.Variables.Count != 1) 331localDeclaration.Declaration.Variables.Count == 1)
src\roslyn\src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpIsAndCastCheckDiagnosticAnalyzer.cs (1)
189if (localDeclarationStatement.Declaration.Variables.Count != 1)
src\roslyn\src\Analyzers\CSharp\Analyzers\UseSystemThreadingLock\CSharpUseSystemThreadingLockDiagnosticAnalyzer.cs (1)
116if (variableDeclarator.Parent is not VariableDeclarationSyntax { Parent: FieldDeclarationSyntax, Variables.Count: 1 })
src\roslyn\src\Analyzers\CSharp\Analyzers\UseTupleSwap\CSharpUseTupleSwapDiagnosticAnalyzer.cs (1)
77if (localDeclarationStatement.Declaration.Variables.Count != 1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeStyle\TypeStyle\TypeStyleHelper.cs (2)
45if (tupleType.TupleElements.Length != tuple.Arguments.Count) 50for (int i = 0, n = tuple.Arguments.Count; i < n; i++)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ParenthesizedExpressionSyntaxExtensions.cs (3)
139if (collectionExpression.Elements.Count == 0) 700if (argumentIndex >= 0 && argumentIndex < argumentList.Arguments.Count - 1) 709if (expressionIndex >= 0 && expressionIndex < initializer.Expressions.Count - 1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\FormattingHelpers.cs (1)
398if (initializer.Expressions.Count <= 0)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\SpacingFormattingRule.cs (2)
576=> forStatement is { Initializers.Count: 0, Declaration: null, Condition: null, Incrementors.Count: 0 };
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\RefactoringHelpers\CSharpRefactoringHelpers.cs (1)
102if (variables.Count == 1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SemanticFacts\CSharpSemanticFacts.cs (1)
317if (index >= 0 && (index + 1) < orderByClauseSyntax.Orderings.Count)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (1)
894if (switchExpression.Arms.Count < 2)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (3)
212Debug.Assert(originalParams.Count == replacedParams.Count); 215for (var i = 0; i < originalParams.Count; i++)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpTypeStyleHelper.State.cs (1)
82if (variableDeclaration.Variables.Count != 1)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (44)
src\roslyn\src\Analyzers\CSharp\CodeFixes\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionCodeFixProvider.cs (1)
88if (declaratorToRemoveNode.Parent is VariableDeclarationSyntax { Parent: LocalDeclarationStatementSyntax declStatement, Variables.Count: 1 })
src\roslyn\src\Analyzers\CSharp\CodeFixes\FixReturnType\CSharpFixReturnTypeCodeFixProvider.cs (1)
156var argCount = tuple.Arguments.Count;
src\roslyn\src\Analyzers\CSharp\CodeFixes\GenerateParameterizedMember\CSharpGenerateParameterizedMemberService.cs (3)
72if (genericName.TypeArgumentList.Arguments.Count == 1) 83var list = new FixedSizeArrayBuilder<ITypeParameterSymbol>(genericName.TypeArgumentList.Arguments.Count); 150var result = new FixedSizeArrayBuilder<ITypeSymbol>(genericName.TypeArgumentList.Arguments.Count);
src\roslyn\src\Analyzers\CSharp\CodeFixes\InlineDeclaration\CSharpInlineDeclarationCodeFixProvider.cs (1)
109var singleDeclarator = declaration.Variables.Count == 1;
src\roslyn\src\Analyzers\CSharp\CodeFixes\MakeLocalFunctionStatic\MakeLocalFunctionStaticCodeFixHelper.cs (2)
98var seenDefaultArgumentValue = currentInvocation.ArgumentList.Arguments.Count < localFunction.ParameterList.Parameters.Count;
src\roslyn\src\Analyzers\CSharp\CodeFixes\Nullable\CSharpDeclareAsNullableCodeFixProvider.cs (5)
164return variableDeclaration.Variables.Count == 1 ? variableDeclaration.Type : null; 176if (syntax is VariableDeclaratorSyntax { Parent: VariableDeclarationSyntax { Variables.Count: 1 } declaration }) 187if (syntax is VariableDeclaratorSyntax { Parent: VariableDeclarationSyntax { Variables.Count: 1 } declaration }) 249if (node is VariableDeclaratorSyntax { Parent: VariableDeclarationSyntax { Parent: FieldDeclarationSyntax, Variables.Count: 1 } declarationSyntax }) 292if (typeArguments.Count == 1)
src\roslyn\src\Analyzers\CSharp\CodeFixes\PopulateSwitch\CSharpPopulateSwitchExpressionCodeFixProvider.cs (1)
43if (switchNode.Arms.Count == 0 ||
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseAutoProperty\CSharpUseAutoPropertyCodeFixProvider.cs (1)
59return fieldDeclaration.Declaration.Variables.Count > 1 ? declarator : fieldDeclaration;
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpCollectionExpressionRewriter.cs (1)
77return initializer == null || initializer.Expressions.Count == 0
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseCollectionInitializer\CSharpUseCollectionInitializerCodeFixProvider_CollectionInitializer.cs (1)
118if (arguments.Count == 1)
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseExplicitArrayInExpressionTree\CSharpUseExplicitArrayInExpressionTreeCodeFixProvider.cs (4)
64for (int i = 0, n = arguments.Count; i < n; i++) 72return (arguments.Count, arrayType.ElementType); 148if (indexToWrap == argumentList.Arguments.Count) 158else if (indexToWrap < argumentList.Arguments.Count)
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseExplicitTypeForConst\UseExplicitTypeForConstCodeFixProvider.cs (1)
42variableDeclaration.Variables.Count == 1)
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseImplicitOrExplicitType\UseExplicitTypeCodeFixProvider.cs (1)
190Debug.Assert(elements.Length == parensDesignation.Variables.Count);
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseIndexOrRangeOperator\CSharpUseRangeOperatorCodeFixProvider.cs (1)
159if (result.Invocation.ArgumentList.Arguments.Count == 1)
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseObjectInitializer\UseInitializerHelpers.cs (1)
20if (baseObjectCreation is ObjectCreationExpressionSyntax { ArgumentList.Arguments.Count: 0 } objectCreation)
src\roslyn\src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpAsAndNullCheckCodeFixProvider.cs (1)
111declaration.Variables.Count == 1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationService.cs (2)
289var parameterCount = currentParameterList != null ? currentParameterList.Parameters.Count : 0; 454if (attributes.Count == 1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpDeclarationComparer.cs (2)
412var xParameterCount = x.Parameters.Count; 413var yParameterCount = y.Parameters.Count;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\EnumMemberGenerator.cs (2)
96if (destination.Members.Count == 0) 107if (destination.Members.Count == value &&
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\SeparatedSyntaxListExtensions.cs (3)
15return separatedList.InsertRangeWithTrailingSeparator(separatedList.Count, nodes, separator); 23if (index < separatedList.Count) 26return newList.Count == newList.SeparatorCount
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\TypeDeclarationSyntaxExtensions.cs (1)
154return (EnumDeclarationSyntax)EnsureHasBraces(typeDeclaration, typeDeclaration.Members.Count > 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpReplaceDiscardDeclarationsWithAssignmentsService.cs (1)
230if (_currentNonDiscardVariables.Count > 0)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (7)
747var argumentCount = argumentOpt?.Parent is BaseArgumentListSyntax baseArgumentList ? baseArgumentList.Arguments.Count : -1; 1392.Where(a => a.Parameters.Length == initializerExpression.Expressions.Count) 1641var subPatternCount = positionalPart.Subpatterns.Count; 1833if (invocation.ArgumentList.Arguments.Count > 0) 1877return lambdaExpression.ParameterList.Parameters.Count == 0 2162if (armIndex < switchExpression.Arms.Count - 1) 2404if (elementTypesBuilder.Contains(null) || elementTypesBuilder.Count != arguments.Count)
Microsoft.CodeAnalysis.CSharp.Features (121)
ChangeSignature\CSharpChangeSignatureService.cs (5)
616argumentCount = attribute.ArgumentList.Arguments.Count; 645argumentCount = argumentList.Arguments.Count; 737var numSeparatorsToSkip = arguments.Count - newArguments.Length; 762var numSeparatorsToSkip = arguments.Count - newArguments.Length; 774result.Add(index < oldArguments.Count
CodeFixes\Suppression\CSharpSuppressionCodeFixProvider.cs (2)
216return attributeSyntax.Parent is AttributeListSyntax attributeList && attributeList.Attributes.Count == 1; 228hasMultipleIds = pragmaWarning.ErrorCodes.Count > 1;
CodeRefactorings\ConvertLocalFunctionToMethod\CSharpConvertLocalFunctionToMethodCodeRefactoringProvider.cs (1)
183: invocation.ArgumentList.Arguments.Count;
CodeRefactorings\InlineTemporary\InlineTemporaryCodeRefactoringProvider.cs (2)
363Debug.Assert(variableDeclaration.Variables.Count > 1); 383if (variableDeclaration.Variables.Count > 1)
CodeRefactorings\MoveType\CSharpMoveTypeService.cs (1)
24=> (syntax.Identifier.ValueText, syntax is TypeDeclarationSyntax { TypeParameterList.Parameters.Count: var arity } ? arity : 0);
Completion\CompletionProviders\InternalsVisibleToCompletionProvider.cs (1)
54return arguments.Count > 0
ConvertAnonymousType\CSharpConvertAnonymousTypeToTupleCodeRefactoringProvider.cs (2)
30=> anonymousType.Initializers.Count; 43for (int i = 0, n = declarators.Count; i < n; i++)
ConvertForToForEach\CSharpConvertForToForEachCodeRefactoringProvider.cs (1)
52if (forStatement is { Declaration.Variables: [{ Initializer: not null } declarator], Condition.RawKind: (int)SyntaxKind.LessThanExpression, Incrementors.Count: 1 })
ConvertLinq\ConvertForEachToLinqQuery\AbstractToMethodConverter.cs (2)
68Convert(lastDeclaration.Initializer.Value, variables.Count == 1 ? previous : lastDeclaration); 150if (localDeclaration.Declaration.Variables.Count != 1)
ConvertLinq\ConvertForEachToLinqQuery\CSharpConvertForEachToLinqQueryProvider.cs (3)
186for (var i = 0; i < localDeclarationStatement.Declaration.Variables.Count; i++) 192i == localDeclarationStatement.Declaration.Variables.Count - 1 248invocationExpression.ArgumentList.Arguments.Count == 1)
ConvertLinq\CSharpConvertLinqQueryToForEachProvider.cs (1)
466((VariableDeclarationSyntax)invocationParent.Parent.Parent).Variables.Count == 1)
ConvertToExtension\ConvertToExtensionCodeRefactoringProvider.cs (1)
330if (extensionMethod.TypeParameterList.Parameters.Count == movedTypeParameterCount)
Debugging\BreakpointResolver.cs (1)
65parameterCount = parameterList.Parameters.Count;
Debugging\LocationInfoGetter.cs (1)
53fieldDeclarator ??= variableDeclarators.Count > 0 ? variableDeclarators[0] : null;
EditAndContinue\BreakpointSpans.cs (11)
233if (parameters.Count == 0) 305switchExpression.Arms.Count > 0 && 407return orderByClause.Orderings.Count > 0 639else if (forStatement.Initializers.Count > 0) 649else if (forStatement.Incrementors.Count > 0) 789if (variableDeclaration.Variables.Count == 0) 800if (variableDeclaration.Variables.Count == 1) 860if (variableDeclaration.Variables.Count == 1) 881if (variableDeclaration.Variables.Count == 1) 904if (left < 0 && right >= declarators.Count) 914if (right < declarators.Count && declarators[right].Initializer != null)
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (2)
1046if (oldVariables.Count == 1 && newVariables.Count == 1)
EditAndContinue\SyntaxUtilities.cs (1)
188return ctor.ParameterList.Parameters.Count == 0;
EncapsulateField\CSharpEncapsulateFieldService.cs (2)
67if (declaration.Variables.Count == 1) 82else if (declaration.Variables.Count > 1 && makePrivate)
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.CallSiteContainerRewriter.cs (1)
103if (list.Count == node.Declaration.Variables.Count)
ExtractMethod\CSharpMethodExtractor.PostProcessor.cs (2)
242declaration.Declaration.Variables.Count != 1 || 275declaration.Declaration.Variables.Count != 1 ||
GenerateType\CSharpGenerateTypeService.cs (1)
474var typeArguments = state.SimpleName.Arity == genericName.TypeArgumentList.Arguments.Count
InlineHints\CSharpInlineTypeHintsService.cs (1)
34variableDeclaration.Variables.Count == 1 &&
ReplaceConditionalWithStatements\CSharpReplaceConditionalWithStatementsCodeRefactoringProvider.cs (1)
53if (localDeclarationStatement.Declaration.Variables.Count == 1)
ReplaceMethodWithProperty\CSharpReplaceMethodWithPropertyService.cs (1)
321if (invocation.ArgumentList?.Arguments.Count != 1 ||
ReverseForStatement\CSharpReverseForStatementCodeRefactoringProvider.cs (2)
53declaration.Variables.Count != 1 || 54forStatement.Incrementors.Count != 1)
SolutionExplorer\CSharpSolutionExplorerSymbolTreeItemProvider.cs (1)
124hasItems: enumDeclaration.Members.Count > 0,
src\roslyn\src\Analyzers\CSharp\Analyzers\InlineDeclaration\CSharpInlineDeclarationDiagnosticAnalyzer.cs (1)
236var reportNode = localDeclaration.Variables.Count == 1
src\roslyn\src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryDiscardDesignation\CSharpRemoveUnnecessaryDiscardDesignationDiagnosticAnalyzer.cs (1)
83if (recursivePattern.PositionalPatternClause is { Subpatterns.Count: 1 })
src\roslyn\src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryLambdaExpression\CSharpRemoveUnnecessaryLambdaExpressionDiagnosticAnalyzer.cs (4)
93if (parameters.Count != invocation.ArgumentList.Arguments.Count) 97for (int i = 0, n = parameters.Count; i < n; i++) 149if (invokedMethod.TypeArguments.Length != invokedTypeArguments.Count)
src\roslyn\src\Analyzers\CSharp\Analyzers\RemoveUnusedMembers\CSharpRemoveUnusedMembersDiagnosticAnalyzer.cs (2)
56Parent: FieldDeclarationSyntax { Declaration.Variables.Count: 0 } or 57EventFieldDeclarationSyntax { Declaration.Variables.Count: 0 }
src\roslyn\src\Analyzers\CSharp\Analyzers\SimplifyPropertyPattern\SimplifyPropertyPatternHelpers.cs (1)
32PropertyPatternClause.Subpatterns: { Count: 1 } subpatterns
src\roslyn\src\Analyzers\CSharp\Analyzers\UseAutoProperty\CSharpUseAutoPropertyAnalyzer.cs (1)
233return fieldDeclaration.Declaration.Variables.Count == 1
src\roslyn\src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForArrayDiagnosticAnalyzer.cs (1)
94if (expression.Initializer is { Expressions.Count: > 0 } &&
src\roslyn\src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForBuilderDiagnosticAnalyzer.cs (3)
148argumentIndex == arguments.Count ? declarator.Identifier : 149argumentIndex == arguments.Count - 1 && arguments[argumentIndex] is { RefKindKeyword.RawKind: (int)SyntaxKind.OutKeyword, Expression: DeclarationExpressionSyntax { Designation: SingleVariableDesignationSyntax singleVariable } } 218memberAccess.Parent is InvocationExpressionSyntax { ArgumentList.Arguments.Count: 0 } invocationExpression &&
src\roslyn\src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForFluentDiagnosticAnalyzer.cs (5)
235if (objectCreation.ArgumentList is { Arguments.Count: 1 }) 252else if (objectCreation.ArgumentList is null or { Arguments.Count: 0 }) 359Contract.ThrowIfTrue(useSpread && arguments.Count != 1); 364for (var i = arguments.Count - 1; i >= 0; i--) 419if (invocation.ArgumentList.Arguments.Count > 0)
src\roslyn\src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (11)
786if (sizeValue != initializer.Expressions.Count) 954arguments.Count == 1) 963return arguments.Count == 0; 967return arguments.Count == originalCreateMethod.Parameters.Length; 973if (arguments.Count >= 2) 990if (arguments.Count == 1 && 1037if (objectCreation.ArgumentList is { Arguments.Count: > 0 }) 1041if (objectCreation.Initializer.IsKind(SyntaxKind.ObjectCreationExpression) && objectCreation.Initializer.Expressions.Count > 0) 1139if (invocation.ArgumentList.Arguments.Count != 0) 1144TypeArgumentList.Arguments.Count: 1, 1206Contract.ThrowIfTrue(arguments.Count != 1);
src\roslyn\src\Analyzers\CSharp\Analyzers\UseCollectionInitializer\CSharpUseCollectionInitializerAnalyzer.cs (8)
39initializerElementCount = initializer.Expressions.Count; 62Left: ImplicitElementAccessSyntax { ArgumentList.Arguments.Count: 1 } 85if (argumentList is null || argumentList.Arguments.Count == 0) 95if (argumentList.Arguments.Count != 1) 122if (argumentList.Arguments.Count != 1) 162var individualElementCount = _objectCreationExpression.Initializer?.Expressions.Count ?? 0; 178individualElementCount += invocation.ArgumentList.Arguments.Count; 244if (invocationExpression.ArgumentList.Arguments.Count != 0)
src\roslyn\src\Analyzers\CSharp\Analyzers\UseCompoundAssignment\CSharpUseCompoundCoalesceAssignmentDiagnosticAnalyzer.cs (1)
193else if (condition is InvocationExpressionSyntax { ArgumentList.Arguments.Count: 2 } invocation)
src\roslyn\src\Analyzers\CSharp\Analyzers\UseImplicitlyTypedLambdaExpression\CSharpUseImplicitlyTypedLambdaExpressionDiagnosticAnalyzer.cs (1)
71if (explicitLambda.ParameterList.Parameters.Count == 0 ||
src\roslyn\src\Analyzers\CSharp\Analyzers\UseLocalFunction\CSharpUseLocalFunctionDiagnosticAnalyzer.cs (2)
90if (localDeclaration.Declaration.Variables.Count != 1) 331localDeclaration.Declaration.Variables.Count == 1)
src\roslyn\src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpIsAndCastCheckDiagnosticAnalyzer.cs (1)
189if (localDeclarationStatement.Declaration.Variables.Count != 1)
src\roslyn\src\Analyzers\CSharp\Analyzers\UseSystemThreadingLock\CSharpUseSystemThreadingLockDiagnosticAnalyzer.cs (1)
116if (variableDeclarator.Parent is not VariableDeclarationSyntax { Parent: FieldDeclarationSyntax, Variables.Count: 1 })
src\roslyn\src\Analyzers\CSharp\Analyzers\UseTupleSwap\CSharpUseTupleSwapDiagnosticAnalyzer.cs (1)
77if (localDeclarationStatement.Declaration.Variables.Count != 1)
src\roslyn\src\Analyzers\CSharp\CodeFixes\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionCodeFixProvider.cs (1)
88if (declaratorToRemoveNode.Parent is VariableDeclarationSyntax { Parent: LocalDeclarationStatementSyntax declStatement, Variables.Count: 1 })
src\roslyn\src\Analyzers\CSharp\CodeFixes\FixReturnType\CSharpFixReturnTypeCodeFixProvider.cs (1)
156var argCount = tuple.Arguments.Count;
src\roslyn\src\Analyzers\CSharp\CodeFixes\GenerateParameterizedMember\CSharpGenerateParameterizedMemberService.cs (3)
72if (genericName.TypeArgumentList.Arguments.Count == 1) 83var list = new FixedSizeArrayBuilder<ITypeParameterSymbol>(genericName.TypeArgumentList.Arguments.Count); 150var result = new FixedSizeArrayBuilder<ITypeSymbol>(genericName.TypeArgumentList.Arguments.Count);
src\roslyn\src\Analyzers\CSharp\CodeFixes\InlineDeclaration\CSharpInlineDeclarationCodeFixProvider.cs (1)
109var singleDeclarator = declaration.Variables.Count == 1;
src\roslyn\src\Analyzers\CSharp\CodeFixes\MakeLocalFunctionStatic\MakeLocalFunctionStaticCodeFixHelper.cs (2)
98var seenDefaultArgumentValue = currentInvocation.ArgumentList.Arguments.Count < localFunction.ParameterList.Parameters.Count;
src\roslyn\src\Analyzers\CSharp\CodeFixes\Nullable\CSharpDeclareAsNullableCodeFixProvider.cs (5)
164return variableDeclaration.Variables.Count == 1 ? variableDeclaration.Type : null; 176if (syntax is VariableDeclaratorSyntax { Parent: VariableDeclarationSyntax { Variables.Count: 1 } declaration }) 187if (syntax is VariableDeclaratorSyntax { Parent: VariableDeclarationSyntax { Variables.Count: 1 } declaration }) 249if (node is VariableDeclaratorSyntax { Parent: VariableDeclarationSyntax { Parent: FieldDeclarationSyntax, Variables.Count: 1 } declarationSyntax }) 292if (typeArguments.Count == 1)
src\roslyn\src\Analyzers\CSharp\CodeFixes\PopulateSwitch\CSharpPopulateSwitchExpressionCodeFixProvider.cs (1)
43if (switchNode.Arms.Count == 0 ||
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseAutoProperty\CSharpUseAutoPropertyCodeFixProvider.cs (1)
59return fieldDeclaration.Declaration.Variables.Count > 1 ? declarator : fieldDeclaration;
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpCollectionExpressionRewriter.cs (1)
77return initializer == null || initializer.Expressions.Count == 0
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseCollectionInitializer\CSharpUseCollectionInitializerCodeFixProvider_CollectionInitializer.cs (1)
118if (arguments.Count == 1)
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseExplicitArrayInExpressionTree\CSharpUseExplicitArrayInExpressionTreeCodeFixProvider.cs (4)
64for (int i = 0, n = arguments.Count; i < n; i++) 72return (arguments.Count, arrayType.ElementType); 148if (indexToWrap == argumentList.Arguments.Count) 158else if (indexToWrap < argumentList.Arguments.Count)
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseExplicitTypeForConst\UseExplicitTypeForConstCodeFixProvider.cs (1)
42variableDeclaration.Variables.Count == 1)
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseImplicitOrExplicitType\UseExplicitTypeCodeFixProvider.cs (1)
190Debug.Assert(elements.Length == parensDesignation.Variables.Count);
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseIndexOrRangeOperator\CSharpUseRangeOperatorCodeFixProvider.cs (1)
159if (result.Invocation.ArgumentList.Arguments.Count == 1)
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseObjectInitializer\UseInitializerHelpers.cs (1)
20if (baseObjectCreation is ObjectCreationExpressionSyntax { ArgumentList.Arguments.Count: 0 } objectCreation)
src\roslyn\src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpAsAndNullCheckCodeFixProvider.cs (1)
111declaration.Variables.Count == 1)
Microsoft.CodeAnalysis.CSharp.NetAnalyzers (14)
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\CSharpStaticHolderTypes.Fixer.cs (1)
81return constructor.ParameterList.Parameters.Count == 0;
Microsoft.CodeQuality.Analyzers\Maintainability\CSharpUseCrossPlatformIntrinsicsFixer.cs (4)
42if (arguments.Count != 2) 44Debug.Fail($"Found unexpected number of arguments for binary operator replacement: {arguments.Count}"); 66if (arguments.Count != 1) 68Debug.Fail($"Found unexpected number of arguments for unary operator replacement: {arguments.Count}");
Microsoft.CodeQuality.Analyzers\QualityGuidelines\CSharpUseLiteralsWhereAppropriate.Fixer.cs (1)
30return field?.Declaration.Variables.Count > 1 ? null : field;
Microsoft.NetCore.Analyzers\Performance\CSharpDoNotUseCountWhenAnyCanBeUsed.Fixer.cs (1)
57invocation.ArgumentList.Arguments.Count == 1 &&
Microsoft.NetCore.Analyzers\Performance\CSharpPreferHashDataOverComputeHash.Fixer.cs (1)
121case { Parent: UsingStatementSyntax usingStatement } when usingStatement.Declaration?.Variables.Count == 1:
Microsoft.NetCore.Analyzers\Performance\CSharpPreferLengthCountIsEmptyOverAny.Fixer.cs (2)
25if (invocation.ArgumentList.Arguments.Count > 0) 66if (invocation.ArgumentList.Arguments.Count > 0)
Microsoft.NetCore.Analyzers\Performance\CSharpUseSearchValues.cs (1)
136length = valueExpressions.Count;
Microsoft.NetCore.Analyzers\Resources\CSharpMarkAssembliesWithNeutralResourcesLanguage.cs (1)
46attribute.ArgumentList?.Arguments.Count > 0;
Microsoft.NetCore.Analyzers\Runtime\CSharpAvoidRedundantRegexIsMatchBeforeMatch.Fixer.cs (2)
120if (declaration.Variables.Count != 1) 238if (preDecl.Declaration.Variables.Count != 1)
Microsoft.CodeAnalysis.CSharp.Workspaces (87)
Classification\Worker_Preprocesser.cs (1)
308if (node.ErrorCodes.Count == 0)
CodeGeneration\CSharpSyntaxGenerator.cs (39)
907if (fd.Declaration.Variables.Count == 1) 1107if (list.Attributes.Count == 1) 1155if (list.Attributes.Count == 1) 1175if (list.Attributes.Count == 1) 1284if (attrList.Attributes.Count > 1) 1305if (variableDeclaration.Variables.Count > 1) 1319SyntaxKind.FieldDeclaration => ((FieldDeclarationSyntax)declaration).Declaration.Variables.Count, 1320SyntaxKind.EventFieldDeclaration => ((EventFieldDeclarationSyntax)declaration).Declaration.Variables.Count, 1321SyntaxKind.LocalDeclarationStatement => ((LocalDeclarationStatementSyntax)declaration).Declaration.Variables.Count, 1322SyntaxKind.VariableDeclaration => ((VariableDeclarationSyntax)declaration).Variables.Count, 1323SyntaxKind.AttributeList => ((AttributeListSyntax)declaration).Attributes.Count, 1754return typeParameters?.Parameters.Count > 0 ? typeParameters : null; 1862if (constraints.Count > 0) 1871else if (constraints.Count == 0) 1933if (fd.Declaration != null && fd.Declaration.Variables.Count == 1) 1945if (ef.Declaration != null && ef.Declaration.Variables.Count == 1) 1957if (ld.Declaration != null && ld.Declaration.Variables.Count == 1) 1970if (vd.Variables.Count == 1 && vd.Parent == null) 1986if (vd == null || vd.Variables.Count > 1) 2007if (list.Attributes.Count == 1) 2015if (declaration.Parent is not AttributeListSyntax parentList || parentList.Attributes.Count > 1) 2059VariableDeclarationSyntax variableDeclaration when variableDeclaration.Variables.Count == 1 => variableDeclaration.Variables[0].Identifier.ValueText, 2062AttributeListSyntax attributeList when attributeList.Attributes.Count == 1 => attributeList.Attributes[0].Name.ToString(), 2079BaseFieldDeclarationSyntax fieldDeclaration when fieldDeclaration.Declaration.Variables.Count == 1 => 2089LocalDeclarationStatementSyntax localDeclaration when localDeclaration.Declaration.Variables.Count == 1 => 2094AttributeListSyntax attributeList when attributeList.Attributes.Count == 1 => 2099VariableDeclarationSyntax variableDeclaration when variableDeclaration.Variables.Count == 1 => 2174if (vd.Parent != null && vd.Variables.Count == 1) 2393if (parameters.Count == 1 && IsSimpleLambdaParameter(parameters[0])) 2546if (fd.Declaration.Variables.Count == 1) 2557if (ld.Declaration.Variables.Count == 1) 2565if (vd.Variables.Count == 1) 2586if (fd.Declaration.Variables.Count == 1) 2597if (ld.Declaration.Variables.Count == 1) 2605if (vd.Variables.Count == 1) 2836return WithBaseList(declaration, baseList.WithTypes(baseList.Types.Insert(baseList.Types.Count, SyntaxFactory.SimpleBaseType((TypeSyntax)interfaceType)))); 3146if (attr.Parent is AttributeListSyntax attrList && attrList.Attributes.Count == 1) 3155if (declaration.Parent != null && ((AttributeArgumentListSyntax)declaration.Parent).Arguments.Count == 1) 3174if (declaration.Parent is BaseListSyntax baseList && baseList.Types.Count == 1)
FindSymbols\CSharpDeclaredSymbolInfoFactoryService.cs (9)
49var builder = ArrayBuilder<string>.GetInstance(baseList.Types.Count); 193parameterCount: localFunction.ParameterList.Parameters.Count, 194typeParameterCount: localFunction.TypeParameterList?.Parameters.Count ?? 0)); 236typeParameterCount: typeDeclaration.TypeParameterList?.Parameters.Count ?? 0); 285parameterCount: ctorDecl.ParameterList?.Parameters.Count ?? 0)); 358parameterCount: method.ParameterList?.Parameters.Count ?? 0, 359typeParameterCount: method.TypeParameterList?.Parameters.Count ?? 0)); 414if (memberDeclaration is RecordDeclarationSyntax { ParameterList: { Parameters.Count: > 0 } parameterList } recordDeclaration) 698simpleTypeName = CreateValueTupleTypeString(tupleType.Elements.Count);
Recommendations\CSharpRecommendationServiceRunner.cs (3)
34AnonymousMethodExpressionSyntax anonymousMethod => anonymousMethod.ParameterList?.Parameters.Count ?? -1, 35ParenthesizedLambdaExpressionSyntax parenthesizedLambda => parenthesizedLambda.ParameterList.Parameters.Count, 56if (parameters.Count > ordinalInLambda)
Simplification\Reducers\CSharpExtensionMethodReducer.cs (1)
63var noOfArguments = argumentList.Arguments.Count;
Simplification\Reducers\CSharpMiscellaneousReducer.cs (1)
92parenthesizedLambda.ParameterList.Parameters.Count == 1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeStyle\TypeStyle\TypeStyleHelper.cs (2)
45if (tupleType.TupleElements.Length != tuple.Arguments.Count) 50for (int i = 0, n = tuple.Arguments.Count; i < n; i++)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ParenthesizedExpressionSyntaxExtensions.cs (3)
139if (collectionExpression.Elements.Count == 0) 700if (argumentIndex >= 0 && argumentIndex < argumentList.Arguments.Count - 1) 709if (expressionIndex >= 0 && expressionIndex < initializer.Expressions.Count - 1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\FormattingHelpers.cs (1)
398if (initializer.Expressions.Count <= 0)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\SpacingFormattingRule.cs (2)
576=> forStatement is { Initializers.Count: 0, Declaration: null, Condition: null, Incrementors.Count: 0 };
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\RefactoringHelpers\CSharpRefactoringHelpers.cs (1)
102if (variables.Count == 1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SemanticFacts\CSharpSemanticFacts.cs (1)
317if (index >= 0 && (index + 1) < orderByClauseSyntax.Orderings.Count)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (1)
894if (switchExpression.Arms.Count < 2)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (3)
212Debug.Assert(originalParams.Count == replacedParams.Count); 215for (var i = 0; i < originalParams.Count; i++)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpTypeStyleHelper.State.cs (1)
82if (variableDeclaration.Variables.Count != 1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationService.cs (2)
289var parameterCount = currentParameterList != null ? currentParameterList.Parameters.Count : 0; 454if (attributes.Count == 1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpDeclarationComparer.cs (2)
412var xParameterCount = x.Parameters.Count; 413var yParameterCount = y.Parameters.Count;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\EnumMemberGenerator.cs (2)
96if (destination.Members.Count == 0) 107if (destination.Members.Count == value &&
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\SeparatedSyntaxListExtensions.cs (3)
15return separatedList.InsertRangeWithTrailingSeparator(separatedList.Count, nodes, separator); 23if (index < separatedList.Count) 26return newList.Count == newList.SeparatorCount
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\TypeDeclarationSyntaxExtensions.cs (1)
154return (EnumDeclarationSyntax)EnsureHasBraces(typeDeclaration, typeDeclaration.Members.Count > 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpReplaceDiscardDeclarationsWithAssignmentsService.cs (1)
230if (_currentNonDiscardVariables.Count > 0)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (7)
747var argumentCount = argumentOpt?.Parent is BaseArgumentListSyntax baseArgumentList ? baseArgumentList.Arguments.Count : -1; 1392.Where(a => a.Parameters.Length == initializerExpression.Expressions.Count) 1641var subPatternCount = positionalPart.Subpatterns.Count; 1833if (invocation.ArgumentList.Arguments.Count > 0) 1877return lambdaExpression.ParameterList.Parameters.Count == 0 2162if (armIndex < switchExpression.Arms.Count - 1) 2404if (elementTypesBuilder.Contains(null) || elementTypesBuilder.Count != arguments.Count)
Microsoft.CodeAnalysis.Features (40)
ChangeSignature\AbstractChangeSignatureService.cs (8)
652if (parameters.Count == 0) 667for (var i = 0; i < parameters.Count - 1; i++) 677return parameters.Count - 1; 702if (index < list.Count) 718if (index < list.Count) 853else if (indexInListOfPreexistingArguments < newArguments.Count) 867else if (indexInListOfPreexistingArguments < newArguments.Count) 896while (indexInListOfPreexistingArguments < newArguments.Count)
ConvertForToForEach\AbstractConvertForToForEachCodeRefactoringProvider.cs (2)
177if (arguments.Count != 1) 397if (variables.Count == 1)
ConvertToInterpolatedString\AbstractConvertPlaceholderToInterpolatedStringRefactoringProvider.cs (3)
72for (var i = placeholderIndex + 1; i < arguments.Count; i++) 195for (int i = 0, n = arguments.Count - 1; i < n; i++) 203var remainingArgCount = arguments.Count - i - 1;
ExtractMethod\SelectionResult.cs (1)
184if (arguments.Count != 1)
IntroduceParameter\IntroduceParameterDocumentRewriter.cs (3)
128if (_syntaxFacts.GetVariablesOfLocalDeclarationStatement(localDeclaration).Count > 1) 511if (insertionIndex > invocationArguments.Count) 619for (var i = 0; i < arguments.Count; i++)
MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceCodeRefactoringProvider.cs (1)
25if (variables.Count != 1)
ReplaceConditionalWithStatements\AbstractReplaceConditionalWithStatementsCodeRefactoringProvider.cs (1)
76if (variables.Count == 1)
src\roslyn\src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (1)
247errorCodeNodes.Count > 0)
src\roslyn\src\Analyzers\Core\Analyzers\UseCoalesceExpression\AbstractUseCoalesceExpressionForIfNullCheckDiagnosticAnalyzer.cs (1)
168if (declarators.Count != 1)
src\roslyn\src\Analyzers\Core\Analyzers\UseCollectionInitializer\UpdateExpressionState.cs (8)
190if (arguments.Count == 1) 195if (arguments.Count == 2 && 249Contract.ThrowIfTrue(arguments.Count == 0); 267if (arguments.Count > 1) 278if (arguments.Count != 1) 303if (arguments.Count < 1) 306if (requiredArgumentName != null && arguments.Count != 1) 382if (supportedArgumentCount >= 0 && elementAccessArguments.Count != supportedArgumentCount)
src\roslyn\src\Analyzers\Core\Analyzers\UseIsNullCheck\AbstractUseIsNullForReferenceEqualsDiagnosticAnalyzer.cs (1)
90if (arguments.Count != 2)
src\roslyn\src\Analyzers\Core\Analyzers\UseNullPropagation\AbstractUseNullPropagationDiagnosticAnalyzer.cs (1)
343if (arguments.Count != 2)
src\roslyn\src\Analyzers\Core\Analyzers\ValidateFormatString\AbstractValidateFormatStringDiagnosticAnalyzer.cs (3)
138var numberOfArguments = arguments.Count; 229if (parameterWithMatchingName.Ordinal >= arguments.Count) 236if (parameterWithMatchingName.IsParams && parameters.Length != arguments.Count)
src\roslyn\src\Analyzers\Core\CodeFixes\AddExplicitCast\Fixer.cs (1)
130for (var i = 0; i < arguments.Count; i++)
src\roslyn\src\Analyzers\Core\CodeFixes\AddParameter\AbstractAddParameterCodeFixProvider.cs (2)
209if (isNamedArgument || NonParamsParameterCount(method) < arguments.Count) 443for (int i = 0, n = arguments.Count; i < n; i++)
src\roslyn\src\Analyzers\Core\CodeFixes\RemoveUnusedParametersAndValues\AbstractRemoveUnusedValuesCodeFixProvider.cs (1)
636if (variables.Count == 1 &&
UseNamedArguments\AbstractUseNamedArgumentsCodeRefactoringProvider.cs (1)
75var argumentCount = arguments.Count;
Wrapping\SeparatedSyntaxList\AbstractSeparatedSyntaxListWrapper.cs (1)
70if (listItems.Count <= 1)
Microsoft.CodeAnalysis.Razor.Compiler (1)
CSharp\GenericTypeNameRewriter.cs (1)
81for (var i = 0; i < args.Count; i++)
Microsoft.CodeAnalysis.ResxSourceGenerator (11)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\RefactoringHelpers\AbstractRefactoringHelpers.cs (1)
437if (variables.Count == 1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\LightweightOverloadResolution.cs (10)
54if (arguments.Count > 0) 78for (var i = 0; i < arguments.Count; i++) 86for (var argumentIndex = 0; argumentIndex < arguments.Count; argumentIndex++) 163for (var i = 0; i < arguments.Count; i++) 166for (var i = 0; i < arguments.Count; i++) 169if (parameterIndex >= 0 && parameterIndex < arguments.Count) 187Contract.ThrowIfTrue(argumentToParameterMap.Count != arguments.Count); 193for (var argumentIndex = 0; argumentIndex < arguments.Count; argumentIndex++) 260for (var i = 0; i < arguments.Count - 1; i++) 268return arguments.Count - 1;
Microsoft.CodeAnalysis.VisualBasic (69)
Binding\Binder_Expressions.vb (6)
332Dim numElements As Integer = arguments.Count 346Dim boundArguments = ArrayBuilder(Of BoundExpression).GetInstance(arguments.Count) 347Dim elementTypes = ArrayBuilder(Of TypeSymbol).GetInstance(arguments.Count) 348Dim elementLocations = ArrayBuilder(Of Location).GetInstance(arguments.Count) 420Dim numElements As Integer = arguments.Count 4362For i As Integer = 0 To arguments.Count - 1
Binding\Binder_Query.vb (41)
210Dim aggregationVariablesCount As Integer = aggregationVariables.Count 214Debug.Assert(aggregationVariables.Count > 0, "Malformed syntax tree.") 395If aggregationVariables.Count <= 1 Then 769Debug.Assert(variables.Count > 0, "Malformed syntax tree.") 771If variables.Count = 0 Then 787For i = If(skipFirstVariable, 1, 0) To variables.Count - 1 975Debug.Assert(variables.Count > 0, "Malformed syntax tree.") 978If variables.Count = 0 Then 1012For i = If(source Is sourceOpt, 0, 1) To variables.Count - 1 1056If i = variables.Count - 1 Then 1109(i = variables.Count - 1 AndAlso 1169Debug.Assert(i = variables.Count - 1) 1862If items.Count > 0 Then 2529If orderByOrderings.Count = 0 Then 2531Debug.Assert(orderByOrderings.Count > 0, "Malformed syntax tree.") 2543For i = 0 To orderByOrderings.Count - 1 2695If selectVariables.Count = 1 Then 2741If selectVariables.Count = 1 Then 2759ElseIf selectVariables.Count = 0 Then 2761Debug.Assert(selectVariables.Count > 0, "Malformed syntax tree.") 2766Dim selectors = New BoundExpression(selectVariables.Count - 1) {} 2768Dim rangeVariables(selectVariables.Count - 1) As RangeVariableSymbol 2770For i As Integer = 0 To selectVariables.Count - 1 2782Dim fields = New AnonymousTypeField(selectVariables.Count - 1) {} 3005Select Case aggregationVariables.Count 3008Debug.Assert(aggregationVariables.Count > 0, "Malformed syntax tree.") 3296If joinConditions.Count = 0 Then 3298Debug.Assert(joinConditions.Count > 0, "Malformed syntax tree.") 3303ElseIf joinConditions.Count = 1 Then 3327Dim outerKeys(joinConditions.Count - 1) As BoundExpression 3328Dim innerKeys(joinConditions.Count - 1) As BoundExpression 3331For i As Integer = 0 To joinConditions.Count - 1 3346Dim fields(joinConditions.Count - 1) As AnonymousTypeField 3348For i As Integer = 0 To joinConditions.Count - 1 3795Dim fieldsToReserveForAggregationVariables As Integer = Math.Max(aggregationVariables.Count, 1) 3844If aggregationVariables.Count = 0 Then 3846Debug.Assert(aggregationVariables.Count > 0, "Malformed syntax tree.") 3853For i As Integer = 0 To aggregationVariables.Count - 1 3880If aggregationVariables.Count = 0 Then 3882Debug.Assert(aggregationVariables.Count > 0, "Malformed syntax tree.") 3886Debug.Assert(aggregationVariables.Count = 1)
Binding\Binder_Statements.vb (5)
2202Debug.Assert(midArguments.Count = 2 OrElse midArguments.Count = 3) 2214If midArguments.Count > 2 Then 3059ElseIf controlVariableList.Count = 1 Then 3066Dim nextVariableCount = controlVariableList.Count
Binding\Binder_Symbols.vb (1)
110Debug.Assert(typeArguments.Length = syntaxArguments.Count)
Binding\Binder_Utils.vb (1)
1035Dim count As Integer = syntax.Count
Binding\DocumentationCommentCrefBinder.vb (3)
279For i = 0 To arguments.Count - 1 825Dim typeParameterSymbols(arguments.Count - 1) As TypeSymbol 827For i = 0 To arguments.Count - 1
Binding\DocumentationCommentCrefBinder_Compat.vb (2)
415Dim result(args.Count - 1) As TypeSymbol 416For i = 0 To args.Count - 1
Binding\MemberSemanticModel.vb (1)
1523For i As Integer = 0 To variables.Count - 1
OptionsValidator.vb (1)
43If importsClausesSyntaxList.Count > 1 Then
Symbols\ConstraintsHelper.vb (1)
502Debug.Assert(typeArgumentsSyntax.Count = type.Arity)
Syntax\NameSyntax.vb (1)
16Return DirectCast(Me, GenericNameSyntax).TypeArgumentList.Arguments.Count
Syntax\SyntaxNormalizer.vb (1)
1466Dim variableCount = node.ControlVariables.Count
Syntax\SyntaxReplacer.vb (1)
312If index >= 0 AndAlso index < list.Count Then
Syntax\TypeStatementSyntax.vb (1)
13Return If(Me.TypeParameterList Is Nothing, 0, Me.TypeParameterList.Parameters.Count)
Syntax\VisualBasicSyntaxRewriter.vb (1)
133Dim count As Integer = list.Count
Syntax\VisualBasicWarningStateMap.vb (2)
73If codes.Count = 0 Then 79For i As Integer = 0 To codes.Count - 1
Microsoft.CodeAnalysis.VisualBasic.CodeStyle (32)
src\roslyn\src\Analyzers\VisualBasic\Analyzers\RemoveUnusedMembers\VisualBasicRemoveUnusedMembersDiagnosticAnalyzer.vb (2)
71If declarator?.Names.Count = 1 AndAlso field?.Declarators.Count = 1 Then
src\roslyn\src\Analyzers\VisualBasic\Analyzers\UseAutoProperty\Utilities.vb (2)
11If declarator.Names.Count > 1 Then 19If field.Declarators.Count > 1 Then
src\roslyn\src\Analyzers\VisualBasic\Analyzers\UseCoalesceExpression\VisualBasicUseCoalesceExpressionForIfNullStatementCheckDiagnosticAnalyzer.vb (1)
27Return declarator.Names.Count = 1
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\ExpressionSyntaxExtensions.vb (1)
176While collectionInitializer.Initializers.Count > 0 AndAlso
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\InvocationExpressionSyntaxExtensions.vb (1)
13Return invocationExpression.ArgumentList IsNot Nothing AndAlso invocationExpression.ArgumentList.Arguments.Count = 0 AndAlso
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SemanticModelExtensions.vb (2)
118If variableDeclarator.Names.Count > 0 Then 133If variableDeclarator.Names.Count > 0 Then
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\StatementSyntaxExtensions.vb (1)
390Return If(list Is Nothing, 0, list.Parameters.Count)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SyntaxNodeExtensions.vb (2)
960For j = 0 To statement.ImportsClauses.Count - 1 1245If DirectCast(parent, VariableDeclaratorSyntax).Names.Count = 1 Then
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Services\RefactoringHelpers\VisualBasicRefactoringHelpers.vb (2)
94If localDeclarationStatement.Declarators.Count = 1 And localDeclarationStatement.Declarators.First().Names.Count = 1 Then
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Services\SyntaxFacts\VisualBasicSyntaxFacts.vb (5)
1001If typeParameterList IsNot Nothing AndAlso typeParameterList.Parameters.Count > 0 Then 1004For i = 1 To typeParameterList.Parameters.Count - 1 1601Return DirectCast(node, VariableDeclaratorSyntax).Names.Count 1605Return DirectCast(node, AttributeListSyntax).Attributes.Count 1607Return DirectCast(node, ImportsStatementSyntax).ImportsClauses.Count
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Utilities\ImportsOrganizer.vb (3)
37If import1.ImportsClauses.Count = 0 OrElse import2.ImportsClauses.Count = 0 Then 138If clauses.Count > 0 Then
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Utilities\ImportsStatementComparer.vb (4)
27If directive1.ImportsClauses.Count = 0 And directive2.ImportsClauses.Count = 0 Then 29ElseIf directive1.ImportsClauses.Count = 0 Then 31ElseIf directive2.ImportsClauses.Count = 0 Then
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Utilities\NameSyntaxComparer.vb (3)
119value = x.TypeArgumentList.Arguments.Count - y.TypeArgumentList.Arguments.Count 125For i = 0 To x.TypeArgumentList.Arguments.Count
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Utilities\SpeculationAnalyzer.vb (3)
277Debug.Assert(originalParams.Count = replacedParams.Count) 284For i As Integer = 0 To originalParams.Count - 1
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (21)
src\roslyn\src\Analyzers\VisualBasic\CodeFixes\AddExplicitCast\VisualBasicAddExplicitCastCodeFixProvider.vb (1)
119For i = 0 To arguments.Count - 1
src\roslyn\src\Analyzers\VisualBasic\CodeFixes\GenerateDefaultConstructors\VisualBasicGenerateDefaultConstructorsService.vb (1)
44If baseList.Types.Count > 0 AndAlso
src\roslyn\src\Analyzers\VisualBasic\CodeFixes\GenerateParameterizedMember\VisualBasicGenerateParameterizedMemberService.vb (1)
83If genericName.TypeArgumentList.Arguments.Count = 1 Then
src\roslyn\src\Analyzers\VisualBasic\CodeFixes\UseCollectionInitializer\VisualBasicUseCollectionInitializerCodeFixProvider.vb (1)
96If arguments.Count = 1 Then
src\roslyn\src\Analyzers\VisualBasic\CodeFixes\UseObjectInitializer\UseInitializerHelpers.vb (1)
15objectCreation.ArgumentList.Arguments.Count = 0 Then
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\VisualBasicCodeGenerationService.vb (2)
302Dim parameterCount = If(parameterList IsNot Nothing, parameterList.Parameters.Count, 0) 416If attributes.Count = 1 Then
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\VisualBasicDeclarationComparer.vb (4)
409Dim xParameterCount = x.Parameters.Count 410Dim yParameterCount = y.Parameters.Count 412comparisonResult = If(xParameterCount = yParameterCount, 0, If(x.Parameters.Count < y.Parameters.Count, -1, 1))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ArgumentListSyntaxExtensions.vb (1)
13Dim count = argumentList.Arguments.Count
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ObjectCreationExpressionExtensions.vb (1)
17If objectCreationExpression.ArgumentList.Arguments.Count > 0 Then
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Indentation\SpecialFormattingOperation.vb (2)
118argumentList.Arguments.Count = 0 OrElse 187If caseStatement Is Nothing OrElse caseStatement.Cases.Count = 0 Then
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\VisualBasicMoveDeclarationNearReferenceService.vb (1)
38Return variableDeclarator.Names.Count = 1
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\VisualBasicSemanticFactsService.vb (1)
142If usingStatement.Variables.Count > 0 Then
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\VisualBasicTypeInferenceService.TypeInferrer.vb (4)
608If variableDeclarator.Names.Count >= 1 Then 934If invocation.ArgumentList IsNot Nothing AndAlso invocation.ArgumentList.Arguments.Count > 0 AndAlso 960If lambda.SubOrFunctionHeader.ParameterList.Parameters.Count > 0 Then 1051Where(Function(m) m.Parameters.Length = collectionInitializer.Initializers.Count).
Microsoft.CodeAnalysis.VisualBasic.Features (67)
ChangeSignature\VisualBasicChangeSignatureService.vb (4)
550argumentCount = argumentList.Arguments.Count 567If arguments.Count = 0 Then 570numSeparatorsToSkip = arguments.Count - newArguments.Length + 1 574numSeparatorsToSkip = arguments.Count - newArguments.Length
CodeFixes\Suppression\VisualBasicSuppressionCodeFixProvider.vb (2)
212Return attributeList IsNot Nothing AndAlso attributeList.Attributes.Count = 1 238hasMultipleIds = errorCodes.Count > 1
CodeRefactorings\InlineTemporary\VisualBasicInlineTemporaryCodeRefactoringProvider.vb (5)
260If localDeclaration.Declarators.Count > 1 And variableDeclarator.Names.Count = 1 Then 264If variableDeclarator.Names.Count > 1 Then 275If variableDeclarator.Names.Count > 1 OrElse 276localDeclaration.Declarators.Count > 1 Then
CodeRefactorings\MoveType\VisualBasicMoveTypeService.vb (1)
25Return (statement.Identifier.ValueText, If(statement.TypeParameterList?.Parameters.Count, 0))
Completion\CompletionProviders\InternalsVisibleToCompletionProvider.vb (1)
52Return If(arguments.Count > 0, arguments(0).GetExpression(), Nothing)
ConvertAnonymousType\VisualBasicConvertAnonymousTypeToTupleCodeRefactoringProvider.vb (1)
23Return anonymousType.Initializer.Initializers.Count
ConvertForToForEach\VisualBasicConvertForToForEachCodeRefactoringProvider.vb (1)
39Return firstVariable.Names.Count = 1
Debugging\BreakpointResolver.vb (1)
66parameterCount = parameterList.Parameters.Count
EditAndContinue\BreakpointSpans.vb (10)
96If list.Count = 0 Then 261If declarators.Count = 0 Then 274If name.ArrayBounds IsNot Nothing OrElse DirectCast(name.Parent, VariableDeclaratorSyntax).Names.Count > 1 Then 302If left < 0 AndAlso right >= nodes.Count Then 313If right < nodes.Count Then 345If query.Clauses.First() Is fromClause AndAlso fromClause.Variables.Count > 1 Then 398If clause.Items.Count = 1 Then 405If clause.Keys.Count = 0 Then 410If clause.Keys.Count = 1 Then 421If clause.Variables.Count = 1 Then
EditAndContinue\DeclarationBody\FieldWithInitializerDeclarationBody.vb (1)
20Debug.Assert(variableDeclarator.Names.Count = 1)
EditAndContinue\SyntaxUtilities.vb (3)
107Return node.Parent.Parent.IsKind(SyntaxKind.FieldDeclaration) AndAlso DirectCast(node.Parent, VariableDeclaratorSyntax).Names.Count > 1 114Return node.Parent.IsKind(SyntaxKind.FieldDeclaration) AndAlso node.Names.Count = 1 207Return ctor.BlockStatement.ParameterList.Parameters.Count = 0
EditAndContinue\VisualBasicEditAndContinueAnalyzer.vb (7)
57If variableDeclarator.Names.Count = 1 Then 94Return variableDeclarator.Names.Count > 1 AndAlso variableDeclarator.Initializer IsNot Nothing OrElse SyntaxUtilities.HasAsNewClause(variableDeclarator) 150DirectCast(node.Parent, VariableDeclaratorSyntax).Names.Count = 1 Then 436DirectCast(modifiedIdentifier.Parent, VariableDeclaratorSyntax).Names.Count > 1 885If variableDeclarator.Names.Count > 1 Then 896If field.Declarators.Count = 1 AndAlso field.Declarators(0).Names.Count = 1 Then
ExtractMethod\Extensions.vb (3)
404Dim nameCount = variableDeclarator.Names.Count 449ElseIf identifierList.Count = variableDeclarator.Names.Count Then 459Return hasChange OrElse declarationStatement.Declarators.Count <> variableDeclarators.Count
ExtractMethod\VisualBasicMethodExtractor.PostProcessor.vb (6)
62Contract.ThrowIfFalse(statement.Declarators.Count = 1) 128If declarationStatement.Declarators.Count <> 1 Then 192declaration.Declarators.Count <> 1 OrElse 193declaration.Declarators(0).Names.Count <> 1 OrElse 229If declaration.Declarators.Count <> 1 OrElse 230declaration.Declarators(0).Names.Count <> 1 OrElse
ExtractMethod\VisualBasicMethodExtractor.VisualBasicCodeGenerator.ExpressionCodeGenerator.vb (1)
42If varDecl.Names.Count <> 1 Then
GenerateType\VisualBasicGenerateTypeService.vb (3)
279objectCreationExpressionOpt.ArgumentList.Arguments.Count = 1 AndAlso 291ElseIf objectCreationExpressionOpt.ArgumentList.Arguments.Count <> 1 Then 373Dim typeArguments = If(state.SimpleName.Arity = genericName.TypeArgumentList.Arguments.Count,
Highlighting\KeywordHighlighters\ForLoopBlockHighlighter.vb (1)
119Dim numExpectedForBlocksMatched = Math.Max(nextStatement.ControlVariables.Count(), 1)
QuickInfo\VisualBasicSemanticQuickInfoProvider.vb (1)
160If declarators.Count = 0 Then
ReplaceConditionalWithStatementsCodeRefactoringProvider\VisualBasicReplaceConditionalWithStatementsCodeRefactoringProvider.vb (2)
40If localDeclarationStatement.Declarators.Count = 1 Then 42If declarator.Names.Count = 1 Then
ReplaceMethodWithProperty\VisualBasicReplaceMethodWithPropertyService.vb (1)
203If invocationExpression.ArgumentList?.Arguments.Count <> 1 Then
SolutionCrawler\VisualBasicDocumentDifferenceService.vb (2)
39Return field.Declarators.Count > 0 AndAlso ContainsExclusively(GetSeparatedSyntaxListSpan(field.Declarators), span) 69Debug.Assert(list.Count > 0)
src\roslyn\src\Analyzers\VisualBasic\Analyzers\RemoveUnusedMembers\VisualBasicRemoveUnusedMembersDiagnosticAnalyzer.vb (2)
71If declarator?.Names.Count = 1 AndAlso field?.Declarators.Count = 1 Then
src\roslyn\src\Analyzers\VisualBasic\Analyzers\UseAutoProperty\Utilities.vb (2)
11If declarator.Names.Count > 1 Then 19If field.Declarators.Count > 1 Then
src\roslyn\src\Analyzers\VisualBasic\Analyzers\UseCoalesceExpression\VisualBasicUseCoalesceExpressionForIfNullStatementCheckDiagnosticAnalyzer.vb (1)
27Return declarator.Names.Count = 1
src\roslyn\src\Analyzers\VisualBasic\CodeFixes\AddExplicitCast\VisualBasicAddExplicitCastCodeFixProvider.vb (1)
119For i = 0 To arguments.Count - 1
src\roslyn\src\Analyzers\VisualBasic\CodeFixes\GenerateDefaultConstructors\VisualBasicGenerateDefaultConstructorsService.vb (1)
44If baseList.Types.Count > 0 AndAlso
src\roslyn\src\Analyzers\VisualBasic\CodeFixes\GenerateParameterizedMember\VisualBasicGenerateParameterizedMemberService.vb (1)
83If genericName.TypeArgumentList.Arguments.Count = 1 Then
src\roslyn\src\Analyzers\VisualBasic\CodeFixes\UseCollectionInitializer\VisualBasicUseCollectionInitializerCodeFixProvider.vb (1)
96If arguments.Count = 1 Then
src\roslyn\src\Analyzers\VisualBasic\CodeFixes\UseObjectInitializer\UseInitializerHelpers.vb (1)
15objectCreation.ArgumentList.Arguments.Count = 0 Then
Microsoft.CodeAnalysis.VisualBasic.NetAnalyzers (7)
Microsoft.CodeQuality.Analyzers\QualityGuidelines\BasicUseLiteralsWhereAppropriate.Fixer.vb (1)
26Return If(field IsNot Nothing AndAlso field.Declarators.Count > 1, Nothing, field)
Microsoft.NetCore.Analyzers\Performance\BasicDoNotUseCountWhenAnyCanBeUsedFixer.vb (1)
55If invocation IsNot Nothing AndAlso invocation.ArgumentList.Arguments.Count = 1 Then
Microsoft.NetCore.Analyzers\Performance\BasicPreferDictionaryTryMethodsOverContainsKeyGuardFixer.vb (1)
56If invocation.ArgumentList.Arguments.Count = 2 Then
Microsoft.NetCore.Analyzers\Performance\BasicPreferHashDataOverComputeHash.Fixer.vb (1)
43If usingStatement.Variables.Count = 1 Then
Microsoft.NetCore.Analyzers\Performance\BasicPreferLengthCountIsEmptyOverAnyFixer.vb (2)
46If invocation.ArgumentList.Arguments.Count > 0 Then 101If invocation.ArgumentList.Arguments.Count > 0 Then
Microsoft.NetCore.Analyzers\Resources\BasicMarkAssembliesWithNeutralResourcesLanguage.vb (1)
38attribute.ArgumentList.Arguments.Count > 0).GetValueOrDefault()
Microsoft.CodeAnalysis.VisualBasic.Workspaces (91)
CodeGeneration\VisualBasicSyntaxGenerator.vb (34)
1358If fd.Declarators.Count = 1 Then 1360If vd.Initializer IsNot Nothing AndAlso vd.Names.Count = 1 Then 1793If list Is Nothing OrElse list.Attributes.Count > 1 Then 1798If list.Attributes.Count = 1 Then 1820Return p.ParameterList IsNot Nothing AndAlso p.ParameterList.Parameters.Count > 0 AndAlso p.Modifiers.Any(SyntaxKind.DefaultKeyword) 1824Return p.ParameterList IsNot Nothing AndAlso p.ParameterList.Parameters.Count > 0 AndAlso p.Modifiers.Any(SyntaxKind.DefaultKeyword) 1962If vd.Names.Count = 1 Then 1974If list.Attributes.Count = 1 Then 1980If stmt.ImportsClauses.Count = 1 Then 2034If ld.Declarators.Count = 1 AndAlso ld.Declarators(0).Names.Count = 1 Then 2039If fd.Declarators.Count = 1 AndAlso fd.Declarators(0).Names.Count = 1 Then 2046If al.Attributes.Count = 1 Then 2051If stmt.ImportsClauses.Count = 1 Then 2138If fd.Declarators.Count = 1 Then 2143If ld.Declarators.Count = 1 Then 2164If fd.Declarators.Count = 1 Then 2183If ld.Declarators.Count = 1 Then 2541Return If(typeParameterList.Parameters.Count = 0, Nothing, typeParameterList) 2636If constraints.Count = 1 Then 2638ElseIf constraints.Count > 1 Then 2819If ld.Declarators.Count = 1 Then 2824If fd.Declarators.Count = 1 Then 2840If ld.Declarators.Count = 1 Then 2845If fd.Declarators.Count = 1 Then 3214If al.Attributes.Count = 1 Then 3228If al.Attributes.Count = 1 Then 3564If vd IsNot Nothing AndAlso vd.Names.Count = 1 Then 3582If attrList IsNot Nothing AndAlso attrList.Attributes.Count = 1 Then 3589If argList.Arguments.Count = 1 Then 3597If imps.ImportsClauses.Count = 1 Then 3607If imp.Types.Count = 1 Then 3612If inh.Types.Count = 1 Then
FindSymbols\VisualBasicDeclaredSymbolInfoFactoryService.vb (8)
172typeParameterCount:=If(blockStatement.TypeParameterList?.Parameters.Count, 0)) 232parameterCount:=If(constructor.ParameterList?.Parameters.Count, 0))) 294parameterCount:=If(funcDecl.ParameterList?.Parameters.Count, 0), 295typeParameterCount:=If(funcDecl.TypeParameterList?.Parameters.Count, 0))) 376Dim parameterCount = node.ParameterList?.Parameters.Count 386If attribute.ArgumentList?.Arguments.Count > 0 Then 459If parameterList Is Nothing OrElse parameterList.Parameters.Count = 0 Then 582Dim tupleArity = DirectCast(node, TupleTypeSyntax).Elements.Count
ObsoleteSymbol\VisualBasicObsoleteSymbolService.vb (2)
31If localDeclaration.Declarators.Count <> 1 Then 41If declarator.Names.Count <> 1 Then
Recommendations\VisualBasicRecommendationServiceRunner.vb (2)
23Return lambdaSyntax.SubOrFunctionHeader.ParameterList.Parameters.Count 72If parameters.Count > ordinalInLambda Then
Simplification\Reducers\VisualBasicExtensionMethodReducer.vb (1)
43Dim noOfArguments = argumentList.Arguments.Count
Simplification\Reducers\VisualBasicVariableDeclaratorReducer.vb (1)
67If variableDeclarator.Names.Count <> 1 Then
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\ExpressionSyntaxExtensions.vb (1)
176While collectionInitializer.Initializers.Count > 0 AndAlso
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\InvocationExpressionSyntaxExtensions.vb (1)
13Return invocationExpression.ArgumentList IsNot Nothing AndAlso invocationExpression.ArgumentList.Arguments.Count = 0 AndAlso
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SemanticModelExtensions.vb (2)
118If variableDeclarator.Names.Count > 0 Then 133If variableDeclarator.Names.Count > 0 Then
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\StatementSyntaxExtensions.vb (1)
390Return If(list Is Nothing, 0, list.Parameters.Count)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SyntaxNodeExtensions.vb (2)
960For j = 0 To statement.ImportsClauses.Count - 1 1245If DirectCast(parent, VariableDeclaratorSyntax).Names.Count = 1 Then
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Services\RefactoringHelpers\VisualBasicRefactoringHelpers.vb (2)
94If localDeclarationStatement.Declarators.Count = 1 And localDeclarationStatement.Declarators.First().Names.Count = 1 Then
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Services\SyntaxFacts\VisualBasicSyntaxFacts.vb (5)
1001If typeParameterList IsNot Nothing AndAlso typeParameterList.Parameters.Count > 0 Then 1004For i = 1 To typeParameterList.Parameters.Count - 1 1601Return DirectCast(node, VariableDeclaratorSyntax).Names.Count 1605Return DirectCast(node, AttributeListSyntax).Attributes.Count 1607Return DirectCast(node, ImportsStatementSyntax).ImportsClauses.Count
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Utilities\ImportsOrganizer.vb (3)
37If import1.ImportsClauses.Count = 0 OrElse import2.ImportsClauses.Count = 0 Then 138If clauses.Count > 0 Then
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Utilities\ImportsStatementComparer.vb (4)
27If directive1.ImportsClauses.Count = 0 And directive2.ImportsClauses.Count = 0 Then 29ElseIf directive1.ImportsClauses.Count = 0 Then 31ElseIf directive2.ImportsClauses.Count = 0 Then
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Utilities\NameSyntaxComparer.vb (3)
119value = x.TypeArgumentList.Arguments.Count - y.TypeArgumentList.Arguments.Count 125For i = 0 To x.TypeArgumentList.Arguments.Count
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Utilities\SpeculationAnalyzer.vb (3)
277Debug.Assert(originalParams.Count = replacedParams.Count) 284For i As Integer = 0 To originalParams.Count - 1
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\VisualBasicCodeGenerationService.vb (2)
302Dim parameterCount = If(parameterList IsNot Nothing, parameterList.Parameters.Count, 0) 416If attributes.Count = 1 Then
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\VisualBasicDeclarationComparer.vb (4)
409Dim xParameterCount = x.Parameters.Count 410Dim yParameterCount = y.Parameters.Count 412comparisonResult = If(xParameterCount = yParameterCount, 0, If(x.Parameters.Count < y.Parameters.Count, -1, 1))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ArgumentListSyntaxExtensions.vb (1)
13Dim count = argumentList.Arguments.Count
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ObjectCreationExpressionExtensions.vb (1)
17If objectCreationExpression.ArgumentList.Arguments.Count > 0 Then
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Indentation\SpecialFormattingOperation.vb (2)
118argumentList.Arguments.Count = 0 OrElse 187If caseStatement Is Nothing OrElse caseStatement.Cases.Count = 0 Then
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\VisualBasicMoveDeclarationNearReferenceService.vb (1)
38Return variableDeclarator.Names.Count = 1
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\VisualBasicSemanticFactsService.vb (1)
142If usingStatement.Variables.Count > 0 Then
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\VisualBasicTypeInferenceService.TypeInferrer.vb (4)
608If variableDeclarator.Names.Count >= 1 Then 934If invocation.ArgumentList IsNot Nothing AndAlso invocation.ArgumentList.Arguments.Count > 0 AndAlso 960If lambda.SubOrFunctionHeader.ParameterList.Parameters.Count > 0 Then 1051Where(Function(m) m.Parameters.Length = collectionInitializer.Initializers.Count).
Microsoft.CodeAnalysis.Workspaces (15)
Editing\SyntaxGenerator.cs (1)
1599for (; count > 0 && offset < list.Count; count--)
FindSymbols\FindReferences\Finders\ConstructorSymbolReferenceFinder.cs (1)
274var actualArgumentCount = state.SyntaxFacts.GetArgumentsOfObjectCreationExpression(node).Count;
FindSymbols\SyntaxTree\SyntaxTreeIndex_Create.cs (1)
293if (arguments.Count != 2)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\RefactoringHelpers\AbstractRefactoringHelpers.cs (1)
437if (variables.Count == 1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\LightweightOverloadResolution.cs (10)
54if (arguments.Count > 0) 78for (var i = 0; i < arguments.Count; i++) 86for (var argumentIndex = 0; argumentIndex < arguments.Count; argumentIndex++) 163for (var i = 0; i < arguments.Count; i++) 166for (var i = 0; i < arguments.Count; i++) 169if (parameterIndex >= 0 && parameterIndex < arguments.Count) 187Contract.ThrowIfTrue(argumentToParameterMap.Count != arguments.Count); 193for (var argumentIndex = 0; argumentIndex < arguments.Count; argumentIndex++) 260for (var i = 0; i < arguments.Count - 1; i++) 268return arguments.Count - 1;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.State.cs (1)
65if (variables.Count != 1)
Microsoft.DotNet.CodeAnalysis (1)
Analyzers\AppContextDefaultsAnalyzer.cs (1)
114if (call.ArgumentList.Arguments.Count != 2)
Microsoft.DotNet.GenFacades (1)
TypeParser.cs (1)
125return typeParameterList != null ? identifier + "`" + typeParameterList.Parameters.Count : identifier;
Microsoft.Extensions.Logging.Generators (2)
LoggerMessageGenerator.Parser.cs (2)
656typeDeclaration.TypeParameterList.Parameters.Count != 0) 662for (int i = 0; i < typeDeclaration.TypeParameterList.Parameters.Count; i++)
Microsoft.Interop.LibraryImportGenerator (1)
Analyzers\ConvertToLibraryImportFixer.cs (1)
363if (declaration.Declaration.Variables.Count != 1)
Microsoft.Maui.Controls.BindingSourceGen (4)
BindingSourceGenerator.cs (2)
57 && invocation.ArgumentList.Arguments.Count >= 2 67 && invocation.ArgumentList.Arguments.Count >= 1
InvocationParser.cs (1)
89 if (argumentsList.Count < 2)
PathParser.cs (1)
178 if (argumentList.Count != 1)
Microsoft.ML.InternalCodeAnalyzer (3)
ContractsCheckAnalyzer.cs (1)
109for (int i = 0; i < syntaxArgs.Count; ++i)
ContractsCheckNameofFixProvider.cs (1)
61if (nameArg.NameColon == null && argList.Arguments.Count >= 2 &&
SingleVariableDeclarationAnalyzer.cs (1)
44if (vars.Count <= 1 || node.Parent.IsKind(SyntaxKind.ForStatement))
QuarantineTools.Tests (2)
ActiveIssueTests.cs (1)
399if (remaining.Count == list.Attributes.Count)
QuarantineScriptTests.cs (1)
343if (remaining.Count == list.Attributes.Count)
Roslyn.Diagnostics.Analyzers (12)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\RefactoringHelpers\AbstractRefactoringHelpers.cs (1)
437if (variables.Count == 1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\LightweightOverloadResolution.cs (10)
54if (arguments.Count > 0) 78for (var i = 0; i < arguments.Count; i++) 86for (var argumentIndex = 0; argumentIndex < arguments.Count; argumentIndex++) 163for (var i = 0; i < arguments.Count; i++) 166for (var i = 0; i < arguments.Count; i++) 169if (parameterIndex >= 0 && parameterIndex < arguments.Count) 187Contract.ThrowIfTrue(argumentToParameterMap.Count != arguments.Count); 193for (var argumentIndex = 0; argumentIndex < arguments.Count; argumentIndex++) 260for (var i = 0; i < arguments.Count - 1; i++) 268return arguments.Count - 1;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\MoveDeclarationNearReference\AbstractMoveDeclarationNearReferenceService.State.cs (1)
65if (variables.Count != 1)
Roslyn.Diagnostics.CSharp.Analyzers (34)
CSharpSpecializedEnumerableCreationAnalyzer.cs (1)
101AnalyzeArrayLength(initializer.Expressions.Count, initializer.Parent, addDiagnostic);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeStyle\TypeStyle\TypeStyleHelper.cs (2)
45if (tupleType.TupleElements.Length != tuple.Arguments.Count) 50for (int i = 0, n = tuple.Arguments.Count; i < n; i++)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ParenthesizedExpressionSyntaxExtensions.cs (3)
139if (collectionExpression.Elements.Count == 0) 700if (argumentIndex >= 0 && argumentIndex < argumentList.Arguments.Count - 1) 709if (expressionIndex >= 0 && expressionIndex < initializer.Expressions.Count - 1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\FormattingHelpers.cs (1)
398if (initializer.Expressions.Count <= 0)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\SpacingFormattingRule.cs (2)
576=> forStatement is { Initializers.Count: 0, Declaration: null, Condition: null, Incrementors.Count: 0 };
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\RefactoringHelpers\CSharpRefactoringHelpers.cs (1)
102if (variables.Count == 1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SemanticFacts\CSharpSemanticFacts.cs (1)
317if (index >= 0 && (index + 1) < orderByClauseSyntax.Orderings.Count)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (1)
894if (switchExpression.Arms.Count < 2)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (3)
212Debug.Assert(originalParams.Count == replacedParams.Count); 215for (var i = 0; i < originalParams.Count; i++)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpTypeStyleHelper.State.cs (1)
82if (variableDeclaration.Variables.Count != 1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationService.cs (2)
289var parameterCount = currentParameterList != null ? currentParameterList.Parameters.Count : 0; 454if (attributes.Count == 1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpDeclarationComparer.cs (2)
412var xParameterCount = x.Parameters.Count; 413var yParameterCount = y.Parameters.Count;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\EnumMemberGenerator.cs (2)
96if (destination.Members.Count == 0) 107if (destination.Members.Count == value &&
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\SeparatedSyntaxListExtensions.cs (3)
15return separatedList.InsertRangeWithTrailingSeparator(separatedList.Count, nodes, separator); 23if (index < separatedList.Count) 26return newList.Count == newList.SeparatorCount
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\TypeDeclarationSyntaxExtensions.cs (1)
154return (EnumDeclarationSyntax)EnsureHasBraces(typeDeclaration, typeDeclaration.Members.Count > 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpReplaceDiscardDeclarationsWithAssignmentsService.cs (1)
230if (_currentNonDiscardVariables.Count > 0)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (7)
747var argumentCount = argumentOpt?.Parent is BaseArgumentListSyntax baseArgumentList ? baseArgumentList.Arguments.Count : -1; 1392.Where(a => a.Parameters.Length == initializerExpression.Expressions.Count) 1641var subPatternCount = positionalPart.Subpatterns.Count; 1833if (invocation.ArgumentList.Arguments.Count > 0) 1877return lambdaExpression.ParameterList.Parameters.Count == 0 2162if (armIndex < switchExpression.Arms.Count - 1) 2404if (elementTypesBuilder.Contains(null) || elementTypesBuilder.Count != arguments.Count)
Roslyn.Diagnostics.VisualBasic.Analyzers (41)
BasicSpecializedEnumerableCreationAnalyzer.vb (1)
103AnalyzeArrayLength(initializer.Initializers.Count, arrayCreationExpression, addDiagnostic)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\ExpressionSyntaxExtensions.vb (1)
176While collectionInitializer.Initializers.Count > 0 AndAlso
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\InvocationExpressionSyntaxExtensions.vb (1)
13Return invocationExpression.ArgumentList IsNot Nothing AndAlso invocationExpression.ArgumentList.Arguments.Count = 0 AndAlso
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SemanticModelExtensions.vb (2)
118If variableDeclarator.Names.Count > 0 Then 133If variableDeclarator.Names.Count > 0 Then
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\StatementSyntaxExtensions.vb (1)
390Return If(list Is Nothing, 0, list.Parameters.Count)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SyntaxNodeExtensions.vb (2)
960For j = 0 To statement.ImportsClauses.Count - 1 1245If DirectCast(parent, VariableDeclaratorSyntax).Names.Count = 1 Then
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Services\RefactoringHelpers\VisualBasicRefactoringHelpers.vb (2)
94If localDeclarationStatement.Declarators.Count = 1 And localDeclarationStatement.Declarators.First().Names.Count = 1 Then
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Services\SyntaxFacts\VisualBasicSyntaxFacts.vb (5)
1001If typeParameterList IsNot Nothing AndAlso typeParameterList.Parameters.Count > 0 Then 1004For i = 1 To typeParameterList.Parameters.Count - 1 1601Return DirectCast(node, VariableDeclaratorSyntax).Names.Count 1605Return DirectCast(node, AttributeListSyntax).Attributes.Count 1607Return DirectCast(node, ImportsStatementSyntax).ImportsClauses.Count
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Utilities\ImportsOrganizer.vb (3)
37If import1.ImportsClauses.Count = 0 OrElse import2.ImportsClauses.Count = 0 Then 138If clauses.Count > 0 Then
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Utilities\ImportsStatementComparer.vb (4)
27If directive1.ImportsClauses.Count = 0 And directive2.ImportsClauses.Count = 0 Then 29ElseIf directive1.ImportsClauses.Count = 0 Then 31ElseIf directive2.ImportsClauses.Count = 0 Then
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Utilities\NameSyntaxComparer.vb (3)
119value = x.TypeArgumentList.Arguments.Count - y.TypeArgumentList.Arguments.Count 125For i = 0 To x.TypeArgumentList.Arguments.Count
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\VisualBasicCodeGenerationService.vb (2)
302Dim parameterCount = If(parameterList IsNot Nothing, parameterList.Parameters.Count, 0) 416If attributes.Count = 1 Then
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\VisualBasicDeclarationComparer.vb (4)
409Dim xParameterCount = x.Parameters.Count 410Dim yParameterCount = y.Parameters.Count 412comparisonResult = If(xParameterCount = yParameterCount, 0, If(x.Parameters.Count < y.Parameters.Count, -1, 1))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ArgumentListSyntaxExtensions.vb (1)
13Dim count = argumentList.Arguments.Count
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ObjectCreationExpressionExtensions.vb (1)
17If objectCreationExpression.ArgumentList.Arguments.Count > 0 Then
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Indentation\SpecialFormattingOperation.vb (2)
118argumentList.Arguments.Count = 0 OrElse 187If caseStatement Is Nothing OrElse caseStatement.Cases.Count = 0 Then
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\VisualBasicMoveDeclarationNearReferenceService.vb (1)
38Return variableDeclarator.Names.Count = 1
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\VisualBasicSemanticFactsService.vb (1)
142If usingStatement.Variables.Count > 0 Then
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\VisualBasicTypeInferenceService.TypeInferrer.vb (4)
608If variableDeclarator.Names.Count >= 1 Then 934If invocation.ArgumentList IsNot Nothing AndAlso invocation.ArgumentList.Arguments.Count > 0 AndAlso 960If lambda.SubOrFunctionHeader.ParameterList.Parameters.Count > 0 Then 1051Where(Function(m) m.Parameters.Length = collectionInitializer.Initializers.Count).
System.Windows.Forms.Analyzers.CSharp (1)
System\Windows\Forms\CSharp\Generators\ApplicationConfiguration\ApplicationConfigurationGenerator.cs (1)
111ArgumentList.Arguments.Count: 0,
System.Windows.Forms.PrivateSourceGenerators (1)
System\Windows\Forms\SourceGenerators\EnumValidationGenerator.cs (1)
47ArgumentList.Arguments.Count: <= 2,