17 instantiations of CollectionMatch
Microsoft.CodeAnalysis.CodeStyle (6)
src\Analyzers\Core\Analyzers\UseCollectionInitializer\AbstractUseCollectionInitializerAnalyzer.cs (2)
189return new(expressionStatement, UseSpread: false); 199return new(expressionStatement, UseSpread: false);
src\Analyzers\Core\Analyzers\UseCollectionInitializer\UpdateExpressionState.cs (4)
356return new(expressionStatement, useSpread); 389return new(foreachStatement, UseSpread: true, needsCast); 426? new(ifStatement, UseSpread: true) 442return new(ifStatement, UseSpread: false);
Microsoft.CodeAnalysis.CSharp.CodeStyle (5)
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForFluentDiagnosticAnalyzer.cs (3)
309postMatchesInReverse.Add(new CollectionMatch<ArgumentSyntax>( 319postMatchesInReverse.Add(new CollectionMatch<ArgumentSyntax>(Argument(expression), UseSpread: true)); 364matchesInReverse.Add(new(arguments[i], useSpread));
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (1)
893matches.Add(new(expressionStatement, UseSpread: false));
src\Analyzers\CSharp\Analyzers\UseCollectionInitializer\CSharpUseCollectionInitializerAnalyzer.cs (1)
79preMatches.Add(new(argumentList.Arguments[0].Expression, UseSpread: true));
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (6)
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForBuilderCodeFixProvider.cs (1)
100analysisResult.Matches.SelectAsArray(m => new CollectionMatch<SyntaxNode>(root.GetCurrentNode(m.Node)!, m.UseSpread)),
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForCreateCodeFixProvider.cs (1)
66var matches = expressions.SelectAsArray(e => new CollectionMatch<ExpressionSyntax>(e, useSpread));
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForFluentCodeFixProvider.cs (3)
123result.Add(new(spreadElement.Expression, UseSpread: true)); 127result.Add(new(expressionElement.Expression, UseSpread: false)); 133result.Add(new(argument.Expression, match.UseSpread));
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForNewCodeFixProvider.cs (1)
67var matches = expressions.SelectAsArray(e => new CollectionMatch<ExpressionSyntax>(e, useSpread));
64 references to CollectionMatch
Microsoft.CodeAnalysis.CodeStyle (17)
src\Analyzers\Core\Analyzers\UseCollectionInitializer\AbstractUseCollectionInitializerAnalyzer.cs (7)
31CollectionMatch<SyntaxNode>, TAnalyzer> 56ArrayBuilder<CollectionMatch<SyntaxNode>> preMatches, 57ArrayBuilder<CollectionMatch<SyntaxNode>> postMatches, 108ArrayBuilder<CollectionMatch<SyntaxNode>> preMatches, 109ArrayBuilder<CollectionMatch<SyntaxNode>> postMatches, 159private CollectionMatch<SyntaxNode>? TryAnalyzeStatement( 167private CollectionMatch<SyntaxNode>? TryAnalyzeStatementForCollectionInitializer(
src\Analyzers\Core\Analyzers\UseCollectionInitializer\AbstractUseCollectionInitializerDiagnosticAnalyzer.cs (5)
83ImmutableArray<CollectionMatch<SyntaxNode>> preMatches, 202(ImmutableArray<CollectionMatch<SyntaxNode>> matches, bool shouldUseCollectionExpression, bool changesSemantics)? GetCollectionInitializerMatches() 219(ImmutableArray<CollectionMatch<SyntaxNode>> matches, bool shouldUseCollectionExpression, bool changesSemantics)? GetCollectionExpressionMatches() 245ImmutableArray<CollectionMatch<SyntaxNode>> matches, 251foreach (var match in matches)
src\Analyzers\Core\Analyzers\UseCollectionInitializer\UpdateExpressionState.cs (4)
330public CollectionMatch<SyntaxNode>? TryAnalyzeStatementForCollectionExpression( 348CollectionMatch<SyntaxNode>? TryAnalyzeExpressionStatement(TStatementSyntax expressionStatement) 362CollectionMatch<SyntaxNode>? TryAnalyzeForeachStatement( 395CollectionMatch<SyntaxNode>? TryAnalyzeIfStatement(TStatementSyntax ifStatement)
src\Analyzers\Core\Analyzers\UseCollectionInitializer\UseCollectionInitializerHelpers.cs (1)
24CollectionMatch<SyntaxNode> matchInfo)
Microsoft.CodeAnalysis.CodeStyle.Fixes (3)
src\Analyzers\Core\CodeFixes\UseCollectionInitializer\AbstractUseCollectionInitializerCodeFixProvider.cs (3)
57ImmutableArray<CollectionMatch<SyntaxNode>> preMatches, 58ImmutableArray<CollectionMatch<SyntaxNode>> postMatches, CancellationToken cancellationToken); 92foreach (var match in postMatches)
Microsoft.CodeAnalysis.CSharp.CodeStyle (22)
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForArrayDiagnosticAnalyzer.cs (2)
61public static ImmutableArray<CollectionMatch<StatementSyntax>> TryGetMatches( 118public static ImmutableArray<CollectionMatch<StatementSyntax>> TryGetMatches(
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForBuilderDiagnosticAnalyzer.cs (3)
80foreach (var statementMatch in analysisResult.Matches) 162using var _ = ArrayBuilder<CollectionMatch<SyntaxNode>>.GetInstance(out var matches); 252ImmutableArray<CollectionMatch<SyntaxNode>> Matches,
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForFluentDiagnosticAnalyzer.cs (8)
125using var _1 = ArrayBuilder<CollectionMatch<ArgumentSyntax>>.GetInstance(out var preMatchesInReverse); 126using var _2 = ArrayBuilder<CollectionMatch<ArgumentSyntax>>.GetInstance(out var postMatchesInReverse); 151ArrayBuilder<CollectionMatch<ArgumentSyntax>>? preMatchesInReverse, 152ArrayBuilder<CollectionMatch<ArgumentSyntax>>? postMatchesInReverse, 354ArrayBuilder<CollectionMatch<ArgumentSyntax>>? matchesInReverse, 378ArrayBuilder<CollectionMatch<ArgumentSyntax>>? matchesInReverse, 465ImmutableArray<CollectionMatch<ArgumentSyntax>> PreMatches, 466ImmutableArray<CollectionMatch<ArgumentSyntax>> PostMatches,
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForStackAllocDiagnosticAnalyzer.cs (1)
123public static ImmutableArray<CollectionMatch<StatementSyntax>> TryGetMatches(
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (2)
788public static ImmutableArray<CollectionMatch<StatementSyntax>> TryGetMatches<TArrayCreationExpressionSyntax>( 809using var _ = ArrayBuilder<CollectionMatch<StatementSyntax>>.GetInstance(out var matches);
src\Analyzers\CSharp\Analyzers\UseCollectionInitializer\CSharpUseCollectionInitializerAnalyzer.cs (3)
49ArrayBuilder<CollectionMatch<SyntaxNode>> preMatches, 50ArrayBuilder<CollectionMatch<SyntaxNode>> postMatches, 98foreach (var match in postMatches)
src\Analyzers\CSharp\Analyzers\UseCollectionInitializer\CSharpUseCollectionInitializerDiagnosticAnalyzer.cs (3)
54ImmutableArray<CollectionMatch<SyntaxNode>> preMatches, 67static IEnumerable<CollectionElementSyntax> GetMatchElements(ImmutableArray<CollectionMatch<SyntaxNode>> preMatches) 69foreach (var match in preMatches)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (22)
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpCollectionExpressionRewriter.cs (6)
38ImmutableArray<CollectionMatch<TMatchNode>> preMatches, 39ImmutableArray<CollectionMatch<TMatchNode>> postMatches, 195CollectionExpressionSyntax CreateSingleElementCollection(CollectionMatch<TMatchNode> match) 343ImmutableArray<CollectionMatch<TMatchNode>> matches, 458CollectionMatch<TMatchNode> match, string? preferredIndentation) 766bool CheckForMultiLine(ImmutableArray<CollectionMatch<TMatchNode>> matches)
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForArrayCodeFixProvider.cs (2)
90foreach (var match in matches) 99ImmutableArray<CollectionMatch<StatementSyntax>> GetMatches(
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForFluentCodeFixProvider.cs (5)
103static ImmutableArray<CollectionMatch<ExpressionSyntax>> CreateMatches( 105ImmutableArray<CollectionMatch<ArgumentSyntax>> matches, 108using var result = TemporaryArray<CollectionMatch<ExpressionSyntax>>.Empty; 112var match = matches[i]; 142ImmutableArray<CollectionMatch<ArgumentSyntax>> matches,
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForStackAllocCodeFixProvider.cs (2)
67foreach (var match in matches) 72ImmutableArray<CollectionMatch<StatementSyntax>> GetMatches()
src\Analyzers\CSharp\CodeFixes\UseCollectionInitializer\CSharpUseCollectionInitializerCodeFixProvider.cs (2)
41ImmutableArray<CollectionMatch<SyntaxNode>> preMatches, 42ImmutableArray<CollectionMatch<SyntaxNode>> postMatches,
src\Analyzers\CSharp\CodeFixes\UseCollectionInitializer\CSharpUseCollectionInitializerCodeFixProvider_CollectionExpression.cs (2)
23ImmutableArray<CollectionMatch<SyntaxNode>> preMatches, 24ImmutableArray<CollectionMatch<SyntaxNode>> postMatches,
src\Analyzers\CSharp\CodeFixes\UseCollectionInitializer\CSharpUseCollectionInitializerCodeFixProvider_CollectionInitializer.cs (3)
26ImmutableArray<CollectionMatch<SyntaxNode>> matches) 38UseInitializerHelpers.AddExistingItems<CollectionMatch<SyntaxNode>, ExpressionSyntax>( 43var match = matches[i];