src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (24)
158using var _2 = ArrayBuilder<(SyntaxTrivia pragma, ImmutableArray<string> ids, bool isDisable)>.GetInstance(out var sortedPragmasWithIds);
230ArrayBuilder<(SyntaxTrivia pragma, ImmutableArray<string> ids, bool isDisable)> sortedPragmasWithIds,
239using var _ = ArrayBuilder<string>.GetInstance(out var idsBuilder);
370using var _1 = ArrayBuilder<string>.GetInstance(out var idBuilder);
371using var _2 = ArrayBuilder<string>.GetInstance(out var categoryBuilder);
398using var _1 = ArrayBuilder<DiagnosticAnalyzer>.GetInstance(out var analyzersBuilder);
399using var _2 = ArrayBuilder<string>.GetInstance(out var unhandledIds);
450using var _3 = ArrayBuilder<Diagnostic>.GetInstance(out var reportedDiagnostics);
483static void AddAllDiagnostics(ImmutableDictionary<DiagnosticAnalyzer, ImmutableArray<Diagnostic>> diagnostics, ArrayBuilder<Diagnostic> reportedDiagnostics)
491static void AddAllCompilationDiagnosticsForTree(AnalysisResult analysisResult, SyntaxTree tree, ArrayBuilder<Diagnostic> reportedDiagnostics)
610ArrayBuilder<(SyntaxTrivia pragma, ImmutableArray<string> ids, bool isDisable)> sortedPragmasWithIds,
616using var _ = ArrayBuilder<Diagnostic>.GetInstance(out var diagnosticsBuilder);
630ArrayBuilder<Diagnostic> diagnosticsBuilder,
632ArrayBuilder<(SyntaxTrivia pragma, ImmutableArray<string> ids, bool isDisable)> sortedPragmasWithIds,
662ArrayBuilder<Diagnostic> diagnosticsBuilder,
679ArrayBuilder<(SyntaxTrivia pragma, ImmutableArray<string> ids, bool isDisable)> sortedPragmasWithIds,
src\Compilers\Core\Portable\Collections\ArrayBuilderExtensions.cs (24)
15public static bool Any<T>(this ArrayBuilder<T> builder, Func<T, bool> predicate)
27public static bool Any<T, A>(this ArrayBuilder<T> builder, Func<T, A, bool> predicate, A arg)
39public static bool All<T>(this ArrayBuilder<T> builder, Func<T, bool> predicate)
51public static bool All<T, A>(this ArrayBuilder<T> builder, Func<T, A, bool> predicate, A arg)
71public static ImmutableArray<TResult> SelectAsArray<TItem, TResult>(this ArrayBuilder<TItem> items, Func<TItem, TResult> map)
91var builder = ArrayBuilder<TResult>.GetInstance(items.Count);
111public static ImmutableArray<TResult> SelectAsArray<TItem, TArg, TResult>(this ArrayBuilder<TItem> items, Func<TItem, TArg, TResult> map, TArg arg)
131var builder = ArrayBuilder<TResult>.GetInstance(items.Count);
151public static ImmutableArray<TResult> SelectAsArrayWithIndex<TItem, TArg, TResult>(this ArrayBuilder<TItem> items, Func<TItem, int, TArg, TResult> map, TArg arg)
171var builder = ArrayBuilder<TResult>.GetInstance(items.Count);
181public static void AddOptional<T>(this ArrayBuilder<T> builder, T? item)
193public static void Push<T>(this ArrayBuilder<T> builder, T e)
198public static T Pop<T>(this ArrayBuilder<T> builder)
205public static bool TryPop<T>(this ArrayBuilder<T> builder, [MaybeNullWhen(false)] out T result)
217public static T Peek<T>(this ArrayBuilder<T> builder)
222public static ImmutableArray<T> ToImmutableOrEmptyAndFree<T>(this ArrayBuilder<T>? builder)
227public static void AddIfNotNull<T>(this ArrayBuilder<T> builder, T? value)
236public static void AddIfNotNull<T>(this ArrayBuilder<T> builder, T? value)
245public static void FreeAll<T>(this ArrayBuilder<T> builder, Func<T, ArrayBuilder<T>?> getNested)
275public static void RemoveWhere<TItem, TArg>(this ArrayBuilder<TItem> builder, Func<TItem, int, TArg, bool> filter, TArg arg)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\TriviaEngine\AbstractTriviaFormatter.cs (21)
41private delegate LineColumnDelta Formatter<T>(LineColumn lineColumn, SyntaxTrivia trivia, ArrayBuilder<T> changes, CancellationToken cancellationToken);
46private delegate void WhitespaceAppender<T>(LineColumn lineColumn, LineColumnDelta delta, TextSpan span, ArrayBuilder<T> changes);
185protected abstract LineColumnDelta Format(LineColumn lineColumn, SyntaxTrivia trivia, ArrayBuilder<SyntaxTrivia> changes, CancellationToken cancellationToken);
190protected abstract LineColumnDelta Format(LineColumn lineColumn, SyntaxTrivia trivia, ArrayBuilder<TextChange> changes, CancellationToken cancellationToken);
240using var _ = ArrayBuilder<SyntaxTrivia>.GetInstance(out var triviaList);
260private static void AddRange(ArrayBuilder<SyntaxTrivia> result, SyntaxTriviaList triviaList)
268using var _ = ArrayBuilder<TextChange>.GetInstance(out var changes);
284private LineColumn FormatTrivia<T>(Formatter<T> formatter, WhitespaceAppender<T> whitespaceAdder, ArrayBuilder<T> changes, CancellationToken cancellationToken)
378ArrayBuilder<T> changes,
625private void AddExtraLines(int linesBetweenTokens, ArrayBuilder<SyntaxTrivia> changes)
629using var _ = ArrayBuilder<SyntaxTrivia>.GetInstance(out var lineBreaks);
642private int GetInsertionIndex(ArrayBuilder<SyntaxTrivia> changes)
675private void AddExtraLines(int linesBetweenTokens, ArrayBuilder<TextChange> changes)
713private bool TryGetMatchingChangeIndex(ArrayBuilder<TextChange> changes, out int index)
731private TextSpan GetInsertionSpan(ArrayBuilder<TextChange> changes)
758ArrayBuilder<SyntaxTrivia> changes)
767ArrayBuilder<SyntaxTrivia> changes)
826private void AddWhitespaceTextChange(LineColumn lineColumn, LineColumnDelta delta, TextSpan span, ArrayBuilder<TextChange> changes)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IDictionaryExtensions.cs (6)
76public static void MultiAdd<TKey, TValue>(this IDictionary<TKey, ArrayBuilder<TValue>> dictionary, TKey key, TValue value)
79if (!dictionary.TryGetValue(key, out var builder))
81builder = ArrayBuilder<TValue>.GetInstance();
88public static void MultiAddRange<TKey, TValue>(this IDictionary<TKey, ArrayBuilder<TValue>> dictionary, TKey key, IEnumerable<TValue> values)
91if (!dictionary.TryGetValue(key, out var builder))
93builder = ArrayBuilder<TValue>.GetInstance();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\PooledBuilderExtensions.cs (10)
29public static Dictionary<K, ImmutableArray<V>> ToMultiDictionaryAndFree<K, V>(this PooledDictionary<K, ArrayBuilder<V>> builders)
43public static ImmutableDictionary<K, ImmutableArray<V>> ToImmutableMultiDictionaryAndFree<K, V>(this PooledDictionary<K, ArrayBuilder<V>> builders)
57public static void FreeValues<K, V>(this IReadOnlyDictionary<K, ArrayBuilder<V>> builders)
66public static ImmutableArray<T> ToFlattenedImmutableArrayAndFree<T>(this ArrayBuilder<ArrayBuilder<T>> builders)
80var result = ArrayBuilder<T>.GetInstance(builders.Sum(b => b.Count));
82foreach (var builder in builders)
96public static bool HasDuplicates<T>(this ArrayBuilder<T> builder)
99public static bool HasDuplicates<T, U>(this ArrayBuilder<T> builder, Func<T, U> selector)