Implemented interface member:
1084 references to Count
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.SignalR.Client.SourceGenerator (1)
HubClientProxyGenerator.Parser.cs (1)
257{ Arguments: { Count: 1 } } als)
Microsoft.CodeAnalysis (16)
Syntax\SeparatedSyntaxList.cs (15)
228return this[this.Count - 1]; 235return this[this.Count - 1]; 248for (int i = 0, n = this.Count; i < n; i++) 261for (int i = 0, n = this.Count; i < n; i++) 274for (int i = 0, n = this.Count; i < n; i++) 287for (int i = this.Count - 1; i >= 0; i--) 300for (int i = this.Count - 1; i >= 0; i--) 318for (int i = 0; i < this.Count; i++) 365return Insert(this.Count, node); 374return InsertRange(this.Count, nodes); 404if (index < 0 || index > this.Count) 410int insertionIndex = index < this.Count ? nodesWithSeps.IndexOf(this[index]) : nodesWithSeps.Count; 471if (index < 0 || index > this.Count) 521if (index >= 0 && index < this.Count) 542if (index >= 0 && index < this.Count)
Syntax\SeparatedSyntaxList.Enumerator.cs (1)
32if (newIndex < _list.Count)
Microsoft.CodeAnalysis.CodeStyle (12)
src\Analyzers\Core\Analyzers\UseCoalesceExpression\AbstractUseCoalesceExpressionForIfNullCheckDiagnosticAnalyzer.cs (1)
140if (declarators.Count != 1)
src\Analyzers\Core\Analyzers\UseCollectionInitializer\UpdateExpressionState.cs (6)
194if (forCollectionExpression && arguments.Count != 1) 229Contract.ThrowIfTrue(arguments.Count == 0); 248if (arguments.Count > 1) 259if (arguments.Count != 1) 284if (arguments.Count < 1) 287if (requiredArgumentName != null && arguments.Count != 1)
src\Analyzers\Core\Analyzers\UseIsNullCheck\AbstractUseIsNullForReferenceEqualsDiagnosticAnalyzer.cs (1)
90if (arguments.Count != 2)
src\Analyzers\Core\Analyzers\UseNullPropagation\AbstractUseNullPropagationDiagnosticAnalyzer.cs (1)
300if (arguments.Count != 2)
src\Analyzers\Core\Analyzers\ValidateFormatString\AbstractValidateFormatStringDiagnosticAnalyzer.cs (3)
138var numberOfArguments = arguments.Count; 229if (parameterWithMatchingName.Ordinal >= arguments.Count) 236if (parameterWithMatchingName.IsParams && parameters.Length != arguments.Count)
Microsoft.CodeAnalysis.CodeStyle.Fixes (3)
src\Analyzers\Core\CodeFixes\AddExplicitCast\Fixer.cs (1)
130for (var i = 0; i < arguments.Count; i++)
src\Analyzers\Core\CodeFixes\AddParameter\AbstractAddParameterCodeFixProvider.cs (2)
208if (isNamedArgument || NonParamsParameterCount(method) < arguments.Count) 442for (int i = 0, n = arguments.Count; i < n; i++)
Microsoft.CodeAnalysis.CSharp (35)
Binder\Binder_Constraints.cs (1)
128for (int i = 0, n = constraintsSyntax.Count; i < n; i++)
Binder\Binder_Expressions.cs (7)
1000int numElements = arguments.Count; 1014var boundArguments = ArrayBuilder<BoundExpression>.GetInstance(arguments.Count); 1015var elementTypesWithAnnotations = ArrayBuilder<TypeWithAnnotations>.GetInstance(arguments.Count); 1016var elementLocations = ArrayBuilder<Location>.GetInstance(arguments.Count); 1082int numElements = arguments.Count; 1588Debug.Assert(node.Arity == typeArgumentList.Count); 7541bool rightHasTypeArguments = typeArgumentsSyntax.Count > 0;
Binder\Binder_Lambda.cs (4)
185var isLastParameter = parameterCount == parameterSyntaxList.Value.Count; 254var discardsBuilder = ArrayBuilder<bool>.GetInstance(parameters.Count); 309if (parameterSyntaxList.Count > 0) 315for (int i = 1, n = parameterSyntaxList.Count; i < n; i++)
Binder\Binder_Patterns.cs (1)
268var builder = ArrayBuilder<BoundPattern>.GetInstance(subpatterns.Count);
Binder\Binder_Statements.cs (1)
2857int count = statements.Count;
Binder\Binder_Symbols.cs (4)
1339Debug.Assert(typeArguments.Count > 0); 1340var args = ArrayBuilder<TypeWithAnnotations>.GetInstance(typeArguments.Count); 1399Error(diagnostics, ErrorCode.ERR_BadArity, typeSyntax, type, MessageID.IDS_SK_TYPE.Localize(), typeArgumentsSyntax.Count); 1431Error(diagnostics, ErrorCode.ERR_BadArity, syntax, plainName, MessageID.IDS_MethodGroup.Localize(), typeArgumentsSyntax.Count);
Binder\ExpressionListVariableBinder.cs (1)
22Debug.Assert(expressions.Count > 0);
Binder\ExpressionVariableFinder.cs (2)
115Debug.Assert(nodes.Count > 0); 576if (nodes.Count == 0)
Binder\ForLoopBinder.cs (1)
103if (incrementors.Count > 0)
Binder\LocalBinderFactory.cs (1)
628if (incrementors.Count > 0)
Binder\WithCrefTypeParametersBinder.cs (1)
120for (int i = typeArguments.Count - 1; i >= 0; i--)
BoundTree\UnboundLambda.cs (1)
1548Debug.Assert(_parameterSyntaxList is not null && 0 <= index && index < _parameterSyntaxList.Value.Count);
Parser\LanguageParser.cs (2)
12963if (initializers.Count == 0) 12968for (int i = 0, n = initializers.Count; i < n; i++)
Symbols\ConstraintsHelper.cs (3)
676Debug.Assert(typeArgumentsSyntax.Count == 0 /*omitted*/ || typeArgumentsSyntax.Count == type.Arity); 696var location = ordinal < typeArgumentsSyntax.Count ? typeArgumentsSyntax[ordinal].Location : args.Location;
Symbols\Source\ParameterHelpers.cs (1)
80parametersList.Count - 2,
Symbols\Source\SourceFixedFieldSymbol.cs (2)
72if (arguments.Count == 0 || arguments[0].Expression.Kind() == SyntaxKind.OmittedArraySizeExpression) 78if (arguments.Count > 1)
Syntax\CSharpSyntaxRewriter.cs (1)
173var count = list.Count;
Syntax\SyntaxReplacer.cs (1)
399if (index >= 0 && index < list.Count)
Microsoft.CodeAnalysis.CSharp.CodeStyle (58)
src\Analyzers\CSharp\Analyzers\InlineDeclaration\CSharpInlineDeclarationDiagnosticAnalyzer.cs (1)
237var reportNode = localDeclaration.Variables.Count == 1
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryDiscardDesignation\CSharpRemoveUnnecessaryDiscardDesignationDiagnosticAnalyzer.cs (1)
85recursivePattern.PositionalPatternClause.Subpatterns.Count == 1)
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryLambdaExpression\CSharpRemoveUnnecessaryLambdaExpressionDiagnosticAnalyzer.cs (1)
144if (invokedMethod.TypeArguments.Length != invokedTypeArguments.Count)
src\Analyzers\CSharp\Analyzers\RemoveUnusedMembers\CSharpRemoveUnusedMembersDiagnosticAnalyzer.cs (2)
43Parent: FieldDeclarationSyntax { Declaration.Variables.Count: 0 } or 44EventFieldDeclarationSyntax { Declaration.Variables.Count: 0 }
src\Analyzers\CSharp\Analyzers\SimplifyPropertyPattern\SimplifyPropertyPatternHelpers.cs (1)
33PropertyPatternClause.Subpatterns: { Count: 1 } subpatterns
src\Analyzers\CSharp\Analyzers\UseAutoProperty\CSharpUseAutoPropertyAnalyzer.cs (1)
247return fieldDeclaration.Declaration.Variables.Count == 1
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForArrayDiagnosticAnalyzer.cs (1)
94if (expression.Initializer is { Expressions.Count: > 0 } &&
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForBuilderDiagnosticAnalyzer.cs (3)
149argumentIndex == arguments.Count ? declarator.Identifier : 150argumentIndex == arguments.Count - 1 && arguments[argumentIndex] is { RefKindKeyword.RawKind: (int)SyntaxKind.OutKeyword, Expression: DeclarationExpressionSyntax { Designation: SingleVariableDesignationSyntax singleVariable } } 219memberAccess.Parent is InvocationExpressionSyntax { ArgumentList.Arguments.Count: 0 } invocationExpression &&
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForFluentDiagnosticAnalyzer.cs (5)
236if (objectCreation.ArgumentList is { Arguments.Count: 1 }) 253else if (objectCreation.ArgumentList is null or { Arguments.Count: 0 }) 359Contract.ThrowIfTrue(useSpread && arguments.Count != 1); 364for (var i = arguments.Count - 1; i >= 0; i--) 418if (invocation.ArgumentList.Arguments.Count > 0)
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (11)
773if (sizeValue != initializer.Expressions.Count) 941arguments.Count == 1) 950return arguments.Count == 0; 954return arguments.Count == originalCreateMethod.Parameters.Length; 960if (arguments.Count >= 2) 977if (arguments.Count == 1 && 1024if (objectCreation.ArgumentList != null && objectCreation.ArgumentList.Arguments.Count > 0) 1028if (objectCreation.Initializer.IsKind(SyntaxKind.ObjectCreationExpression) && objectCreation.Initializer.Expressions.Count > 0) 1126if (invocation.ArgumentList.Arguments.Count != 0) 1131TypeArgumentList.Arguments.Count: 1, 1193Contract.ThrowIfTrue(arguments.Count != 1);
src\Analyzers\CSharp\Analyzers\UseCollectionInitializer\CSharpUseCollectionInitializerAnalyzer.cs (3)
44Expressions.Count: > 0, 104individualElementCount += invocation.ArgumentList.Arguments.Count; 170if (invocationExpression.ArgumentList.Arguments.Count != 0)
src\Analyzers\CSharp\Analyzers\UseCompoundAssignment\CSharpUseCompoundCoalesceAssignmentDiagnosticAnalyzer.cs (1)
194else if (condition is InvocationExpressionSyntax { ArgumentList.Arguments.Count: 2 } invocation)
src\Analyzers\CSharp\Analyzers\UseLocalFunction\CSharpUseLocalFunctionDiagnosticAnalyzer.cs (3)
90if (localDeclaration.Declaration.Variables.Count != 1) 327localDeclaration.Declaration.Variables.Count == 1) 364localDeclaration.Declaration.Variables.Count == 1)
src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpIsAndCastCheckDiagnosticAnalyzer.cs (1)
190if (localDeclarationStatement.Declaration.Variables.Count != 1)
src\Analyzers\CSharp\Analyzers\UseSystemThreadingLock\CSharpUseSystemThreadingLockDiagnosticAnalyzer.cs (1)
117if (variableDeclarator.Parent is not VariableDeclarationSyntax { Parent: FieldDeclarationSyntax, Variables.Count: 1 })
src\Analyzers\CSharp\Analyzers\UseTupleSwap\CSharpUseTupleSwapDiagnosticAnalyzer.cs (1)
77if (localDeclarationStatement.Declaration.Variables.Count != 1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeStyle\TypeStyle\TypeStyleHelper.cs (2)
46if (tupleType.TupleElements.Length != tuple.Arguments.Count) 51for (int i = 0, n = tuple.Arguments.Count; i < n; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ParenthesizedExpressionSyntaxExtensions.cs (2)
658if (argumentIndex >= 0 && argumentIndex < argumentList.Arguments.Count - 1) 667if (expressionIndex >= 0 && expressionIndex < initializer.Expressions.Count - 1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\FormattingHelpers.cs (1)
399if (initializer.Expressions.Count <= 0)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\SpacingFormattingRule.cs (2)
569=> forStatement.Initializers.Count == 0 572&& forStatement.Incrementors.Count == 0;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SemanticFacts\CSharpSemanticFacts.cs (1)
308if (index >= 0 && (index + 1) < orderByClauseSyntax.Orderings.Count)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpAccessibilityFacts.cs (7)
205if (fd.Declaration != null && fd.Declaration.Variables.Count == 1) 217if (ef.Declaration != null && ef.Declaration.Variables.Count == 1) 229if (ld.Declaration != null && ld.Declaration.Variables.Count == 1) 242if (vd.Variables.Count == 1 && vd.Parent == null) 258if (vd == null || vd.Variables.Count > 1) 279if (list.Attributes.Count == 1) 287if (declaration.Parent is not AttributeListSyntax parentList || parentList.Attributes.Count > 1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (2)
874if (typeParameterList != null && typeParameterList.Parameters.Count > 0) 878for (var i = 1; i < typeParameterList.Parameters.Count; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (3)
212Debug.Assert(originalParams.Count == replacedParams.Count); 215for (var i = 0; i < originalParams.Count; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpTypeStyleHelper.State.cs (1)
67if (variableDeclaration.Variables.Count != 1)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (40)
src\Analyzers\CSharp\CodeFixes\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionCodeFixProvider.cs (1)
99if (declaratorToRemoveNode.Parent is VariableDeclarationSyntax { Parent: LocalDeclarationStatementSyntax declStatement, Variables.Count: 1 })
src\Analyzers\CSharp\CodeFixes\FixReturnType\CSharpFixReturnTypeCodeFixProvider.cs (1)
157var argCount = tuple.Arguments.Count;
src\Analyzers\CSharp\CodeFixes\GenerateParameterizedMember\CSharpGenerateParameterizedMemberService.cs (3)
76if (genericName.TypeArgumentList.Arguments.Count == 1) 87var list = new FixedSizeArrayBuilder<ITypeParameterSymbol>(genericName.TypeArgumentList.Arguments.Count); 155var result = new FixedSizeArrayBuilder<ITypeSymbol>(genericName.TypeArgumentList.Arguments.Count);
src\Analyzers\CSharp\CodeFixes\InlineDeclaration\CSharpInlineDeclarationCodeFixProvider.cs (1)
109var singleDeclarator = declaration.Variables.Count == 1;
src\Analyzers\CSharp\CodeFixes\MakeLocalFunctionStatic\MakeLocalFunctionStaticCodeFixHelper.cs (2)
100var seenDefaultArgumentValue = currentInvocation.ArgumentList.Arguments.Count < localFunction.ParameterList.Parameters.Count;
src\Analyzers\CSharp\CodeFixes\Nullable\CSharpDeclareAsNullableCodeFixProvider.cs (5)
165return variableDeclaration.Variables.Count == 1 ? variableDeclaration.Type : null; 177if (syntax is VariableDeclaratorSyntax { Parent: VariableDeclarationSyntax { Variables.Count: 1 } declaration }) 188if (syntax is VariableDeclaratorSyntax { Parent: VariableDeclarationSyntax { Variables.Count: 1 } declaration }) 250if (node is VariableDeclaratorSyntax { Parent: VariableDeclarationSyntax { Parent: FieldDeclarationSyntax, Variables.Count: 1 } declarationSyntax }) 293if (typeArguments.Count == 1)
src\Analyzers\CSharp\CodeFixes\PopulateSwitch\CSharpPopulateSwitchExpressionCodeFixProvider.cs (1)
43if (switchNode.Arms.Count == 0 ||
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpCollectionExpressionRewriter.cs (1)
79return initializer == null || initializer.Expressions.Count == 0
src\Analyzers\CSharp\CodeFixes\UseCollectionInitializer\CSharpUseCollectionInitializerCodeFixProvider_CollectionInitializer.cs (1)
119if (arguments.Count == 1)
src\Analyzers\CSharp\CodeFixes\UseExplicitArrayInExpressionTree\CSharpUseExplicitArrayInExpressionTreeCodeFixProvider.cs (3)
64for (int i = 0, n = arguments.Count; i < n; i++) 72return (arguments.Count, arrayType.ElementType); 148if (indexToWrap == argumentList.Arguments.Count)
src\Analyzers\CSharp\CodeFixes\UseExplicitTypeForConst\UseExplicitTypeForConstCodeFixProvider.cs (1)
42variableDeclaration.Variables.Count == 1)
src\Analyzers\CSharp\CodeFixes\UseImplicitOrExplicitType\UseExplicitTypeCodeFixProvider.cs (1)
178Debug.Assert(elements.Length == parensDesignation.Variables.Count);
src\Analyzers\CSharp\CodeFixes\UseObjectInitializer\UseInitializerHelpers.cs (1)
20if (baseObjectCreation is ObjectCreationExpressionSyntax { ArgumentList.Arguments.Count: 0 } objectCreation)
src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpAsAndNullCheckCodeFixProvider.cs (1)
112declaration.Variables.Count == 1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationService.cs (1)
454if (attributes.Count == 1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpDeclarationComparer.cs (2)
412var xParameterCount = x.Parameters.Count; 413var yParameterCount = y.Parameters.Count;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\EnumMemberGenerator.cs (2)
97if (destination.Members.Count == 0) 108if (destination.Members.Count == value &&
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\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\TypeDeclarationSyntaxExtensions.cs (1)
155return (EnumDeclarationSyntax)EnsureHasBraces(typeDeclaration, typeDeclaration.Members.Count > 0);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpReplaceDiscardDeclarationsWithAssignmentsService.cs (1)
232if (_currentNonDiscardVariables.Count > 0)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (7)
743var argumentCount = argumentOpt?.Parent is BaseArgumentListSyntax baseArgumentList ? baseArgumentList.Arguments.Count : -1; 1314.Where(a => a.Parameters.Length == initializerExpression.Expressions.Count) 1563var subPatternCount = positionalPart.Subpatterns.Count; 1755if (invocation.ArgumentList.Arguments.Count > 0) 1799return lambdaExpression.ParameterList.Parameters.Count == 0 2084if (armIndex < switchExpression.Arms.Count - 1) 2326if (elementTypesBuilder.Contains(null) || elementTypesBuilder.Count != arguments.Count)
Microsoft.CodeAnalysis.CSharp.EditorFeatures (1)
CompleteStatement\CompleteStatementCommandHandler.cs (1)
453if (forStatementSyntax.Initializers.Count != 0
Microsoft.CodeAnalysis.CSharp.Features (105)
ChangeSignature\CSharpChangeSignatureService.cs (5)
601argumentCount = attribute.ArgumentList.Arguments.Count; 629argumentCount = argumentList.Arguments.Count; 721var numSeparatorsToSkip = arguments.Count - newArguments.Length; 746var numSeparatorsToSkip = arguments.Count - newArguments.Length; 758result.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\InlineTemporary\InlineTemporaryCodeRefactoringProvider.cs (2)
294Debug.Assert(variableDeclaration.Variables.Count > 1); 314if (variableDeclaration.Variables.Count > 1)
Completion\CompletionProviders\InternalsVisibleToCompletionProvider.cs (1)
54return arguments.Count > 0
Completion\KeywordRecommenders\WhereKeywordRecommender.cs (1)
81else if (tokenParent.Parent is LocalFunctionStatementSyntax { TypeParameterList.Parameters.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)
69Convert(lastDeclaration.Initializer.Value, variables.Count == 1 ? previous : lastDeclaration); 151if (localDeclaration.Declaration.Variables.Count != 1)
ConvertLinq\ConvertForEachToLinqQuery\CSharpConvertForEachToLinqQueryProvider.cs (3)
190for (var i = 0; i < localDeclarationStatement.Declaration.Variables.Count; i++) 196i == localDeclarationStatement.Declaration.Variables.Count - 1 252invocationExpression.ArgumentList.Arguments.Count == 1)
ConvertLinq\CSharpConvertLinqQueryToForEachProvider.cs (1)
466((VariableDeclarationSyntax)invocationParent.Parent.Parent).Variables.Count == 1)
Debugging\BreakpointResolver.cs (1)
65parameterCount = parameterList.Parameters.Count;
Debugging\LocationInfoGetter.cs (1)
53fieldDeclarator ??= variableDeclarators.Count > 0 ? variableDeclarators[0] : null;
EditAndContinue\BreakpointSpans.cs (11)
232if (parameters.Count == 0) 304switchExpression.Arms.Count > 0 && 406return orderByClause.Orderings.Count > 0 638else if (forStatement.Initializers.Count > 0) 648else if (forStatement.Incrementors.Count > 0) 787if (variableDeclaration.Variables.Count == 0) 798if (variableDeclaration.Variables.Count == 1) 838if (variableDeclaration.Variables.Count == 1) 858if (variableDeclaration.Variables.Count == 1) 881if (left < 0 && right >= declarators.Count) 891if (right < declarators.Count && declarators[right].Initializer != null)
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (2)
1059if (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)
105if (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)
476var typeArguments = state.SimpleName.Arity == genericName.TypeArgumentList.Arguments.Count
InlineHints\CSharpInlineTypeHintsService.cs (1)
35variableDeclaration.Variables.Count == 1 &&
ReplaceConditionalWithStatements\CSharpReplaceConditionalWithStatementsCodeRefactoringProvider.cs (1)
53if (localDeclarationStatement.Declaration.Variables.Count == 1)
ReplaceMethodWithProperty\CSharpReplaceMethodWithPropertyService.cs (1)
321if (invocation.ArgumentList?.Arguments.Count != 1 ||
src\Analyzers\CSharp\Analyzers\InlineDeclaration\CSharpInlineDeclarationDiagnosticAnalyzer.cs (1)
237var reportNode = localDeclaration.Variables.Count == 1
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryDiscardDesignation\CSharpRemoveUnnecessaryDiscardDesignationDiagnosticAnalyzer.cs (1)
85recursivePattern.PositionalPatternClause.Subpatterns.Count == 1)
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryLambdaExpression\CSharpRemoveUnnecessaryLambdaExpressionDiagnosticAnalyzer.cs (1)
144if (invokedMethod.TypeArguments.Length != invokedTypeArguments.Count)
src\Analyzers\CSharp\Analyzers\RemoveUnusedMembers\CSharpRemoveUnusedMembersDiagnosticAnalyzer.cs (2)
43Parent: FieldDeclarationSyntax { Declaration.Variables.Count: 0 } or 44EventFieldDeclarationSyntax { Declaration.Variables.Count: 0 }
src\Analyzers\CSharp\Analyzers\SimplifyPropertyPattern\SimplifyPropertyPatternHelpers.cs (1)
33PropertyPatternClause.Subpatterns: { Count: 1 } subpatterns
src\Analyzers\CSharp\Analyzers\UseAutoProperty\CSharpUseAutoPropertyAnalyzer.cs (1)
247return fieldDeclaration.Declaration.Variables.Count == 1
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForArrayDiagnosticAnalyzer.cs (1)
94if (expression.Initializer is { Expressions.Count: > 0 } &&
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForBuilderDiagnosticAnalyzer.cs (3)
149argumentIndex == arguments.Count ? declarator.Identifier : 150argumentIndex == arguments.Count - 1 && arguments[argumentIndex] is { RefKindKeyword.RawKind: (int)SyntaxKind.OutKeyword, Expression: DeclarationExpressionSyntax { Designation: SingleVariableDesignationSyntax singleVariable } } 219memberAccess.Parent is InvocationExpressionSyntax { ArgumentList.Arguments.Count: 0 } invocationExpression &&
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForFluentDiagnosticAnalyzer.cs (5)
236if (objectCreation.ArgumentList is { Arguments.Count: 1 }) 253else if (objectCreation.ArgumentList is null or { Arguments.Count: 0 }) 359Contract.ThrowIfTrue(useSpread && arguments.Count != 1); 364for (var i = arguments.Count - 1; i >= 0; i--) 418if (invocation.ArgumentList.Arguments.Count > 0)
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (11)
773if (sizeValue != initializer.Expressions.Count) 941arguments.Count == 1) 950return arguments.Count == 0; 954return arguments.Count == originalCreateMethod.Parameters.Length; 960if (arguments.Count >= 2) 977if (arguments.Count == 1 && 1024if (objectCreation.ArgumentList != null && objectCreation.ArgumentList.Arguments.Count > 0) 1028if (objectCreation.Initializer.IsKind(SyntaxKind.ObjectCreationExpression) && objectCreation.Initializer.Expressions.Count > 0) 1126if (invocation.ArgumentList.Arguments.Count != 0) 1131TypeArgumentList.Arguments.Count: 1, 1193Contract.ThrowIfTrue(arguments.Count != 1);
src\Analyzers\CSharp\Analyzers\UseCollectionInitializer\CSharpUseCollectionInitializerAnalyzer.cs (3)
44Expressions.Count: > 0, 104individualElementCount += invocation.ArgumentList.Arguments.Count; 170if (invocationExpression.ArgumentList.Arguments.Count != 0)
src\Analyzers\CSharp\Analyzers\UseCompoundAssignment\CSharpUseCompoundCoalesceAssignmentDiagnosticAnalyzer.cs (1)
194else if (condition is InvocationExpressionSyntax { ArgumentList.Arguments.Count: 2 } invocation)
src\Analyzers\CSharp\Analyzers\UseLocalFunction\CSharpUseLocalFunctionDiagnosticAnalyzer.cs (3)
90if (localDeclaration.Declaration.Variables.Count != 1) 327localDeclaration.Declaration.Variables.Count == 1) 364localDeclaration.Declaration.Variables.Count == 1)
src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpIsAndCastCheckDiagnosticAnalyzer.cs (1)
190if (localDeclarationStatement.Declaration.Variables.Count != 1)
src\Analyzers\CSharp\Analyzers\UseSystemThreadingLock\CSharpUseSystemThreadingLockDiagnosticAnalyzer.cs (1)
117if (variableDeclarator.Parent is not VariableDeclarationSyntax { Parent: FieldDeclarationSyntax, Variables.Count: 1 })
src\Analyzers\CSharp\Analyzers\UseTupleSwap\CSharpUseTupleSwapDiagnosticAnalyzer.cs (1)
77if (localDeclarationStatement.Declaration.Variables.Count != 1)
src\Analyzers\CSharp\CodeFixes\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionCodeFixProvider.cs (1)
99if (declaratorToRemoveNode.Parent is VariableDeclarationSyntax { Parent: LocalDeclarationStatementSyntax declStatement, Variables.Count: 1 })
src\Analyzers\CSharp\CodeFixes\FixReturnType\CSharpFixReturnTypeCodeFixProvider.cs (1)
157var argCount = tuple.Arguments.Count;
src\Analyzers\CSharp\CodeFixes\GenerateParameterizedMember\CSharpGenerateParameterizedMemberService.cs (3)
76if (genericName.TypeArgumentList.Arguments.Count == 1) 87var list = new FixedSizeArrayBuilder<ITypeParameterSymbol>(genericName.TypeArgumentList.Arguments.Count); 155var result = new FixedSizeArrayBuilder<ITypeSymbol>(genericName.TypeArgumentList.Arguments.Count);
src\Analyzers\CSharp\CodeFixes\InlineDeclaration\CSharpInlineDeclarationCodeFixProvider.cs (1)
109var singleDeclarator = declaration.Variables.Count == 1;
src\Analyzers\CSharp\CodeFixes\MakeLocalFunctionStatic\MakeLocalFunctionStaticCodeFixHelper.cs (2)
100var seenDefaultArgumentValue = currentInvocation.ArgumentList.Arguments.Count < localFunction.ParameterList.Parameters.Count;
src\Analyzers\CSharp\CodeFixes\Nullable\CSharpDeclareAsNullableCodeFixProvider.cs (5)
165return variableDeclaration.Variables.Count == 1 ? variableDeclaration.Type : null; 177if (syntax is VariableDeclaratorSyntax { Parent: VariableDeclarationSyntax { Variables.Count: 1 } declaration }) 188if (syntax is VariableDeclaratorSyntax { Parent: VariableDeclarationSyntax { Variables.Count: 1 } declaration }) 250if (node is VariableDeclaratorSyntax { Parent: VariableDeclarationSyntax { Parent: FieldDeclarationSyntax, Variables.Count: 1 } declarationSyntax }) 293if (typeArguments.Count == 1)
src\Analyzers\CSharp\CodeFixes\PopulateSwitch\CSharpPopulateSwitchExpressionCodeFixProvider.cs (1)
43if (switchNode.Arms.Count == 0 ||
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpCollectionExpressionRewriter.cs (1)
79return initializer == null || initializer.Expressions.Count == 0
src\Analyzers\CSharp\CodeFixes\UseCollectionInitializer\CSharpUseCollectionInitializerCodeFixProvider_CollectionInitializer.cs (1)
119if (arguments.Count == 1)
src\Analyzers\CSharp\CodeFixes\UseExplicitArrayInExpressionTree\CSharpUseExplicitArrayInExpressionTreeCodeFixProvider.cs (3)
64for (int i = 0, n = arguments.Count; i < n; i++) 72return (arguments.Count, arrayType.ElementType); 148if (indexToWrap == argumentList.Arguments.Count)
src\Analyzers\CSharp\CodeFixes\UseExplicitTypeForConst\UseExplicitTypeForConstCodeFixProvider.cs (1)
42variableDeclaration.Variables.Count == 1)
src\Analyzers\CSharp\CodeFixes\UseImplicitOrExplicitType\UseExplicitTypeCodeFixProvider.cs (1)
178Debug.Assert(elements.Length == parensDesignation.Variables.Count);
src\Analyzers\CSharp\CodeFixes\UseObjectInitializer\UseInitializerHelpers.cs (1)
20if (baseObjectCreation is ObjectCreationExpressionSyntax { ArgumentList.Arguments.Count: 0 } objectCreation)
src\Analyzers\CSharp\CodeFixes\UsePatternMatching\CSharpAsAndNullCheckCodeFixProvider.cs (1)
112declaration.Variables.Count == 1)
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (266)
IncrementalParsing\NodeValidators.cs (1)
66Assert.Equal(genericName.TypeArgumentList.Arguments.Count, typeNames.Count());
LexicalAndXml\PreprocessorTests.cs (2)
329Assert.Equal(0, pwd.ErrorCodes.Count); 333Assert.Equal(expected.WarningList.Length, pwd.ErrorCodes.Count);
Parsing\DeclarationParsingTests.cs (80)
273Assert.Equal(1, ad.Attributes.Count); 302Assert.Equal(1, ad.Attributes.Count); 331Assert.Equal(1, ad.Attributes.Count); 358Assert.Equal(1, ad.Attributes.Count); 386Assert.Equal(1, ad.Attributes.Count); 413Assert.Equal(1, ad.Attributes.Count); 418Assert.Equal(0, ad.Attributes[0].ArgumentList.Arguments.Count); 442Assert.Equal(1, ad.Attributes.Count); 447Assert.Equal(2, ad.Attributes[0].ArgumentList.Arguments.Count); 473Assert.Equal(1, ad.Attributes.Count); 478Assert.Equal(1, ad.Attributes[0].ArgumentList.Arguments.Count); 509Assert.Equal(2, ad.Attributes.Count); 540Assert.Equal(1, ad.Attributes.Count); 552Assert.Equal(1, ad.Attributes.Count); 1061Assert.Equal(1, cs.BaseList.Types.Count); 1092Assert.Equal(2, cs.BaseList.Types.Count); 1131Assert.Equal(1, cs.ConstraintClauses[0].Constraints.Count); 1172Assert.Equal(1, cs.ConstraintClauses[0].Constraints.Count); 1234Assert.Equal(1, cs.ConstraintClauses[0].Constraints.Count); 1278Assert.Equal(1, cs.ConstraintClauses[0].Constraints.Count); 1319Assert.Equal(1, cs.ConstraintClauses[0].Constraints.Count); 1360Assert.Equal(3, cs.ConstraintClauses[0].Constraints.Count); 1416Assert.Equal(1, cs.ConstraintClauses[0].Constraints.Count); 1427Assert.Equal(1, cs.ConstraintClauses[1].Constraints.Count); 1471Assert.Equal(1, cs.ConstraintClauses[0].Constraints.Count); 1482Assert.Equal(1, cs.ConstraintClauses[1].Constraints.Count); 1517Assert.Equal(1, cs.ConstraintClauses[0].Constraints.Count); 1526Assert.Equal(1, cs.ConstraintClauses[1].Constraints.Count); 1555Assert.Equal(2, cs.BaseList.Types.Count); 1565Assert.Equal(3, cs.ConstraintClauses[0].Constraints.Count); 2012Assert.Equal(0, ds.ParameterList.Parameters.Count); 2039Assert.Equal(0, ds.ParameterList.Parameters.Count); 2067Assert.Equal(0, ds.ParameterList.Parameters.Count); 2114Assert.Equal(0, ds.ParameterList.Parameters.Count); 2161Assert.Equal(1, ds.ParameterList.Parameters.Count); 2196Assert.Equal(1, ds.ParameterList.Parameters.Count); 2231Assert.Equal(2, ds.ParameterList.Parameters.Count); 2273Assert.Equal(1, ds.ParameterList.Parameters.Count); 2309Assert.Equal(1, ds.ParameterList.Parameters.Count); 2345Assert.Equal(1, ds.ParameterList.Parameters.Count); 2382Assert.Equal(1, ds.ParameterList.Parameters.Count); 2415Assert.Equal(1, ds.ParameterList.Parameters.Count); 2465Assert.Equal(0, ds.ParameterList.Parameters.Count); 2508Assert.Equal(0, ms.ParameterList.Parameters.Count); 2553Assert.Equal(0, ms.ParameterList.Parameters.Count); 2599Assert.Equal(0, ms.ParameterList.Parameters.Count); 2707Assert.Equal(0, ms.ParameterList.Parameters.Count); 2772Assert.Equal(0, ms.ParameterList.Parameters.Count); 2819Assert.Equal(0, ms.ParameterList.Parameters.Count); 2869Assert.Equal(0, ms.ParameterList.Parameters.Count); 3017Assert.Equal(1, ms.ParameterList.Parameters.Count); 3070Assert.Equal(2, ms.ParameterList.Parameters.Count); 3131Assert.Equal(1, ms.ParameterList.Parameters.Count); 3196Assert.Equal(1, ms.ParameterList.Parameters.Count); 3269Assert.Equal(0, ms.ParameterList.Parameters.Count); 3334Assert.Equal(1, ms.ParameterList.Parameters.Count); 3386Assert.Equal(0, ms.ParameterList.Parameters.Count); 3434Assert.Equal(0, ms.ParameterList.Parameters.Count); 3444Assert.Equal(1, ms.ConstraintClauses[0].Constraints.Count); 3628Assert.Equal(1, fs.Declaration.Variables.Count); 3688Assert.Equal(1, fs.Declaration.Variables.Count); 3729Assert.Equal(1, fs.Declaration.Variables.Count); 3784Assert.Equal(1, fs.Declaration.Variables.Count); 3839Assert.Equal(1, fs.Declaration.Variables.Count); 3883Assert.Equal(1, fs.Declaration.Variables.Count); 3927Assert.Equal(1, fs.Declaration.Variables.Count); 3973Assert.Equal(3, fs.Declaration.Variables.Count); 4027Assert.Equal(3, fs.Declaration.Variables.Count); 4090Assert.Equal(1, fs.Declaration.Variables.Count); 4096Assert.Equal(1, fs.Declaration.Variables[0].ArgumentList.Arguments.Count); 4963Assert.Equal(1, ps.ParameterList.Parameters.Count); 5030Assert.Equal(1, ps.ParameterList.Parameters.Count); 5098Assert.Equal(1, ps.ParameterList.Parameters.Count); 5166Assert.Equal(2, ps.ParameterList.Parameters.Count); 5243Assert.Equal(1, ps.ParameterList.Parameters.Count); 5309Assert.Equal(2, ps.ParameterList.Parameters.Count); 5389Assert.Equal(2, ps.ParameterList.Parameters.Count); 5503Assert.Equal(1, ps.ParameterList.Parameters.Count); 5565Assert.Equal(1, ms.ParameterList.Parameters.Count); 5613Assert.Equal(1, ms.ParameterList.Parameters.Count);
Parsing\ExpressionParsingTests.cs (38)
961Assert.Equal(1, cs.ArgumentList.Arguments.Count); 982Assert.Equal(1, cs.ArgumentList.Arguments.Count); 1007Assert.Equal(1, cs.ArgumentList.Arguments.Count); 1032Assert.Equal(1, cs.ArgumentList.Arguments.Count); 1057Assert.Equal(1, ea.ArgumentList.Arguments.Count); 1078Assert.Equal(1, ea.ArgumentList.Arguments.Count); 1103Assert.Equal(1, ea.ArgumentList.Arguments.Count); 1128Assert.Equal(1, ea.ArgumentList.Arguments.Count); 1149Assert.Equal(0, oc.ArgumentList.Arguments.Count); 1171Assert.Equal(1, oc.ArgumentList.Arguments.Count); 1194Assert.Equal(1, oc.ArgumentList.Arguments.Count); 1217Assert.Equal(0, oc.ArgumentList.Arguments.Count); 1226Assert.Equal(0, oc.Initializer.Expressions.Count); 1249Assert.Equal(0, oc.Initializer.Expressions.Count); 1272Assert.Equal(1, oc.Initializer.Expressions.Count); 1296Assert.Equal(3, oc.Initializer.Expressions.Count); 1322Assert.Equal(1, oc.Initializer.Expressions.Count); 1346Assert.Equal(1, oc.Initializer.Expressions.Count); 1850Assert.Equal(1, ac.Initializer.Expressions.Count); 1872Assert.Equal(3, ac.Initializer.Expressions.Count); 1896Assert.Equal(1, ac.Initializer.Expressions.Count); 1916Assert.Equal(1, ac.Initializer.Expressions.Count); 1936Assert.Equal(2, ac.Initializers.Count); 1961Assert.Equal(1, am.ParameterList.Parameters.Count); 1992Assert.Equal(0, am.ParameterList.Parameters.Count); 2098Assert.Equal(0, lambda.ParameterList.Parameters.Count); 2118Assert.Equal(0, lambda.ParameterList.Parameters.Count); 2138Assert.Equal(0, lambda.ParameterList.Parameters.Count); 2160Assert.Equal(1, lambda.ParameterList.Parameters.Count); 2184Assert.Equal(2, lambda.ParameterList.Parameters.Count); 2211Assert.Equal(1, lambda.ParameterList.Parameters.Count); 2236Assert.Equal(1, lambda.ParameterList.Parameters.Count); 2263Assert.Equal(2, tuple.Arguments.Count); 2283Assert.Equal(2, tuple.Arguments.Count); 2564Assert.Equal(1, obs.Orderings.Count); 2608Assert.Equal(2, obs.Orderings.Count); 2657Assert.Equal(1, obs.Orderings.Count); 2705Assert.Equal(1, obs.Orderings.Count);
Parsing\NameParsingTests.cs (19)
213Assert.Equal(1, gname.TypeArgumentList.Arguments.Count); 229Assert.Equal(2, gname.TypeArgumentList.Arguments.Count); 245Assert.Equal(1, gname.TypeArgumentList.Arguments.Count); 305Assert.Equal(1, gname.TypeArgumentList.Arguments.Count); 322Assert.Equal(2, gname.TypeArgumentList.Arguments.Count); 368Assert.Equal(1, gname.TypeArgumentList.Arguments.Count); 385Assert.Equal(1, gname.TypeArgumentList.Arguments.Count); 446Assert.Equal(1, gname.TypeArgumentList.Arguments.Count); 551Assert.Equal(1, array.RankSpecifiers[0].Sizes.Count); 573Assert.Equal(3, array.RankSpecifiers[0].Sizes.Count); 596Assert.Equal(1, array.RankSpecifiers[0].Sizes.Count); 600Assert.Equal(2, array.RankSpecifiers[1].Sizes.Count); 604Assert.Equal(3, array.RankSpecifiers[2].Sizes.Count); 627Assert.Equal(1, gname.TypeArgumentList.Arguments.Count); 652Assert.Equal(1, gname.TypeArgumentList.Arguments.Count); 678Assert.Equal(1, gname.TypeArgumentList.Arguments.Count); 704Assert.Equal(2, gname.TypeArgumentList.Arguments.Count); 736Assert.Equal(1, gname.TypeArgumentList.Arguments.Count); 761Assert.Equal(1, gname.TypeArgumentList.Arguments.Count);
Parsing\ParsingErrorRecoveryTests.cs (53)
4587Assert.Equal(1, ds.Declaration.Variables.Count); 4613Assert.Equal(1, ds.Declaration.Variables.Count); 4640Assert.Equal(1, ds.Declaration.Variables.Count); 4667Assert.Equal(1, ds.Declaration.Variables.Count); 4695Assert.Equal(1, ds.Declaration.Variables.Count); 4722Assert.Equal(1, ds.Declaration.Variables.Count); 4750Assert.Equal(1, ds.Declaration.Variables.Count); 4779Assert.Equal(1, ds.Declaration.Variables.Count); 4808Assert.Equal(1, ds.Declaration.Variables.Count); 4838Assert.Equal(1, ds.Declaration.Variables.Count); 4867Assert.Equal(1, ds.Declaration.Variables.Count); 4895Assert.Equal(1, ds.Declaration.Variables.Count); 4922Assert.Equal(1, ds.Declaration.Variables.Count); 4949Assert.Equal(1, ds.Declaration.Variables.Count); 4976Assert.Equal(1, ds.Declaration.Variables.Count); 5004Assert.Equal(1, ds.Declaration.Variables.Count); 5031Assert.Equal(1, ds.Declaration.Variables.Count); 5059Assert.Equal(1, ds.Declaration.Variables.Count); 5085Assert.Equal(1, ds.Declaration.Variables.Count); 5115Assert.Equal(1, ds.Declaration.Variables.Count); 5144Assert.Equal(1, ds.Declaration.Variables.Count); 5174Assert.Equal(1, ds.Declaration.Variables.Count); 5827Assert.Equal(1, ds.Declaration.Variables.Count); 5867Assert.Equal(1, ds.Declaration.Variables.Count); 5896Assert.Equal(1, ds.Declaration.Variables.Count); 5925Assert.Equal(1, ds.Declaration.Variables.Count); 5955Assert.Equal(1, ds.Declaration.Variables.Count); 5984Assert.Equal(1, ds.Declaration.Variables.Count); 6017Assert.Equal(1, ds.Declaration.Variables.Count); 6044Assert.Equal(1, ds.Declaration.Variables.Count); 6071Assert.Equal(1, ds.Declaration.Variables.Count); 6098Assert.Equal(1, ds.Declaration.Variables.Count); 6126Assert.Equal(1, ds.Declaration.Variables.Count); 6153Assert.Equal(1, ds.Declaration.Variables.Count); 6183Assert.Equal(1, ds.Declaration.Variables.Count); 6214Assert.Equal(1, ds.Declaration.Variables.Count); 6242Assert.Equal(1, ds.Declaration.Variables.Count); 6290Assert.Equal(1, ds.Declaration.Variables.Count); 6324Assert.Equal(1, ds.Declaration.Variables.Count); 6356Assert.Equal(1, ds.Declaration.Variables.Count); 6641Assert.Equal(1, ds.Declaration.Variables.Count); 6652Assert.Equal(1, oc.Orderings.Count); 6686Assert.Equal(1, ds.Declaration.Variables.Count); 6697Assert.Equal(1, oc.Orderings.Count); 6730Assert.Equal(1, ds.Declaration.Variables.Count); 6741Assert.Equal(2, oc.Orderings.Count); 6780Assert.Equal(1, ds.Declaration.Variables.Count); 6791Assert.Equal(1, oc.Orderings.Count); 6828Assert.Equal(1, ds.Declaration.Variables.Count); 6839Assert.Equal(1, oc.Orderings.Count); 6875Assert.Equal(1, ds.Declaration.Variables.Count); 6886Assert.Equal(2, oc.Orderings.Count); 6929Assert.Equal(2, decl.Declaration.Variables.Count);
Parsing\StatementParsingTests.cs (57)
196Assert.Equal(1, ds.Declaration.Variables.Count); 226Assert.Equal(1, ds.Declaration.Variables.Count); 260Assert.Equal(2, tt.Elements.Count); 294Assert.Equal(2, tt.Elements.Count); 301Assert.Equal(3, tt.Elements.Count); 331Assert.Equal(1, ds.Declaration.Variables.Count); 357Assert.Equal(1, ds.Declaration.Variables.Count); 383Assert.Equal(1, ds.Declaration.Variables.Count); 409Assert.Equal(1, ds.Declaration.Variables.Count); 435Assert.Equal(1, ds.Declaration.Variables.Count); 461Assert.Equal(1, ds.Declaration.Variables.Count); 487Assert.Equal(1, ds.Declaration.Variables.Count); 513Assert.Equal(3, ds.Declaration.Variables.Count); 548Assert.Equal(1, ds.Declaration.Variables.Count); 578Assert.Equal(3, ds.Declaration.Variables.Count); 623Assert.Equal(1, ds.Declaration.Variables.Count); 655Assert.Equal(1, ds.Declaration.Variables.Count); 687Assert.Equal(1, ds.Declaration.Variables.Count); 719Assert.Equal(1, ds.Declaration.Variables.Count); 751Assert.Equal(1, ds.Declaration.Variables.Count); 781Assert.Equal(1, ds.Declaration.Variables.Count); 807Assert.Equal(1, ds.Declaration.Variables.Count); 838Assert.Equal(2, ds.Declaration.Variables.Count); 884Assert.Equal(1, fs.Declaration.Variables.Count); 914Assert.Equal(1, fs.Declaration.Variables.Count); 941Assert.Equal(2, fs.Declaration.Variables.Count); 1531Assert.Equal(0, fs.Initializers.Count); 1535Assert.Equal(0, fs.Incrementors.Count); 1560Assert.Equal(1, fs.Declaration.Variables.Count); 1568Assert.Equal(0, fs.Initializers.Count); 1572Assert.Equal(0, fs.Incrementors.Count); 1599Assert.Equal(1, fs.Declaration.Variables.Count); 1607Assert.Equal(0, fs.Initializers.Count); 1611Assert.Equal(0, fs.Incrementors.Count); 1636Assert.Equal(2, fs.Declaration.Variables.Count); 1652Assert.Equal(0, fs.Initializers.Count); 1656Assert.Equal(0, fs.Incrementors.Count); 1743Assert.Equal(1, fs.Initializers.Count); 1749Assert.Equal(0, fs.Incrementors.Count); 1772Assert.Equal(2, fs.Initializers.Count); 1779Assert.Equal(0, fs.Incrementors.Count); 1802Assert.Equal(0, fs.Initializers.Count); 1809Assert.Equal(0, fs.Incrementors.Count); 1832Assert.Equal(0, fs.Initializers.Count); 1837Assert.Equal(1, fs.Incrementors.Count); 1862Assert.Equal(0, fs.Initializers.Count); 1867Assert.Equal(2, fs.Incrementors.Count); 1895Assert.Equal(1, fs.Declaration.Variables.Count); 1903Assert.Equal(0, fs.Initializers.Count); 1911Assert.Equal(1, fs.Incrementors.Count); 2374Assert.Equal(1, us.Declaration.Variables.Count); 2407Assert.Equal(1, us.Declaration.Variables.Count); 2469Assert.Equal(1, us.Declaration.Variables.Count); 2504Assert.Equal(1, us.Declaration.Variables.Count); 2638Assert.Equal(1, us.Declaration.Variables.Count); 2808Assert.Equal(2, us.Declaration.Variables.Count); 2851Assert.Equal(2, us.Declaration.Variables.Count);
Syntax\SeparatedSyntaxListTests.cs (6)
242Assert.Equal(0, list.Count); 248Assert.Equal(1, newList.Count); 252Assert.Equal(2, newList.Count); 256Assert.Equal(1, newList.Count); 260Assert.Equal(2, newList.Count); 264Assert.Equal(0, newList.Count);
Syntax\SyntaxFactoryTests.cs (8)
238Assert.Equal(0, null1.Count); 244Assert.Equal(0, null2.Count); 250Assert.Equal(0, empty1.Count); 256Assert.Equal(0, empty2.Count); 262Assert.Equal(1, singleton1.Count); 268Assert.Equal(1, singleton2.Count); 274Assert.Equal(3, list1.Count); 285Assert.Equal(3, list2.Count);
Syntax\SyntaxListTests.cs (1)
293Assert.Equal(alphabet.Length, parsedArgumentList.Arguments.Count);
Syntax\SyntaxNodeTests.cs (1)
1919Assert.Equal(4, sizes.Count);
Microsoft.CodeAnalysis.CSharp.Test.Utilities (1)
FunctionPointerUtilities.cs (1)
241for (int i = 0; i < paramSyntaxes.Count - 1; i++)
Microsoft.CodeAnalysis.CSharp.Workspaces (84)
Classification\Worker_Preprocesser.cs (1)
303if (node.ErrorCodes.Count == 0)
CodeGeneration\CSharpSyntaxGenerator.cs (29)
913if (fd.Declaration.Variables.Count == 1) 1113if (list.Attributes.Count == 1) 1161if (list.Attributes.Count == 1) 1181if (list.Attributes.Count == 1) 1290if (attrList.Attributes.Count > 1) 1311if (variableDeclaration.Variables.Count > 1) 1325SyntaxKind.FieldDeclaration => ((FieldDeclarationSyntax)declaration).Declaration.Variables.Count, 1326SyntaxKind.EventFieldDeclaration => ((EventFieldDeclarationSyntax)declaration).Declaration.Variables.Count, 1327SyntaxKind.LocalDeclarationStatement => ((LocalDeclarationStatementSyntax)declaration).Declaration.Variables.Count, 1328SyntaxKind.VariableDeclaration => ((VariableDeclarationSyntax)declaration).Variables.Count, 1329SyntaxKind.AttributeList => ((AttributeListSyntax)declaration).Attributes.Count, 1891VariableDeclarationSyntax variableDeclaration when variableDeclaration.Variables.Count == 1 => variableDeclaration.Variables[0].Identifier.ValueText, 1894AttributeListSyntax attributeList when attributeList.Attributes.Count == 1 => attributeList.Attributes[0].Name.ToString(), 1911BaseFieldDeclarationSyntax fieldDeclaration when fieldDeclaration.Declaration.Variables.Count == 1 => 1921LocalDeclarationStatementSyntax localDeclaration when localDeclaration.Declaration.Variables.Count == 1 => 1926AttributeListSyntax attributeList when attributeList.Attributes.Count == 1 => 1931VariableDeclarationSyntax variableDeclaration when variableDeclaration.Variables.Count == 1 => 2006if (vd.Parent != null && vd.Variables.Count == 1) 2228if (parameters.Count == 1 && IsSimpleLambdaParameter(parameters[0])) 2381if (fd.Declaration.Variables.Count == 1) 2392if (ld.Declaration.Variables.Count == 1) 2400if (vd.Variables.Count == 1) 2421if (fd.Declaration.Variables.Count == 1) 2432if (ld.Declaration.Variables.Count == 1) 2440if (vd.Variables.Count == 1) 2671return WithBaseList(declaration, baseList.WithTypes(baseList.Types.Insert(baseList.Types.Count, SyntaxFactory.SimpleBaseType((TypeSyntax)interfaceType)))); 2981if (attr.Parent is AttributeListSyntax attrList && attrList.Attributes.Count == 1) 2990if (declaration.Parent != null && ((AttributeArgumentListSyntax)declaration.Parent).Arguments.Count == 1) 3009if (declaration.Parent is BaseListSyntax baseList && baseList.Types.Count == 1)
FindSymbols\CSharpDeclaredSymbolInfoFactoryService.cs (9)
53var builder = ArrayBuilder<string>.GetInstance(baseList.Types.Count); 197parameterCount: localFunction.ParameterList.Parameters.Count, 198typeParameterCount: localFunction.TypeParameterList?.Parameters.Count ?? 0)); 242typeParameterCount: typeDeclaration.TypeParameterList?.Parameters.Count ?? 0); 291parameterCount: ctorDecl.ParameterList?.Parameters.Count ?? 0)); 364parameterCount: method.ParameterList?.Parameters.Count ?? 0, 365typeParameterCount: method.TypeParameterList?.Parameters.Count ?? 0)); 420if (memberDeclaration is RecordDeclarationSyntax { ParameterList: { Parameters.Count: > 0 } parameterList } recordDeclaration) 737simpleTypeName = 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\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeStyle\TypeStyle\TypeStyleHelper.cs (2)
46if (tupleType.TupleElements.Length != tuple.Arguments.Count) 51for (int i = 0, n = tuple.Arguments.Count; i < n; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ParenthesizedExpressionSyntaxExtensions.cs (2)
658if (argumentIndex >= 0 && argumentIndex < argumentList.Arguments.Count - 1) 667if (expressionIndex >= 0 && expressionIndex < initializer.Expressions.Count - 1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\FormattingHelpers.cs (1)
399if (initializer.Expressions.Count <= 0)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\SpacingFormattingRule.cs (2)
569=> forStatement.Initializers.Count == 0 572&& forStatement.Incrementors.Count == 0;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SemanticFacts\CSharpSemanticFacts.cs (1)
308if (index >= 0 && (index + 1) < orderByClauseSyntax.Orderings.Count)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpAccessibilityFacts.cs (7)
205if (fd.Declaration != null && fd.Declaration.Variables.Count == 1) 217if (ef.Declaration != null && ef.Declaration.Variables.Count == 1) 229if (ld.Declaration != null && ld.Declaration.Variables.Count == 1) 242if (vd.Variables.Count == 1 && vd.Parent == null) 258if (vd == null || vd.Variables.Count > 1) 279if (list.Attributes.Count == 1) 287if (declaration.Parent is not AttributeListSyntax parentList || parentList.Attributes.Count > 1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (2)
874if (typeParameterList != null && typeParameterList.Parameters.Count > 0) 878for (var i = 1; i < typeParameterList.Parameters.Count; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (3)
212Debug.Assert(originalParams.Count == replacedParams.Count); 215for (var i = 0; i < originalParams.Count; i++)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpTypeStyleHelper.State.cs (1)
67if (variableDeclaration.Variables.Count != 1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationService.cs (2)
289var parameterCount = currentParameterList != null ? currentParameterList.Parameters.Count : 0; 454if (attributes.Count == 1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpDeclarationComparer.cs (2)
412var xParameterCount = x.Parameters.Count; 413var yParameterCount = y.Parameters.Count;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\EnumMemberGenerator.cs (2)
97if (destination.Members.Count == 0) 108if (destination.Members.Count == value &&
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeRefactorings\CSharpRefactoringHelpersService.cs (1)
101if (variables.Count == 1)
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\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\TypeDeclarationSyntaxExtensions.cs (1)
155return (EnumDeclarationSyntax)EnsureHasBraces(typeDeclaration, typeDeclaration.Members.Count > 0);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpReplaceDiscardDeclarationsWithAssignmentsService.cs (1)
232if (_currentNonDiscardVariables.Count > 0)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (7)
743var argumentCount = argumentOpt?.Parent is BaseArgumentListSyntax baseArgumentList ? baseArgumentList.Arguments.Count : -1; 1314.Where(a => a.Parameters.Length == initializerExpression.Expressions.Count) 1563var subPatternCount = positionalPart.Subpatterns.Count; 1755if (invocation.ArgumentList.Arguments.Count > 0) 1799return lambdaExpression.ParameterList.Parameters.Count == 0 2084if (armIndex < switchExpression.Arms.Count - 1) 2326if (elementTypesBuilder.Contains(null) || elementTypesBuilder.Count != arguments.Count)
Microsoft.CodeAnalysis.Features (27)
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)
ConvertToInterpolatedString\AbstractConvertPlaceholderToInterpolatedStringRefactoringProvider.cs (2)
153for (int i = 0, n = arguments.Count - 1; i < n; i++) 159var remainingArgCount = arguments.Count - i - 1;
IntroduceParameter\IntroduceParameterDocumentRewriter.cs (3)
120if (_syntaxFacts.GetVariablesOfLocalDeclarationStatement(localDeclaration).Count > 1) 503if (insertionIndex > invocationArguments.Count) 611for (var i = 0; i < arguments.Count; i++)
src\Analyzers\Core\Analyzers\UseCoalesceExpression\AbstractUseCoalesceExpressionForIfNullCheckDiagnosticAnalyzer.cs (1)
140if (declarators.Count != 1)
src\Analyzers\Core\Analyzers\UseCollectionInitializer\UpdateExpressionState.cs (6)
194if (forCollectionExpression && arguments.Count != 1) 229Contract.ThrowIfTrue(arguments.Count == 0); 248if (arguments.Count > 1) 259if (arguments.Count != 1) 284if (arguments.Count < 1) 287if (requiredArgumentName != null && arguments.Count != 1)
src\Analyzers\Core\Analyzers\ValidateFormatString\AbstractValidateFormatStringDiagnosticAnalyzer.cs (2)
229if (parameterWithMatchingName.Ordinal >= arguments.Count) 236if (parameterWithMatchingName.IsParams && parameters.Length != arguments.Count)
src\Analyzers\Core\CodeFixes\AddExplicitCast\Fixer.cs (1)
130for (var i = 0; i < arguments.Count; i++)
src\Analyzers\Core\CodeFixes\AddParameter\AbstractAddParameterCodeFixProvider.cs (2)
208if (isNamedArgument || NonParamsParameterCount(method) < arguments.Count) 442for (int i = 0, n = arguments.Count; i < n; i++)
UseNamedArguments\AbstractUseNamedArgumentsCodeRefactoringProvider.cs (1)
76var argumentCount = arguments.Count;
Wrapping\SeparatedSyntaxList\AbstractSeparatedSyntaxListWrapper.cs (1)
70if (listItems.Count <= 1)
Microsoft.CodeAnalysis.Test.Utilities (2)
Compilation\ControlFlowGraphVerifier.cs (2)
597return reference.Syntax is CSharp.Syntax.SwitchExpressionSyntax switchExpr && switchExpr.Arms.Count == 0; 981caseStmt.Cases.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 4358For i As Integer = 0 To arguments.Count - 1
Binding\Binder_Query.vb (41)
211Dim aggregationVariablesCount As Integer = aggregationVariables.Count 215Debug.Assert(aggregationVariables.Count > 0, "Malformed syntax tree.") 396If aggregationVariables.Count <= 1 Then 770Debug.Assert(variables.Count > 0, "Malformed syntax tree.") 772If variables.Count = 0 Then 788For i = If(skipFirstVariable, 1, 0) To variables.Count - 1 976Debug.Assert(variables.Count > 0, "Malformed syntax tree.") 979If variables.Count = 0 Then 1013For i = If(source Is sourceOpt, 0, 1) To variables.Count - 1 1057If i = variables.Count - 1 Then 1110(i = variables.Count - 1 AndAlso 1170Debug.Assert(i = variables.Count - 1) 1863If items.Count > 0 Then 2530If orderByOrderings.Count = 0 Then 2532Debug.Assert(orderByOrderings.Count > 0, "Malformed syntax tree.") 2544For i = 0 To orderByOrderings.Count - 1 2696If selectVariables.Count = 1 Then 2742If selectVariables.Count = 1 Then 2760ElseIf selectVariables.Count = 0 Then 2762Debug.Assert(selectVariables.Count > 0, "Malformed syntax tree.") 2767Dim selectors = New BoundExpression(selectVariables.Count - 1) {} 2769Dim rangeVariables(selectVariables.Count - 1) As RangeVariableSymbol 2771For i As Integer = 0 To selectVariables.Count - 1 2783Dim fields = New AnonymousTypeField(selectVariables.Count - 1) {} 3006Select Case aggregationVariables.Count 3009Debug.Assert(aggregationVariables.Count > 0, "Malformed syntax tree.") 3297If joinConditions.Count = 0 Then 3299Debug.Assert(joinConditions.Count > 0, "Malformed syntax tree.") 3304ElseIf joinConditions.Count = 1 Then 3328Dim outerKeys(joinConditions.Count - 1) As BoundExpression 3329Dim innerKeys(joinConditions.Count - 1) As BoundExpression 3332For i As Integer = 0 To joinConditions.Count - 1 3347Dim fields(joinConditions.Count - 1) As AnonymousTypeField 3349For i As Integer = 0 To joinConditions.Count - 1 3796Dim fieldsToReserveForAggregationVariables As Integer = Math.Max(aggregationVariables.Count, 1) 3845If aggregationVariables.Count = 0 Then 3847Debug.Assert(aggregationVariables.Count > 0, "Malformed syntax tree.") 3854For i As Integer = 0 To aggregationVariables.Count - 1 3881If aggregationVariables.Count = 0 Then 3883Debug.Assert(aggregationVariables.Count > 0, "Malformed syntax tree.") 3887Debug.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)
1524For 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)
308If 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\Analyzers\VisualBasic\Analyzers\RemoveUnusedMembers\VisualBasicRemoveUnusedMembersDiagnosticAnalyzer.vb (2)
71If declarator?.Names.Count = 1 AndAlso field?.Declarators.Count = 1 Then
src\Analyzers\VisualBasic\Analyzers\UseAutoProperty\Utilities.vb (2)
11If declarator.Names.Count > 1 Then 19If field.Declarators.Count > 1 Then
src\Analyzers\VisualBasic\Analyzers\UseCoalesceExpression\VisualBasicUseCoalesceExpressionForIfNullStatementCheckDiagnosticAnalyzer.vb (1)
29Return declarator.Names.Count = 1
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\ExpressionSyntaxExtensions.vb (1)
176While collectionInitializer.Initializers.Count > 0 AndAlso
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\InvocationExpressionSyntaxExtensions.vb (1)
13Return invocationExpression.ArgumentList IsNot Nothing AndAlso invocationExpression.ArgumentList.Arguments.Count = 0 AndAlso
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SemanticModelExtensions.vb (2)
117If variableDeclarator.Names.Count > 0 Then 132If variableDeclarator.Names.Count > 0 Then
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\StatementSyntaxExtensions.vb (1)
390Return If(list Is Nothing, 0, list.Parameters.Count)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SyntaxNodeExtensions.vb (2)
959For j = 0 To statement.ImportsClauses.Count - 1 1247If DirectCast(parent, VariableDeclaratorSyntax).Names.Count = 1 Then
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Services\SyntaxFacts\VisualBasicSyntaxFacts.vb (7)
853Return field.Declarators.Count > 0 AndAlso ContainsExclusively(GetSeparatedSyntaxListSpan(field.Declarators), span) 883Debug.Assert(list.Count > 0) 1037If typeParameterList IsNot Nothing AndAlso typeParameterList.Parameters.Count > 0 Then 1040For i = 1 To typeParameterList.Parameters.Count - 1 1675Return DirectCast(node, VariableDeclaratorSyntax).Names.Count 1679Return DirectCast(node, AttributeListSyntax).Attributes.Count 1681Return DirectCast(node, ImportsStatementSyntax).ImportsClauses.Count
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\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\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\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 (23)
src\Analyzers\VisualBasic\CodeFixes\AddExplicitCast\VisualBasicAddExplicitCastCodeFixProvider.vb (1)
119For i = 0 To arguments.Count - 1
src\Analyzers\VisualBasic\CodeFixes\GenerateDefaultConstructors\VisualBasicGenerateDefaultConstructorsService.vb (1)
44If baseList.Types.Count > 0 AndAlso
src\Analyzers\VisualBasic\CodeFixes\GenerateParameterizedMember\VisualBasicGenerateParameterizedMemberService.vb (1)
84If genericName.TypeArgumentList.Arguments.Count = 1 Then
src\Analyzers\VisualBasic\CodeFixes\UseCollectionInitializer\VisualBasicUseCollectionInitializerCodeFixProvider.vb (1)
96If arguments.Count = 1 Then
src\Analyzers\VisualBasic\CodeFixes\UseObjectInitializer\UseInitializerHelpers.vb (1)
15objectCreation.ArgumentList.Arguments.Count = 0 Then
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\VisualBasicCodeGenerationService.vb (2)
303Dim parameterCount = If(parameterList IsNot Nothing, parameterList.Parameters.Count, 0) 417If attributes.Count = 1 Then
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\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeRefactorings\VisualBasicRefactoringHelpersService.vb (2)
96If localDeclarationStatement.Declarators.Count = 1 And localDeclarationStatement.Declarators.First().Names.Count = 1 Then
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ArgumentListSyntaxExtensions.vb (1)
13Dim count = argumentList.Arguments.Count
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ObjectCreationExpressionExtensions.vb (1)
17If objectCreationExpression.ArgumentList.Arguments.Count > 0 Then
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Indentation\SpecialFormattingOperation.vb (2)
117argumentList.Arguments.Count = 0 OrElse 186If caseStatement Is Nothing OrElse caseStatement.Cases.Count = 0 Then
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\VisualBasicMoveDeclarationNearReferenceService.vb (1)
38Return variableDeclarator.Names.Count = 1
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\VisualBasicSemanticFactsService.vb (1)
146If usingStatement.Variables.Count > 0 Then
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\VisualBasicTypeInferenceService.TypeInferrer.vb (4)
607If variableDeclarator.Names.Count >= 1 Then 933If invocation.ArgumentList IsNot Nothing AndAlso invocation.ArgumentList.Arguments.Count > 0 AndAlso 959If lambda.SubOrFunctionHeader.ParameterList.Parameters.Count > 0 Then 1050Where(Function(m) m.Parameters.Length = collectionInitializer.Initializers.Count).
Microsoft.CodeAnalysis.VisualBasic.EditorFeatures (1)
EndConstructGeneration\EndConstructStatementVisitor_Properties.vb (1)
31If node.ParameterList Is Nothing OrElse node.ParameterList.Parameters.Count = 0 Then
Microsoft.CodeAnalysis.VisualBasic.Emit.UnitTests (1)
CodeGen\CodeGenTuples.vb (1)
3393Assert.Equal(literal.Arguments.Count, parts.Length)
Microsoft.CodeAnalysis.VisualBasic.Features (64)
ChangeSignature\VisualBasicChangeSignatureService.vb (4)
551argumentCount = argumentList.Arguments.Count 568If arguments.Count = 0 Then 571numSeparatorsToSkip = arguments.Count - newArguments.Length + 1 575numSeparatorsToSkip = arguments.Count - newArguments.Length
CodeFixes\Suppression\VisualBasicSuppressionCodeFixProvider.vb (2)
213Return attributeList IsNot Nothing AndAlso attributeList.Attributes.Count = 1 239hasMultipleIds = errorCodes.Count > 1
CodeRefactorings\InlineTemporary\VisualBasicInlineTemporaryCodeRefactoringProvider.vb (5)
261If localDeclaration.Declarators.Count > 1 And variableDeclarator.Names.Count = 1 Then 265If variableDeclarator.Names.Count > 1 Then 276If variableDeclarator.Names.Count > 1 OrElse 277localDeclaration.Declarators.Count > 1 Then
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)
40Return firstVariable.Names.Count = 1
Debugging\BreakpointResolver.vb (1)
65parameterCount = 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)
71If variableDeclarator.Names.Count = 1 Then 108Return variableDeclarator.Names.Count > 1 AndAlso variableDeclarator.Initializer IsNot Nothing OrElse SyntaxUtilities.HasAsNewClause(variableDeclarator) 179DirectCast(node.Parent, VariableDeclaratorSyntax).Names.Count = 1 Then 465DirectCast(modifiedIdentifier.Parent, VariableDeclaratorSyntax).Names.Count > 1 909If variableDeclarator.Names.Count > 1 Then 920If 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)
61Contract.ThrowIfFalse(statement.Declarators.Count = 1) 127If declarationStatement.Declarators.Count <> 1 Then 191declaration.Declarators.Count <> 1 OrElse 192declaration.Declarators(0).Names.Count <> 1 OrElse 228If declaration.Declarators.Count <> 1 OrElse 229declaration.Declarators(0).Names.Count <> 1 OrElse
ExtractMethod\VisualBasicMethodExtractor.VisualBasicCodeGenerator.ExpressionCodeGenerator.vb (1)
42If varDecl.Names.Count <> 1 Then
GenerateType\VisualBasicGenerateTypeService.vb (3)
280objectCreationExpressionOpt.ArgumentList.Arguments.Count = 1 AndAlso 292ElseIf objectCreationExpressionOpt.ArgumentList.Arguments.Count <> 1 Then 374Dim 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)
172If declarators.Count = 0 Then
ReplaceConditionalWithStatementsCodeRefactoringProvider\VisualBasicReplaceConditionalWithStatementsCodeRefactoringProvider.vb (2)
43If localDeclarationStatement.Declarators.Count = 1 Then 45If declarator.Names.Count = 1 Then
ReplaceMethodWithProperty\VisualBasicReplaceMethodWithPropertyService.vb (1)
203If invocationExpression.ArgumentList?.Arguments.Count <> 1 Then
src\Analyzers\VisualBasic\Analyzers\RemoveUnusedMembers\VisualBasicRemoveUnusedMembersDiagnosticAnalyzer.vb (2)
71If declarator?.Names.Count = 1 AndAlso field?.Declarators.Count = 1 Then
src\Analyzers\VisualBasic\Analyzers\UseAutoProperty\Utilities.vb (2)
11If declarator.Names.Count > 1 Then 19If field.Declarators.Count > 1 Then
src\Analyzers\VisualBasic\Analyzers\UseCoalesceExpression\VisualBasicUseCoalesceExpressionForIfNullStatementCheckDiagnosticAnalyzer.vb (1)
29Return declarator.Names.Count = 1
src\Analyzers\VisualBasic\CodeFixes\AddExplicitCast\VisualBasicAddExplicitCastCodeFixProvider.vb (1)
119For i = 0 To arguments.Count - 1
src\Analyzers\VisualBasic\CodeFixes\GenerateDefaultConstructors\VisualBasicGenerateDefaultConstructorsService.vb (1)
44If baseList.Types.Count > 0 AndAlso
src\Analyzers\VisualBasic\CodeFixes\GenerateParameterizedMember\VisualBasicGenerateParameterizedMemberService.vb (1)
84If genericName.TypeArgumentList.Arguments.Count = 1 Then
src\Analyzers\VisualBasic\CodeFixes\UseCollectionInitializer\VisualBasicUseCollectionInitializerCodeFixProvider.vb (1)
96If arguments.Count = 1 Then
src\Analyzers\VisualBasic\CodeFixes\UseObjectInitializer\UseInitializerHelpers.vb (1)
15objectCreation.ArgumentList.Arguments.Count = 0 Then
Microsoft.CodeAnalysis.VisualBasic.Syntax.UnitTests (81)
Parser\ParseDirectives.vb (34)
1621Assert.Equal(0, disableNode.ErrorCodes.Count) 1626Assert.Equal(0, enableNode.ErrorCodes.Count) 1651Assert.Equal(2, enableNode.ErrorCodes.Count) 1660Assert.Equal(2, disableNode.ErrorCodes.Count) 1737Assert.Equal(0, enableNode.ErrorCodes.Count) 1757Assert.Equal(0, disableNode.ErrorCodes.Count) 1779Assert.Equal(0, disableNode.ErrorCodes.Count) 1803Assert.Equal(0, disableNode.ErrorCodes.Count) 1825Assert.Equal(0, enableNode.ErrorCodes.Count) 1854Assert.Equal(0, disableNode.ErrorCodes.Count) 1874Assert.Equal(0, disableNode.ErrorCodes.Count) 1896Assert.Equal(0, disableNode.ErrorCodes.Count) 1915Assert.Equal(3, enableNode.ErrorCodes.Count) 1940Assert.Equal(2, enableNode.ErrorCodes.Count) 1966Assert.Equal(2, enableNode.ErrorCodes.Count) 2012Assert.Equal(2, enableNode.ErrorCodes.Count) 2041Assert.Equal(3, enableNode.ErrorCodes.Count) 2066Assert.Equal(3, enableNode.ErrorCodes.Count) 2096Assert.Equal(2, enableNode.ErrorCodes.Count) 2118Assert.Equal(2, enableNode.ErrorCodes.Count) 2144Assert.Equal(2, enableNode.ErrorCodes.Count) 2166Assert.Equal(2, enableNode.ErrorCodes.Count) 2204Assert.Equal(6, disableNode.ErrorCodes.Count) 2266Assert.Equal(4, disableNode.ErrorCodes.Count) 2298Assert.Equal(4, disableNode.ErrorCodes.Count) 2326Assert.Equal(3, disableNode.ErrorCodes.Count) 2353Assert.Equal(0, enableNode.ErrorCodes.Count) 2461Assert.Equal(1, enableNode.ErrorCodes.Count) 2485Assert.Equal(1, enableNode.ErrorCodes.Count) 2511Assert.Equal(1, enableNode.ErrorCodes.Count) 2533Assert.Equal(0, enableNode.ErrorCodes.Count) 2581Assert.Equal(3, enableNode.ErrorCodes.Count) 2602Assert.Equal(0, enableNode.ErrorCodes.Count) 2639Assert.Equal(0, disableNode.ErrorCodes.Count)
Syntax\ManualTests.vb (4)
162Assert.Equal(0, null1.Count) 174Assert.Equal(0, empty1.Count) 186Assert.Equal(1, singleton1.Count) 198Assert.Equal(3, list1.Count)
Syntax\SeparatedSyntaxListTests.vb (35)
24Assert.Equal(3, list.Count) 42Assert.Equal(4, newList.Count) 46Assert.Equal(5, newList.Count) 50Assert.Equal(4, newList.Count) 54Assert.Equal(4, newList.Count) 58Assert.Equal(4, newList.Count) 62Assert.Equal(4, newList.Count) 66Assert.Equal(5, newList.Count) 70Assert.Equal(5, newList.Count) 74Assert.Equal(5, newList.Count) 78Assert.Equal(5, newList.Count) 82Assert.Equal(2, newList.Count) 85newList = list.RemoveAt(list.Count - 1) 86Assert.Equal(2, newList.Count) 90Assert.Equal(2, newList.Count) 94Assert.Equal(2, newList.Count) 98Assert.Equal(2, newList.Count) 102Assert.Equal(3, newList.Count) 106Assert.Equal(3, newList.Count) 110Assert.Equal(3, newList.Count) 114Assert.Equal(4, newList.Count) 118Assert.Equal(4, newList.Count) 122Assert.Equal(4, newList.Count) 126Assert.Equal(2, newList.Count) 130Assert.Equal(2, newList.Count) 134Assert.Equal(2, newList.Count) 139Assert.Throws(Of ArgumentOutOfRangeException)(Function() list.Insert(list.Count + 1, nodeD)) 141Assert.Throws(Of ArgumentOutOfRangeException)(Function() list.InsertRange(list.Count + 1, {nodeD})) 143Assert.Throws(Of ArgumentOutOfRangeException)(Function() list.RemoveAt(list.Count)) 160Assert.Equal(0, list.Count) 166Assert.Equal(1, newList.Count) 170Assert.Equal(2, newList.Count) 174Assert.Equal(1, newList.Count) 178Assert.Equal(2, newList.Count) 182Assert.Equal(0, newList.Count)
Syntax\SyntaxListTests.vb (1)
217Assert.Equal(alphabet.Length, parsedArgumentList.Arguments.Count)
TestSyntaxNodes.vb (7)
569Assert.Equal(0, seplist.Count) 582Assert.Equal(0, arglist.Arguments.Count) 591Assert.Equal(1, seplist.Count) 626Assert.Equal(3, sepList.Count) 653Assert.Equal(3, sepList.Count) 1175If params.Count >= 2 Then 1182For i As Integer = 2 To params.Count - 1
Microsoft.CodeAnalysis.VisualBasic.Workspaces (94)
CodeGeneration\VisualBasicSyntaxGenerator.vb (34)
1349If fd.Declarators.Count = 1 Then 1351If vd.Initializer IsNot Nothing AndAlso vd.Names.Count = 1 Then 1784If list Is Nothing OrElse list.Attributes.Count > 1 Then 1789If list.Attributes.Count = 1 Then 1811Return p.ParameterList IsNot Nothing AndAlso p.ParameterList.Parameters.Count > 0 AndAlso p.Modifiers.Any(SyntaxKind.DefaultKeyword) 1815Return p.ParameterList IsNot Nothing AndAlso p.ParameterList.Parameters.Count > 0 AndAlso p.Modifiers.Any(SyntaxKind.DefaultKeyword) 1953If vd.Names.Count = 1 Then 1965If list.Attributes.Count = 1 Then 1971If stmt.ImportsClauses.Count = 1 Then 2025If ld.Declarators.Count = 1 AndAlso ld.Declarators(0).Names.Count = 1 Then 2030If fd.Declarators.Count = 1 AndAlso fd.Declarators(0).Names.Count = 1 Then 2037If al.Attributes.Count = 1 Then 2042If stmt.ImportsClauses.Count = 1 Then 2129If fd.Declarators.Count = 1 Then 2134If ld.Declarators.Count = 1 Then 2155If fd.Declarators.Count = 1 Then 2174If ld.Declarators.Count = 1 Then 2530Return If(typeParameterList.Parameters.Count = 0, Nothing, typeParameterList) 2625If constraints.Count = 1 Then 2627ElseIf constraints.Count > 1 Then 2808If ld.Declarators.Count = 1 Then 2813If fd.Declarators.Count = 1 Then 2829If ld.Declarators.Count = 1 Then 2834If fd.Declarators.Count = 1 Then 3215If al.Attributes.Count = 1 Then 3229If al.Attributes.Count = 1 Then 3565If vd IsNot Nothing AndAlso vd.Names.Count = 1 Then 3583If attrList IsNot Nothing AndAlso attrList.Attributes.Count = 1 Then 3590If argList.Arguments.Count = 1 Then 3598If imps.ImportsClauses.Count = 1 Then 3608If imp.Types.Count = 1 Then 3613If inh.Types.Count = 1 Then
FindSymbols\VisualBasicDeclaredSymbolInfoFactoryService.vb (8)
173typeParameterCount:=If(blockStatement.TypeParameterList?.Parameters.Count, 0)) 233parameterCount:=If(constructor.ParameterList?.Parameters.Count, 0))) 295parameterCount:=If(funcDecl.ParameterList?.Parameters.Count, 0), 296typeParameterCount:=If(funcDecl.TypeParameterList?.Parameters.Count, 0))) 377Dim parameterCount = node.ParameterList?.Parameters.Count 387If attribute.ArgumentList?.Arguments.Count > 0 Then 502If parameterList Is Nothing OrElse parameterList.Parameters.Count = 0 Then 620Dim tupleArity = DirectCast(node, TupleTypeSyntax).Elements.Count
ObsoleteSymbol\VisualBasicObsoleteSymbolService.vb (2)
31If localDeclaration.Declarators.Count <> 1 Then 41If declarator.Names.Count <> 1 Then
OrganizeImports\VisualBasicOrganizeImportsService.Rewriter.vb (1)
54If list.Count > 0 Then
Recommendations\VisualBasicRecommendationServiceRunner.vb (2)
23Return lambdaSyntax.SubOrFunctionHeader.ParameterList.Parameters.Count 72If parameters.Count > ordinalInLambda Then
Simplification\Reducers\VisualBasicExtensionMethodReducer.vb (1)
44Dim noOfArguments = argumentList.Arguments.Count
Simplification\Reducers\VisualBasicVariableDeclaratorReducer.vb (1)
68If variableDeclarator.Names.Count <> 1 Then
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\ExpressionSyntaxExtensions.vb (1)
176While collectionInitializer.Initializers.Count > 0 AndAlso
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\InvocationExpressionSyntaxExtensions.vb (1)
13Return invocationExpression.ArgumentList IsNot Nothing AndAlso invocationExpression.ArgumentList.Arguments.Count = 0 AndAlso
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SemanticModelExtensions.vb (2)
117If variableDeclarator.Names.Count > 0 Then 132If variableDeclarator.Names.Count > 0 Then
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\StatementSyntaxExtensions.vb (1)
390Return If(list Is Nothing, 0, list.Parameters.Count)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SyntaxNodeExtensions.vb (2)
959For j = 0 To statement.ImportsClauses.Count - 1 1247If DirectCast(parent, VariableDeclaratorSyntax).Names.Count = 1 Then
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Services\SyntaxFacts\VisualBasicSyntaxFacts.vb (7)
853Return field.Declarators.Count > 0 AndAlso ContainsExclusively(GetSeparatedSyntaxListSpan(field.Declarators), span) 883Debug.Assert(list.Count > 0) 1037If typeParameterList IsNot Nothing AndAlso typeParameterList.Parameters.Count > 0 Then 1040For i = 1 To typeParameterList.Parameters.Count - 1 1675Return DirectCast(node, VariableDeclaratorSyntax).Names.Count 1679Return DirectCast(node, AttributeListSyntax).Attributes.Count 1681Return DirectCast(node, ImportsStatementSyntax).ImportsClauses.Count
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\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\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\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Utilities\SpeculationAnalyzer.vb (3)
277Debug.Assert(originalParams.Count = replacedParams.Count) 284For i As Integer = 0 To originalParams.Count - 1
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\VisualBasicCodeGenerationService.vb (2)
303Dim parameterCount = If(parameterList IsNot Nothing, parameterList.Parameters.Count, 0) 417If attributes.Count = 1 Then
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\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeRefactorings\VisualBasicRefactoringHelpersService.vb (2)
96If localDeclarationStatement.Declarators.Count = 1 And localDeclarationStatement.Declarators.First().Names.Count = 1 Then
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ArgumentListSyntaxExtensions.vb (1)
13Dim count = argumentList.Arguments.Count
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ObjectCreationExpressionExtensions.vb (1)
17If objectCreationExpression.ArgumentList.Arguments.Count > 0 Then
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Indentation\SpecialFormattingOperation.vb (2)
117argumentList.Arguments.Count = 0 OrElse 186If caseStatement Is Nothing OrElse caseStatement.Cases.Count = 0 Then
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\VisualBasicMoveDeclarationNearReferenceService.vb (1)
38Return variableDeclarator.Names.Count = 1
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\VisualBasicSemanticFactsService.vb (1)
146If usingStatement.Variables.Count > 0 Then
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\VisualBasicTypeInferenceService.TypeInferrer.vb (4)
607If variableDeclarator.Names.Count >= 1 Then 933If invocation.ArgumentList IsNot Nothing AndAlso invocation.ArgumentList.Arguments.Count > 0 AndAlso 959If lambda.SubOrFunctionHeader.ParameterList.Parameters.Count > 0 Then 1050Where(Function(m) m.Parameters.Length = collectionInitializer.Initializers.Count).
Microsoft.CodeAnalysis.Workspaces (4)
Editing\SyntaxGenerator.cs (1)
1542for (; count > 0 && offset < list.Count; count--)
FindSymbols\SyntaxTree\SyntaxTreeIndex_Create.cs (1)
268if (arguments.Count != 2)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeRefactorings\AbstractRefactoringHelpersService.cs (1)
419if (variables.Count == 1)
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)
607typeDeclaration.TypeParameterList.Parameters.Count != 0) 613for (int i = 0; i < typeDeclaration.TypeParameterList.Parameters.Count; i++)
Microsoft.Interop.LibraryImportGenerator (1)
Analyzers\ConvertToLibraryImportFixer.cs (1)
351if (declaration.Declaration.Variables.Count != 1)
Microsoft.Maui.Controls.BindingSourceGen (5)
BindingSourceGenerator.cs (2)
56 && invocation.ArgumentList.Arguments.Count >= 2 66 && invocation.ArgumentList.Arguments.Count >= 1
InvocationParser.cs (2)
42 if (argumentList.Count == 0) 90 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))
Microsoft.VisualStudio.LanguageServices.CSharp (23)
CodeModel\CSharpCodeModelService.CodeModelEventCollector.cs (6)
109if (oldArguments.Count != newArguments.Count) 114for (var i = 0; i < oldArguments.Count; i++) 690if (oldTypes.Count != newTypes.Count) 695for (var i = 0; i < oldTypes.Count; i++)
CodeModel\CSharpCodeModelService.cs (16)
1608attribute.ArgumentList.Arguments.Count > index) 2755if (fieldDeclaration.Declaration.Variables.Count == 1) 2778if (memberIndex == members.Count - 1 && newMembers.Count > 0) 2794if (attributeList.Attributes.Count == 1) 3085if (attributeDeclaration.Attributes.Count > 1) 3088return index + (attributeDeclaration.Attributes.Count - indexOfAttributeInDeclaration); 3161return index + (variableDeclaration.Variables.Count - indexOfDeclaratorInField); 3237if (index > 0 && index == enumDeclaration.Members.Count) 3587methodDeclaration.ParameterList.Parameters.Count == 0) 3730? typeDeclaration.BaseList.Types.Count 3763typeDeclaration.BaseList.Types.Count == 0) 3796if (newBaseList.Types.Count == 0) 3829? typeDeclaration.BaseList.Types.Count 3858typeDeclaration.BaseList.Types.Count == 0) 3882if (newBaseList.Types.Count == 0)
CodeModel\MethodXml\MethodXmlBuilder.cs (1)
431EncodedText(arrayCreationExpression.Initializer.Expressions.Count.ToString());
Microsoft.VisualStudio.LanguageServices.VisualBasic (20)
CodeModel\MethodXML\MethodXmlBuilder.vb (1)
637EncodedText(collectionInitializer.Initializers.Count.ToString())
CodeModel\VisualBasicCodeModelService.NodeNameGenerator.vb (4)
142AppendArity(builder, typeStatement.TypeParameterList.Parameters.Count) 156AppendArity(builder, delegateStatement.TypeParameterList.Parameters.Count) 174AppendArity(builder, methodStatement.TypeParameterList.Parameters.Count) 185AppendArity(builder, methodStatement.TypeParameterList.Parameters.Count)
CodeModel\VisualBasicCodeModelService.vb (14)
1266attribute.ArgumentList.Arguments.Count > index Then 1328If declarator.Names.Count = 1 Then 1341If declaration.Declarators.Count = 1 Then 1354If attributeList.Attributes.Count = 1 Then 1600If attributeBlock.Attributes.Count > 1 Then 1602Return index + (attributeBlock.Attributes.Count - indexOfAttributeInBlock) 1641If importsStatement.ImportsClauses.Count > 1 Then 1643Return index + (importsStatement.ImportsClauses.Count - indexOfImportClauseInStatement) 1688indexOfNameInField += fieldDeclaration.Declarators(i).Names.Count 4010methodStatement.HandlesClause.Events.Count = 0 Then 4014Dim eventCount = methodStatement.HandlesClause.Events.Count 4125If methodStatement.HandlesClause.Events.Count = 1 Then 4298If inheritsStatement.Types.Count = 1 Then 4370If implementsStatement.Types.Count = 1 Then
Venus\VisualBasicContainedLanguage.vb (1)
182multiLineLambda.SubOrFunctionHeader.ParameterList.Parameters.Count <> 1 OrElse
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,