12 instantiations of SegmentedList
Microsoft.CodeAnalysis.Workspaces (12)
src\Dependencies\Collections\ImmutableSegmentedList`1.cs (3)
74public static readonly ImmutableSegmentedList<T> Empty = new(new SegmentedList<T>()); 145var list = new SegmentedList<T> { value }; 174var list = new SegmentedList<T>(items);
src\Dependencies\Collections\ImmutableSegmentedList`1+ValueBuilder.cs (2)
78_mutableList = new SegmentedList<T>(originalList._list); 110_mutableList = new SegmentedList<T>();
src\Dependencies\Collections\RoslynEnumerable.cs (1)
18return new SegmentedList<TSource>(source);
src\Dependencies\Collections\SegmentedList`1.cs (4)
436var list = new SegmentedList<TOutput>(_size); 598var list = new SegmentedList<T>(); 742return LazyInitializer.EnsureInitialized(ref s_emptyEnumerator, static () => new Enumerator(new SegmentedList<T>(0)))!; 762var list = new SegmentedList<T>(count);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TokenStream.cs (1)
62_tokens = new SegmentedList<SyntaxToken>(sizeOfList);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\ObjectReader.ReaderReferenceMap.cs (1)
21= new(() => new SegmentedList<string>(20));
181 references to SegmentedList
IdeBenchmarks (1)
RegexClassifierBenchmarks.cs (1)
86using var _ = Classifier.GetPooledList(out var results);
IdeCoreBenchmarks (1)
ClassificationBenchmarks.cs (1)
88using var _ = Classifier.GetPooledList(out var result);
Microsoft.CodeAnalysis.EditorFeatures (5)
Classification\CopyPasteAndPrintingClassificationBufferTaggerProvider.Tagger.cs (1)
192using var _ = Classifier.GetPooledList(out var tempBuffer);
Classification\Semantic\AbstractSemanticOrEmbeddedClassificationViewTaggerProvider.cs (1)
230using var _ = Classifier.GetPooledList(out var classifiedSpans);
Classification\Syntactic\SyntacticClassificationTaggerProvider.TagComputer.cs (3)
421using var _ = Classifier.GetPooledList(out var classifiedSpans); 484using var _ = Classifier.GetPooledList(out var tempList); 537using var _ = Classifier.GetPooledList(out var tempList);
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (2)
Classification\AbstractClassifierTests.cs (2)
273using var _ = Classifier.GetPooledList(out var result); 284using var _ = Classifier.GetPooledList(out var results);
Microsoft.CodeAnalysis.Features (1)
FindUsages\IRemoteFindUsagesService.cs (1)
263using var _ = Classifier.GetPooledList(out var temp);
Microsoft.CodeAnalysis.LanguageServer.Protocol (2)
Handler\SemanticTokens\SemanticTokensHelpers.cs (2)
91using var _1 = Classifier.GetPooledList(out var classifiedSpans); 92using var _2 = Classifier.GetPooledList(out var updatedClassifiedSpans);
Microsoft.CodeAnalysis.Remote.ServiceHub (3)
Services\SemanticClassification\RemoteSemanticClassificationService.Caching.cs (2)
93using var _ = Classifier.GetPooledList(out var temp); 147using var _2 = Classifier.GetPooledList(out var classifiedSpans);
Services\SemanticClassification\RemoteSemanticClassificationService.cs (1)
41using var _ = Classifier.GetPooledList(out var temp);
Microsoft.CodeAnalysis.Workspaces (164)
Classification\AbstractClassificationService.cs (8)
31public abstract void AddLexicalClassifications(SourceText text, TextSpan textSpan, SegmentedList<ClassifiedSpan> result, CancellationToken cancellationToken); 35Document document, ImmutableArray<TextSpan> textSpans, ClassificationOptions options, SegmentedList<ClassifiedSpan> result, CancellationToken cancellationToken) 41Document document, ImmutableArray<TextSpan> textSpans, ClassificationOptions options, SegmentedList<ClassifiedSpan> result, CancellationToken cancellationToken) 51SegmentedList<ClassifiedSpan> result, 113SegmentedList<ClassifiedSpan> result, 142SegmentedList<ClassifiedSpan> result, 202public async Task AddSyntacticClassificationsAsync(Document document, ImmutableArray<TextSpan> textSpans, SegmentedList<ClassifiedSpan> result, CancellationToken cancellationToken) 209SolutionServices services, SyntaxNode? root, ImmutableArray<TextSpan> textSpans, SegmentedList<ClassifiedSpan> result, CancellationToken cancellationToken)
Classification\ClassificationServiceExtensions.cs (4)
20SegmentedList<ClassifiedSpan> result, 30SegmentedList<ClassifiedSpan> result, 41SegmentedList<ClassifiedSpan> result, 52SegmentedList<ClassifiedSpan> result,
Classification\Classifier.cs (4)
24internal static PooledObject<SegmentedList<ClassifiedSpan>> GetPooledList(out SegmentedList<ClassifiedSpan> classifiedSpans) 87using var _1 = GetPooledList(out var syntacticClassifications); 88using var _2 = GetPooledList(out var semanticClassifications);
Classification\ClassifierHelper.cs (21)
70using var _1 = Classifier.GetPooledList(out var syntaxSpans); 71using var _2 = Classifier.GetPooledList(out var semanticSpans); 97private static void RemoveAdditiveSpans(SegmentedList<ClassifiedSpan> spans) 108SegmentedList<ClassifiedSpan> syntaxSpans, 109SegmentedList<ClassifiedSpan> semanticSpans, 133using var _1 = Classifier.GetPooledList(out var mergedSpans); 140using var _2 = Classifier.GetPooledList(out var filledInSpans); 147private static void Order(SegmentedList<ClassifiedSpan> syntaxSpans) 155private static void AdjustSpans(SegmentedList<ClassifiedSpan> spans, TextSpan widenedSpan) 187int startPosition, SegmentedList<ClassifiedSpan> classifiedSpans, SegmentedList<ClassifiedSpan> result) 218SegmentedList<ClassifiedSpan> syntaxParts, 219SegmentedList<ClassifiedSpan> semanticParts, 220SegmentedList<ClassifiedSpan> finalParts) 231/// <inheritdoc cref="MergeParts(SegmentedList{ClassifiedSpan}, SegmentedList{ClassifiedSpan}, SegmentedList{ClassifiedSpan})"/> 233SegmentedList<TClassifiedSpan> syntaxParts, 234SegmentedList<TClassifiedSpan> semanticParts, 235SegmentedList<TClassifiedSpan> finalParts, 242using var _1 = SegmentedListPool.GetPooledList<TClassifiedSpan>(out var semanticSpans);
Classification\EmbeddedLanguageClassificationServiceExtensions.cs (1)
21SegmentedList<ClassifiedSpan> result,
Classification\IClassificationService.cs (5)
28void AddLexicalClassifications(SourceText text, TextSpan textSpan, SegmentedList<ClassifiedSpan> result, CancellationToken cancellationToken); 34void AddSyntacticClassifications(SolutionServices services, SyntaxNode? root, ImmutableArray<TextSpan> textSpans, SegmentedList<ClassifiedSpan> result, CancellationToken cancellationToken); 46Task AddSyntacticClassificationsAsync(Document document, ImmutableArray<TextSpan> textSpans, SegmentedList<ClassifiedSpan> result, CancellationToken cancellationToken); 63Task AddSemanticClassificationsAsync(Document document, ImmutableArray<TextSpan> textSpans, ClassificationOptions options, SegmentedList<ClassifiedSpan> result, CancellationToken cancellationToken); 74Task AddEmbeddedLanguageClassificationsAsync(Document document, ImmutableArray<TextSpan> textSpans, ClassificationOptions options, SegmentedList<ClassifiedSpan> result, CancellationToken cancellationToken);
Classification\IEmbeddedLanguageClassificationService.cs (2)
20SegmentedList<ClassifiedSpan> result, 29SegmentedList<ClassifiedSpan> result,
Classification\IRemoteSemanticClassificationService.cs (2)
72internal static SerializableClassifiedSpans Dehydrate(SegmentedList<ClassifiedSpan> classifiedSpans) 99internal void Rehydrate(SegmentedList<ClassifiedSpan> classifiedSpans)
Classification\SyntaxClassification\AbstractNameSyntaxClassifier.cs (1)
32SegmentedList<ClassifiedSpan> result)
Classification\SyntaxClassification\AbstractSyntaxClassificationService.cs (4)
19public abstract void AddLexicalClassifications(SourceText text, TextSpan textSpan, SegmentedList<ClassifiedSpan> result, CancellationToken cancellationToken); 20public abstract void AddSyntacticClassifications(SyntaxNode root, ImmutableArray<TextSpan> textSpans, SegmentedList<ClassifiedSpan> result, CancellationToken cancellationToken); 32SegmentedList<ClassifiedSpan> result, 53SegmentedList<ClassifiedSpan> result,
Classification\SyntaxClassification\AbstractSyntaxClassificationService.Worker.cs (7)
23private readonly SegmentedList<ClassifiedSpan> _list; 31private static readonly ObjectPool<SegmentedList<ClassifiedSpan>> s_listPool = new(() => []); 37SegmentedList<ClassifiedSpan> list, 59SegmentedList<ClassifiedSpan> list, 126var list = obj.Object; 138private void AddClassifications(SegmentedList<ClassifiedSpan> classifications) 155var list = obj.Object;
Classification\SyntaxClassification\AbstractSyntaxClassifier.cs (2)
22public virtual void AddClassifications(SyntaxNode syntax, TextSpan textSpan, SemanticModel semanticModel, ClassificationOptions options, SegmentedList<ClassifiedSpan> result, CancellationToken cancellationToken) 26public virtual void AddClassifications(SyntaxToken syntax, TextSpan textSpan, SemanticModel semanticModel, ClassificationOptions options, SegmentedList<ClassifiedSpan> result, CancellationToken cancellationToken)
Classification\SyntaxClassification\ISyntaxClassificationService.cs (4)
23SegmentedList<ClassifiedSpan> result, 30SegmentedList<ClassifiedSpan> result, 40SegmentedList<ClassifiedSpan> result, 49SegmentedList<ClassifiedSpan> result,
Classification\SyntaxClassification\ISyntaxClassifier.cs (2)
29void AddClassifications(SyntaxNode node, TextSpan textSpan, SemanticModel semanticModel, ClassificationOptions options, SegmentedList<ClassifiedSpan> result, CancellationToken cancellationToken); 34void AddClassifications(SyntaxToken token, TextSpan textSpan, SemanticModel semanticModel, ClassificationOptions options, SegmentedList<ClassifiedSpan> result, CancellationToken cancellationToken);
Classification\SyntaxClassification\SyntaxClassificationExtensions.cs (3)
21SegmentedList<ClassifiedSpan> result, 34SegmentedList<ClassifiedSpan> result, 53SegmentedList<ClassifiedSpan> result,
src\Dependencies\Collections\ImmutableSegmentedList`1.cs (4)
76private readonly SegmentedList<T> _list; 78private ImmutableSegmentedList(SegmentedList<T> list) 145var list = new SegmentedList<T> { value }; 174var list = new SegmentedList<T>(items);
src\Dependencies\Collections\ImmutableSegmentedList`1+Enumerator.cs (3)
14private readonly SegmentedList<T> _list; 15private SegmentedList<T>.Enumerator _enumerator; 17internal Enumerator(SegmentedList<T> list)
src\Dependencies\Collections\ImmutableSegmentedList`1+PrivateMarshal.cs (6)
20var list = Volatile.Read(ref Unsafe.AsRef(in location._list)); 29var list = Interlocked.Exchange(ref Unsafe.AsRef(in location._list), value._list); 38var list = Interlocked.CompareExchange(ref Unsafe.AsRef(in location._list), value._list, comparand._list); 45/// <inheritdoc cref="SegmentedCollectionsMarshal.AsImmutableSegmentedList{T}(SegmentedList{T}?)"/> 46internal static ImmutableSegmentedList<T> AsImmutableSegmentedList(SegmentedList<T>? list) 50internal static SegmentedList<T>? AsSegmentedList(ImmutableSegmentedList<T> list)
src\Dependencies\Collections\ImmutableSegmentedList`1+ValueBuilder.cs (3)
25private SegmentedList<T>? _mutableList; 35private readonly SegmentedList<T> ReadOnlyList => _mutableList ?? _list._list; 70private SegmentedList<T> GetOrCreateMutableList()
src\Dependencies\Collections\RoslynEnumerable.cs (1)
13public static SegmentedList<TSource> ToSegmentedList<TSource>(this IEnumerable<TSource> source)
src\Dependencies\Collections\SegmentedCollectionsMarshal.cs (7)
96/// Gets an <see cref="ImmutableSegmentedList{T}"/> value wrapping the input <see cref="SegmentedList{T}"/>. 114public static ImmutableSegmentedList<T> AsImmutableSegmentedList<T>(SegmentedList<T>? list) 118/// Gets the underlying <see cref="SegmentedList{T}"/> for an input <see cref="ImmutableSegmentedList{T}"/> value. 121/// <param name="list">The input <see cref="ImmutableSegmentedList{T}"/> value to get the underlying <see cref="SegmentedList{T}"/> from.</param> 122/// <returns>The underlying <see cref="SegmentedList{T}"/> for <paramref name="list"/>, if present; otherwise, <see langword="null"/>.</returns> 131/// <see langword="true"/>), the resulting <see cref="SegmentedList{T}"/> will be <see langword="null"/>. 134public static SegmentedList<T>? AsSegmentedList<T>(ImmutableSegmentedList<T> list)
src\Dependencies\Collections\SegmentedList`1.cs (18)
78if (collection is SegmentedList<T> segmentedList) 312if (c is SegmentedList<T> list) 429public SegmentedList<TOutput> ConvertAll<TOutput>(Converter<T, TOutput> converter) 436var list = new SegmentedList<TOutput>(_size); 591public SegmentedList<T> FindAll(Predicate<T> match) 598var list = new SegmentedList<T>(); 745public SegmentedList<T> GetRange(int index, int count) 762var list = new SegmentedList<T>(count); 769/// Creates a shallow copy of a range of elements in the source <see cref="SegmentedList{T}" />. 771/// <param name="start">The zero-based <see cref="SegmentedList{T}" /> index at which the range starts.</param> 773/// <returns>A shallow copy of a range of elements in the source <see cref="SegmentedList{T}" />.</returns> 779/// <exception cref="ArgumentException"><paramref name="start" /> and <paramref name="length" /> do not denote a valid range of elements in the <see cref="SegmentedList{T}" />.</exception> 780public SegmentedList<T> Slice(int start, int length) => GetRange(start, length); 924else if (c is SegmentedList<T> list) 1319private readonly SegmentedList<T> _list; 1324internal Enumerator(SegmentedList<T> list) 1338var localList = _list; 1390internal readonly struct TestAccessor(SegmentedList<T> instance)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Collections\ImmutableIntervalTree`1.cs (3)
55public static ImmutableIntervalTree<T> CreateFromUnsorted<TIntrospector>(in TIntrospector introspector, SegmentedList<T> values) 74public static ImmutableIntervalTree<T> CreateFromSorted<TIntrospector>(in TIntrospector introspector, SegmentedList<T> values) 97SegmentedList<T> source, int sourceStartInclusive, int sourceEndExclusive, SegmentedArray<Node> destination, int destinationIndex)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.cs (2)
122SegmentedList<IndentBlockOperation> operations, 275SegmentedList<SuppressOperation> operations,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormatEngine.cs (8)
36private static readonly ObjectPool<SegmentedList<TokenPairWithOperations>> s_tokenPairListPool = new(() => [], trimOnFree: false); 189private static void AddOperations<T>(SegmentedList<T> operations, List<T> scratch, SyntaxNode node, Action<List<T>, SyntaxNode> addOperations) 203private static void AddOperations<T>(SegmentedList<T> operations, ArrayBuilder<T> scratch, SyntaxNode node, Action<ArrayBuilder<T>, SyntaxNode> addOperations) 219SegmentedList<TokenPairWithOperations> list, 246SegmentedList<TokenPairWithOperations> tokenOperations, 355var alignmentOperations = nodeOperationsCollector.AlignmentOperation; 374SegmentedList<TokenPairWithOperations> tokenOperations, 429SegmentedList<TokenPairWithOperations> tokenOperations,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\NodeOperations.cs (8)
17private static readonly ObjectPool<SegmentedList<IndentBlockOperation>> s_indentBlockOperationPool = new(() => []); 18private static readonly ObjectPool<SegmentedList<SuppressOperation>> s_suppressOperationPool = new(() => []); 19private static readonly ObjectPool<SegmentedList<AlignTokensOperation>> s_alignTokensOperationPool = new(() => []); 20private static readonly ObjectPool<SegmentedList<AnchorIndentationOperation>> s_anchorIndentationOperationPool = new(() => []); 24public SegmentedList<IndentBlockOperation> IndentBlockOperation { get; } = s_indentBlockOperationPool.Allocate(); 25public SegmentedList<SuppressOperation> SuppressOperation { get; } = s_suppressOperationPool.Allocate(); 26public SegmentedList<AlignTokensOperation> AlignmentOperation { get; } = s_alignTokensOperationPool.Allocate(); 27public SegmentedList<AnchorIndentationOperation> AnchorIndentationOperations { get; } = s_anchorIndentationOperationPool.Allocate();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TokenStream.cs (1)
30private readonly SegmentedList<SyntaxToken> _tokens;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TokenStream.Iterator.cs (3)
13public readonly struct Iterator(SegmentedList<SyntaxToken> tokensIncludingZeroWidth) 20private readonly SegmentedList<SyntaxToken> _tokensIncludingZeroWidth; 26public Enumerator(SegmentedList<SyntaxToken> tokensIncludingZeroWidth)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\ObjectPools\Extensions.cs (12)
43public static PooledObject<SegmentedList<TItem>> GetPooledObject<TItem>(this ObjectPool<SegmentedList<TItem>> pool) 44=> PooledObject<SegmentedList<TItem>>.Create(pool); 60public static PooledObject<SegmentedList<TItem>> GetPooledObject<TItem>(this ObjectPool<SegmentedList<TItem>> pool, out SegmentedList<TItem> list) 62var pooledObject = PooledObject<SegmentedList<TItem>>.Create(pool); 158public static SegmentedList<T> AllocateAndClear<T>(this ObjectPool<SegmentedList<T>> pool) 160var list = pool.Allocate(); 336public static void ClearAndFree<T>(this ObjectPool<SegmentedList<T>> pool, SegmentedList<T> list, bool trim = true)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\ObjectPools\PooledObject.cs (7)
98public static PooledObject<SegmentedList<TItem>> Create<TItem>(ObjectPool<SegmentedList<TItem>> pool) 100return new PooledObject<SegmentedList<TItem>>( 153private static SegmentedList<TItem> Allocator<TItem>(ObjectPool<SegmentedList<TItem>> pool) 156private static void Releaser<TItem>(ObjectPool<SegmentedList<TItem>> pool, SegmentedList<TItem> obj)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\ObjectReader.ReaderReferenceMap.cs (3)
18private readonly SegmentedList<string> _values; 20private static readonly ObjectPool<SegmentedList<string>> s_objectListPool 23private ReaderReferenceMap(SegmentedList<string> values)
Utilities\SegmentedListPool.cs (5)
11internal static PooledObject<SegmentedList<T>> GetPooledList<T>(out SegmentedList<T> classifiedSpans) 13var pooledObject = new PooledObject<SegmentedList<T>>( 14SharedPools.BigDefault<SegmentedList<T>>(), 17var result = p.Allocate();
Microsoft.VisualStudio.LanguageServices (2)
Venus\ContainedDocument.DocumentServiceProvider.cs (2)
186using var _1 = Classifier.GetPooledList(out var list); 230using var _2 = Classifier.GetPooledList(out var builder);