Implemented interface member:
6 writes to Count
Microsoft.CodeAnalysis.Features (3)
ConvertIfToSwitch\AbstractConvertIfToSwitchCodeRefactoringProvider.Analyzer.cs (1)
312guards.Count = guardCount;
CustomDebugInfoReader.cs (1)
266flagsBuilder.Count = flagCount;
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (1)
2164segments.Count = firstSegmentIndex;
Microsoft.CodeAnalysis.Workspaces (3)
FindSymbols\SymbolTree\SymbolTreeInfo.cs (3)
281tmp.Count = unsortedNodes.Length; 292ranking.Count = unsortedNodes.Length; 297result.Count = unsortedNodes.Length;
232 references to Count
Microsoft.CodeAnalysis.CSharp.Features (15)
AddImport\CSharpAddImportFeatureService.cs (1)
376if (newImports.Count == 0)
CodeRefactorings\UseRecursivePatterns\UseRecursivePatternsCodeRefactoringProvider.cs (2)
440for (leftIndex = leftNames.Count - 1, rightIndex = rightNames.Count - 1; leftIndex > 0 && rightIndex > 0; leftIndex--, rightIndex--)
ConsecutiveBracePlacementDiagnosticAnalyzer.cs (1)
53while (stack.Count > 0)
ConvertProgram\ConvertProgramTransform_TopLevelStatements.cs (1)
215if (statements.Count > 0)
ConvertToRawString\ConvertRegularStringToRawStringCodeRefactoringProvider.cs (5)
390while (lines.Count > 0 && AllWhitespace(lines.First())) 393while (lines.Count > 0 && AllWhitespace(lines.Last())) 394lines.RemoveAt(lines.Count - 1); 396if (lines.Count == 0) 435for (var i = 1; i < lines.Count; i++)
CSharpIsAndCastCheckDiagnosticAnalyzer.cs (1)
207while (stack.Count > 0)
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (1)
806while (stack.Count > 0)
UseExplicitTypeCodeFixProvider.cs (1)
201var separatorBuilder = ArrayBuilder<SyntaxToken>.GetInstance(builder.Count - 1, SyntaxFactory.Token(leading: default, SyntaxKind.CommaToken, trailing: default));
UseInitializerHelpers.cs (1)
41if (nodesAndTokens.Count % 2 == 1)
UseSimpleUsingStatementCodeFixProvider.cs (1)
102for (int i = 0, n = result.Count; i < n; i++)
Microsoft.CodeAnalysis.CSharp.Workspaces (9)
CodeGeneration\CSharpSyntaxGenerator.cs (1)
696var baseTypeList = baseTypes.Count > 0 ? SyntaxFactory.BaseList(SyntaxFactory.SeparatedList(baseTypes)) : null;
CSharpCodeGenerationService.cs (1)
744if (newModifierTokens.Count == 0)
CSharpReplaceDiscardDeclarationsWithAssignmentsService.cs (3)
183if (_statementsBuilder.Count == 0) 197var last = _statementsBuilder.Count - 1; 205if (_statementsBuilder.Count > 1)
CSharpTypeInferenceService.TypeInferrer.cs (2)
800return matchingRefParameters.Count > 0 2384if (elementTypesBuilder.Contains(null) || elementTypesBuilder.Count != arguments.Count)
CSharpVirtualCharService.cs (2)
297for (var i = 0; i < charResults.Count;) 310if (i + 1 < charResults.Count)
Microsoft.CodeAnalysis.EditorFeatures (4)
Classification\Semantic\ClassificationUtilities.cs (1)
40var result = new List<ITagSpan<IClassificationTag>>(capacity: classifiedSpans.Count);
Classification\Syntactic\SyntacticClassificationTaggerProvider.TagComputer.LastLineCache.cs (1)
65if (classifications.Count < MaxClassificationNumber)
CommentSelection\CommentUncommentSelectionCommandHandler.cs (1)
297if (textChanges.Count == 0)
Host\IStreamingFindReferencesPresenter.cs (1)
100if (builder.Count == 0)
Microsoft.CodeAnalysis.EditorFeatures.DiagnosticsTests.Utilities (1)
CodeActions\AbstractCodeActionTest.cs (1)
118var result = actions.Count > 0 ? new CodeRefactoring(provider, actions.ToImmutable(), FixAllProviderInfo.Create(provider), codeActionOptionsProvider) : null;
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (1)
BracePairs\AbstractBracePairsTests.cs (1)
41Assert.Equal(expected.Count, bracePairs.Count);
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (1)
Diagnostics\DiagnosticAnalyzerServiceTests.cs (1)
949Assert.Equal(2, diagnostics.Count);
Microsoft.CodeAnalysis.Features (86)
AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (3)
275if (idsBuilder.Count == 0) 458if (analyzersBuilder.Count > 0) 684for (var i = indexOfPragma + incrementOrDecrement; i >= 0 && i < sortedPragmasWithIds.Count; i += incrementOrDecrement)
AddImport\AbstractAddImportFeatureService.cs (5)
209if (allSymbolReferences.Count >= maxResults) 245if (allSymbolReferences.Count > 0) 339if (allSymbolReferences.Count >= maxResults) 448allSymbolReferences.AddRange(proposedReferences.Take(maxResults - allSymbolReferences.Count)); 583if (result.Count >= maxResults)
AddImport\SymbolReferenceFinder_PackageAssemblySearch.cs (3)
22if (allReferences.Count > 0) 105isAttributeSearch, result, weight: allReferences.Count, 130weight: allReferences.Count);
BracePairs\IBracePairsService.cs (1)
53while (stack.Count > 0)
ChangeSignature\AbstractChangeSignatureService.cs (3)
898if (fullList.Count == separators.Count && separators.Count != 0)
CodeFixes\Configuration\ConfigureCodeStyle\ConfigureCodeStyleOptionCodeFixProvider.cs (3)
89if (nestedActions.Count != 0) 92var resultCodeAction = nestedActions.Count > 1 130if (nestedActions.Count > 0)
CodeFixes\Configuration\ConfigureSeverity\ConfigureSeverityLevelCodeFixProvider.cs (1)
91if (analyzerDiagnostics.Count > 0)
CodeFixes\Suppression\AbstractSuppressionBatchFixAllProvider.cs (2)
104progressTracker.AddItems(documentsToFix.Count); 209while (builder.Count > 0)
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.cs (1)
236if (nestedActions.Count > 0)
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.PragmaWarningBatchFixAllProvider.cs (1)
57if (pragmaActionsBuilder.Count > 0)
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.RemoveSuppressionCodeAction.BatchFixer.cs (1)
74if (pragmaActionsBuilder.Count > 0)
CodeRefactorings\CodeRefactoringService.cs (1)
198if (actions.Count == 0)
CodeRefactorings\MoveType\AbstractMoveTypeService.cs (1)
161Debug.Assert(actions.Count != 0, "No code actions found for MoveType Refactoring");
ConvertIfToSwitch\AbstractConvertIfToSwitchCodeRefactoringProvider.Analyzer.cs (1)
306var guardCount = guards.Count;
ConvertToInterpolatedString\AbstractConvertConcatenationToInterpolatedStringRefactoringProvider.cs (2)
83if (stringLiterals.Length == pieces.Count) 132using var _ = ArrayBuilder<SyntaxNode>.GetInstance(pieces.Count, out var content);
CustomDebugInfoReader.cs (3)
255Debug.Assert(flagsBuilder.Count == 0); 264if (flagCount < flagsBuilder.Count) 450Debug.Assert(groupBuilder.Count == 0);
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (13)
663var hasRudeEdits = diagnostics.Count > 0; 867if (diagnostics.Count == 0) 1024lambda.ActiveNodeIndices!.Add(activeNodes.Count); 1344if (diagnostics.Count == 0) 1399if (lambdaBodyMatches == null || currentLambdaBodyMatch == lambdaBodyMatches.Count) 2032var firstSegmentIndex = segments.Count; 2168if (segments.Count == 0) 2200if (documentLineEdits.Count > 0) 2220if (documentLineEdits.Count > 0 && segment.oldStartLine > previousOldEndLine + 1) 2240if (currentDocumentPath != null && documentLineEdits.Count > 0) 3588indices.Add(builder.Count); 3617if (deletedTypes.TryGetValue((newType.Name, newType.Arity), out var deletedTypeIndices) && deletedTypeIndices.Count > 0) 4363if (changedAttributes.Count == 0)
EditAndContinue\EditSession.cs (5)
382if (changedOrAddedDocuments is { Count: > 0 }) 734if (edits.Count == mergedEditsBuilder.Count) 842log.Write("Found {0} potentially changed document(s) in project '{1}'", changedOrAddedDocuments.Count, newProject.Id); 1083if (isBlocked || deltas.Count > 0) 1092(deltas.Count > 0) ? ModuleUpdateStatus.Ready : ModuleUpdateStatus.None,
EmbeddedLanguages\Classification\AbstractEmbeddedLanguageClassificationService.cs (2)
139var count = _result.Count; 141return _result.Count != count;
EmbeddedLanguages\DateAndTime\DateAndTimeEmbeddedCompletionProvider.cs (1)
105if (items.Count == 0)
EmbeddedLanguages\DateAndTime\EmbeddedCompletionContext.cs (1)
135examples.Count == 1 ? FeaturesResources.Example : FeaturesResources.Examples);
EmbeddedLanguages\RegularExpressions\RegexParser.cs (6)
273if (isConditional && builder.Count >= 3) 294var last = builder.Count == 0 ? null : builder.Last(); 311for (var index = 0; index < list.Count;) 342for (; index < list.Count; index++) 1245if (_currentToken.Kind == RegexKind.CloseBracketToken && builder.Count > 0) 1275var left = ParseSingleCharacterClassComponent(isFirst: components.Count == 0, afterRangeMinus: false);
EmbeddedLanguages\StackFrame\StackFrameParser.cs (1)
386if (builder.Count == 0)
ExtractClass\ExtractClassWithDialogCodeAction.cs (3)
167if (remainingResults.Count == 0) 177using var _3 = ArrayBuilder<ExtractClassMemberAnalysisResult>.GetInstance(remainingResults.Count, out var resultsToRemove); 216Contract.ThrowIfFalse(remainingResults.Count == 0);
ExtractMethod\MethodExtractor.CodeGenerator.cs (1)
192if (variables.Count <= 0)
FullyQualify\AbstractFullyQualifyService.cs (1)
106if (fixes.Count == 0)
GenerateComparisonOperators\GenerateComparisonOperatorsCodeRefactoringProvider.cs (2)
91if (missingComparableTypes.Count == 0) 94if (missingComparableTypes.Count == 1)
GenerateMember\GenerateVariable\AbstractGenerateVariableService.cs (1)
80if (actions.Count > 1)
GenerateType\AbstractGenerateTypeService.cs (1)
231for (var i = 0; i < names.Count; i++)
GenerateType\AbstractGenerateTypeService.GenerateNamedType.cs (1)
219if (!(parameters.Count == 0 && options is { TypeKind: TypeKind.Struct }))
InitializeParameter\AbstractInitializeMemberFromParameterCodeRefactoringProviderMemberCreation.cs (1)
815if (accessors.Count == 0)
InitializeParameter\AbstractInitializeParameterCodeRefactoringProvider.cs (1)
123if (listOfPotentiallyValidParametersNodes.Count > 1)
InlineHints\AbstractInlineParameterNameHintsService.cs (4)
77if (buffer.Count > 0) 124if (parameterHints.Count <= 1) 136for (var i = 1; i < parameterHints.Count; i++) 154for (var i = 1; i < parameterHints.Count; i++)
MetadataAsSource\AbstractMetadataAsSourceService.DocCommentFormatter.cs (1)
158formattedCommentLinesBuilder.RemoveAt(formattedCommentLinesBuilder.Count - 1);
QuickInfo\QuickInfoUtilities.cs (1)
130if (usageTextBuilder.Count > 0)
Rename\SymbolicRenameInfo.cs (1)
251if (documentSpans.Count == 0)
Workspace\CompileTimeSolutionProvider.cs (2)
110if (configIdsToRemove.Count > 0) 248if (result.Count == compileTimeDocumentIds.Length)
Wrapping\ChainedExpression\AbstractChainedExpressionWrapper.cs (4)
180chunks.Add(GetSubRange(pieces, currentChunkStart, end: pieces.Count)); 200for (var i = index; i < pieces.Count; i++) 219=> index < pieces.Count && 225=> index < pieces.Count &&
Microsoft.CodeAnalysis.LanguageServer.Protocol (11)
Features\CodeFixes\CodeFixService.cs (1)
643return newApplicableDiagnostics.Count == applicableDiagnostics.Length
Features\Diagnostics\DiagnosticService.cs (2)
241Debug.Assert(buffer.Count is 0 or 1); 243if (buffer.Count == 1)
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.IncrementalMemberEditAnalyzer.cs (3)
104if (spanBasedAnalyzers.Count == 0 && (!compilerAnalyzerData.HasValue || !compilerAnalyzerData.Value.spanBased)) 148if (analyzersAndExistingData.Count == 0) 160if (analyzersAndExistingData.Count == 0)
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer_IncrementalAnalyzer.cs (2)
87if (nonCachedStateSets.Count > 0) 171if (analyzedStateSetsBuilder.Count > 0)
Features\UnifiedSuggestions\UnifiedSuggestedActionsSource.cs (3)
309if (bulkConfigurationActions.Count > 0) 321if (suppressionSets.Count > 0) 794return actions.Count == 0
Microsoft.CodeAnalysis.Remote.ServiceHub (3)
Services\SemanticClassification\RemoteSemanticClassificationService.Caching.cs (3)
167seenClassificationTypes.Add(classificationType, classificationTypes.Count); 172writer.WriteInt32(classificationTypes.Count); 183writer.WriteInt32(classifiedSpans.Count);
Microsoft.CodeAnalysis.VisualBasic.Features (2)
EditAndContinue\VisualBasicEditAndContinueAnalyzer.vb (1)
827While stack.Count > 0
UseInitializerHelpers.vb (1)
37If nodesAndTokens.Count Mod 2 = 1 Then
Microsoft.CodeAnalysis.VisualBasic.Workspaces (3)
CodeCleanup\VisualBasicCodeCleanerService.vb (1)
79If result.Count > 0 AndAlso result.Last.Contains(nodeOrToken.Span) Then
CodeGeneration\FieldGenerator.vb (1)
126If tokens.Count = 0 Then
CodeGeneration\VisualBasicCodeGenerationService.vb (1)
654If newModifierTokens.Count = 0 Then
Microsoft.CodeAnalysis.Workspaces (90)
AbstractCodeGenerationService.cs (2)
559if (newModifierTokens.Count == 0) 586for (var i = newModifierTokens.Count - 1; i >= 0; i--)
AbstractTriviaFormatter.cs (7)
637for (var i = lineBreaks.Count - 1; i >= 0; i--) 647changes.Count == 0) 653for (var i = changes.Count - 1; i >= 0; i--) 663for (var i = changes.Count - 1; i >= 0; i--) 682if (changes.Count == 0) 718for (var i = 0; i < changes.Count; i++) 736changes.Count == 0)
ArrayBuilder.Enumerator.cs (1)
34return _index < _builder.Count;
ArrayBuilderExtensions.cs (10)
72switch (items.Count) 90var builder = ArrayBuilder<TResult>.GetInstance(items.Count); 112switch (items.Count) 130var builder = ArrayBuilder<TResult>.GetInstance(items.Count); 152switch (items.Count) 170var builder = ArrayBuilder<TResult>.GetInstance(items.Count); 173builder.Add(map(item, builder.Count, arg)); 200builder.RemoveAt(builder.Count - 1); 206if (builder.Count > 0) 218return builder[builder.Count - 1];
Classification\ClassifierHelper.cs (2)
73for (var i = spans.Count - 1; i >= 0; i--) 131for (var i = 0; i < spans.Count; i++)
CodeFixes\FixAllOccurrences\BatchFixAllProvider.cs (1)
238while (builder.Count > 0)
CustomDataFlowAnalysis.cs (3)
60Debug.Assert(unreachableBlocksToVisit.Count == 0); 103for (index = 0; index < unreachableBlocksToVisit.Count; index++) 198while (toVisit.Count != 0 || unreachableBlocksToVisit.Count != 0);
Editing\ImportAdderService.cs (1)
147if (nodesToSimplify.Count == 0)
FindSymbols\Declarations\DeclarationFinder_AllDeclarations.cs (1)
135if (buffer.Count == 0)
FindSymbols\SymbolTree\SymbolTreeInfo.cs (2)
282for (var i = 0; i < tmp.Count; i++) 293for (var i = 0; i < tmp.Count; i++)
FindSymbols\SymbolTree\SymbolTreeInfo_Metadata.cs (1)
748var childIndex = unsortedNodes.Count;
FindSymbols\SymbolTree\SymbolTreeInfo_Source.cs (1)
156var nodeIndex = list.Count;
J\s\src\Compilers\Core\Portable\Collections\ImmutableArrayExtensions.cs\ImmutableArrayExtensions.cs (2)
644var result = (builder.Count == array.Length) ? array : builder.ToImmutable(); 697if (comparer != null && builder.Count > 1)
J\s\src\Dependencies\PooledObjects\ArrayBuilder.cs\ArrayBuilder.cs (25)
32var result = new T[_builder.Count]; 78if (Count == 0) 82else if (_builder.Capacity == Count) 185=> FindIndex(0, this.Count, match); 188=> FindIndex(startIndex, this.Count - startIndex, match); 205=> FindIndex(0, Count, match, arg); 208=> FindIndex(startIndex, Count - startIndex, match, arg); 276=> Count == 0 ? default : Last(); 293if (Count == 0) 307if (Count == 0) 312var tmp = ArrayBuilder<U>.GetInstance(Count); 329if (Count == 0) 333else if (_builder.Capacity == Count) 373if (this.Count != 0) 394Debug.Assert(builder.Count == 0); 450if (this.Count == 1) 458if (this.Count == 0) 465var accumulator = new Dictionary<K, ArrayBuilder<T>>(Count, comparer); 466for (var i = 0; i < Count; i++) 511Debug.Assert(start + length <= items.Count); 570Debug.Assert(limit <= Count); 593for (var i = 0; i < Count; i++) 608if (Count <= 1) 616for (int i = 1; i < Count; i++) 630var result = ArrayBuilder<S>.GetInstance(Count);
LanguageServices\DeclaredSymbolFactoryService\AbstractDeclaredSymbolInfoFactoryService.cs (4)
146for (int i = 0, n = builder.Count; i < n; i++) 264var count = declaredSymbolInfos.Count; 275if (declaredSymbolInfos.Count != count && 332var declaredSymbolInfoIndex = declaredSymbolInfos.Count - 1;
NameGenerator.cs (4)
97for (var i = 0; i < names.Count; i++) 102if (canUse(name) && collisionIndices.Count < 2) 122for (var i = 0; i < collisionIndices.Count; i++) 153for (int i = 0, n = names.Count; i < n; i++)
NamingStyle.cs (2)
223if (violations.Count > 0) 279if (violations.Count > 0)
OneOrMany.cs (2)
119if (builder.Count == 0) 125return builder.Count == Count ? this : new OneOrMany<T>(builder.ToImmutableAndFree());
OrderPreservingMultiDictionary.cs (1)
278internal int Count => (_value as ArrayBuilder<V>)?.Count ?? 1;
PathUtilities.cs (1)
815else if (resolvedParts.Count > 0)
PatternMatching\CamelCaseResult.cs (1)
30Debug.Assert(matchedSpansInReverse == null || matchedSpansInReverse.Count == matchCount);
PatternMatching\PatternMatcher.cs (1)
506var matchCount = matchSpans.Count;
PooledBuilderExtensions.cs (3)
69if (builders.Count == 0) 74if (builders.Count == 1) 79var result = ArrayBuilder<T>.GetInstance(builders.Sum(b => b.Count));
ReassignedVariable\AbstractReassignedVariableService.cs (2)
59while (stack.Count > 0) 239while (stack.Count != 0)
SetWithInsertionOrder.cs (1)
84public int Count => _elements?.Count ?? 0;
SymbolKey.cs (2)
250if (symbols.Builder.Count == 0) 255else if (symbols.Builder.Count == 1)
SymbolKey.PooledArrayBuilder.cs (1)
21public int Count => Builder.Count;
SyntaxNodeExtensions.cs (3)
245while (commonAncestorsStack.Count > 0 && 252if (commonAncestorsStack.Count == 0) 267return commonAncestorsStack.Count == 0 ? null : commonAncestorsStack.Peek();
TemporaryArray`1.cs (1)
91public readonly int Count => _builder?.Count ?? _count;
TextChangeRangeExtensions.cs (1)
384if (builder.Count > 0)
Workspace\ProjectSystem\ProjectSystemProject.BatchingDocumentCollection.cs (1)
414if (documentsToChange.Count == 0)
Microsoft.VisualStudio.LanguageServices (5)
FindReferences\Contexts\WithoutReferencesFindUsagesContext.cs (1)
114if (entries.Count > 0)
InheritanceMargin\InheritanceMarginTag.cs (1)
52for (var i = 1; i < allItems.Count; i++)
Preview\PreviewEngine.cs (1)
150_topLevelChange.Children = builder.Count == 0 ? ChangeList.Empty : new ChangeList(builder.ToArray());
ProjectSystem\MetadataReferences\VisualStudioMetadataReferenceManager.cs (1)
343if (moduleBuilder.Count == 0)
Venus\ContainedDocument.DocumentServiceProvider.cs (1)
235if (builder.Count == 0)
Microsoft.VisualStudio.LanguageServices.Implementation (1)
SolutionExplorer\AnalyzersCommandHandler.cs (1)
410if (notificationMessages.Count > 0)