14 instantiations of ImmutableSegmentedList
Microsoft.CodeAnalysis.CodeStyle (14)
src\Dependencies\Collections\ImmutableSegmentedList`1.cs (6)
74public static readonly ImmutableSegmentedList<T> Empty = new(new SegmentedList<T>()); 146return new ImmutableSegmentedList<T>(list); 175return new ImmutableSegmentedList<T>(list); 207=> new ImmutableSegmentedList<TOutput>(_list.ConvertAll(converter)); 230=> new ImmutableSegmentedList<T>(_list.FindAll(match)); 298return new ImmutableSegmentedList<T>(self._list.GetRange(index, count));
src\Dependencies\Collections\ImmutableSegmentedList`1+PrivateMarshal.cs (4)
24return new ImmutableSegmentedList<T>(list); 33return new ImmutableSegmentedList<T>(list); 42return new ImmutableSegmentedList<T>(list); 47=> list is not null ? new ImmutableSegmentedList<T>(list) : default;
src\Dependencies\Collections\ImmutableSegmentedList`1+ValueBuilder.cs (4)
124=> new ImmutableSegmentedList<TOutput>(ReadOnlyList.ConvertAll(converter)); 142=> new ImmutableSegmentedList<T>(ReadOnlyList.FindAll(match)); 194return new ImmutableSegmentedList<T>(ReadOnlyList.GetRange(index, count)); 325_list = new ImmutableSegmentedList<T>(ReadOnlyList);
159 references to ImmutableSegmentedList
Microsoft.CodeAnalysis.CodeStyle (159)
src\Compilers\Core\Portable\Collections\ImmutableArrayExtensions.cs (1)
1345internal static int BinarySearch<TElement, TValue>(this ImmutableSegmentedList<TElement> array, TValue value, Func<TElement, TValue, int> comparer)
src\Dependencies\Collections\ImmutableSegmentedList.cs (15)
14public static ImmutableSegmentedList<T> Create<T>() 15=> ImmutableSegmentedList<T>.Empty; 18public static ImmutableSegmentedList<T> Create<T>(T item) 19=> ImmutableSegmentedList<T>.Empty.Add(item); 22public static ImmutableSegmentedList<T> Create<T>(params T[] items) 23=> ImmutableSegmentedList<T>.Empty.AddRange(items); 26public static ImmutableSegmentedList<T>.Builder CreateBuilder<T>() 27=> ImmutableSegmentedList<T>.Empty.ToBuilder(); 30public static ImmutableSegmentedList<T> CreateRange<T>(IEnumerable<T> items) 31=> ImmutableSegmentedList<T>.Empty.AddRange(items); 34public static ImmutableSegmentedList<T> ToImmutableSegmentedList<T>(this IEnumerable<T> source) 36if (source is ImmutableSegmentedList<T> existingList) 39return ImmutableSegmentedList<T>.Empty.AddRange(source); 43public static ImmutableSegmentedList<T> ToImmutableSegmentedList<T>(this ImmutableSegmentedList<T>.Builder builder)
src\Dependencies\Collections\ImmutableSegmentedList`1.cs (61)
18/// <para>There are different scenarios best for <see cref="ImmutableSegmentedList{T}"/> and others 22/// <see cref="ImmutableSegmentedList{T}"/>:</para> 27/// <description><see cref="ImmutableSegmentedList{T}"/> Complexity</description> 71internal readonly partial struct ImmutableSegmentedList<T> : IImmutableList<T>, IReadOnlyList<T>, IList<T>, IList, IEquatable<ImmutableSegmentedList<T>> 74public static readonly ImmutableSegmentedList<T> Empty = new(new SegmentedList<T>()); 112public static bool operator ==(ImmutableSegmentedList<T> left, ImmutableSegmentedList<T> right) 115public static bool operator !=(ImmutableSegmentedList<T> left, ImmutableSegmentedList<T> right) 118public static bool operator ==(ImmutableSegmentedList<T>? left, ImmutableSegmentedList<T>? right) 121public static bool operator !=(ImmutableSegmentedList<T>? left, ImmutableSegmentedList<T>? right) 127var self = this; 139public ImmutableSegmentedList<T> Add(T value) 141var self = this; 159public ImmutableSegmentedList<T> AddRange(IEnumerable<T> items) 161var self = this; 169if (items is ImmutableSegmentedList<T> immutableList) 171else if (items is ImmutableSegmentedList<T>.Builder builder) 199public ImmutableSegmentedList<T> Clear() 206public ImmutableSegmentedList<TOutput> ConvertAll<TOutput>(Converter<T, TOutput> converter) 229public ImmutableSegmentedList<T> FindAll(Predicate<T> match) 255var self = this; 270var self = this; 291public ImmutableSegmentedList<T> GetRange(int index, int count) 293var self = this; 308public ImmutableSegmentedList<T> Insert(int index, T item) 310var self = this; 323public ImmutableSegmentedList<T> InsertRange(int index, IEnumerable<T> items) 325var self = this; 339var self = this; 359public ImmutableSegmentedList<T> Remove(T value) 361var self = this; 371public ImmutableSegmentedList<T> Remove(T value, IEqualityComparer<T>? equalityComparer) 373var self = this; 383public ImmutableSegmentedList<T> RemoveAll(Predicate<T> match) 393public ImmutableSegmentedList<T> RemoveAt(int index) 402public ImmutableSegmentedList<T> RemoveRange(IEnumerable<T> items) 407var self = this; 426public ImmutableSegmentedList<T> RemoveRange(IEnumerable<T> items, IEqualityComparer<T>? equalityComparer) 431var self = this; 450public ImmutableSegmentedList<T> RemoveRange(int index, int count) 452var self = this; 466public ImmutableSegmentedList<T> Replace(T oldValue, T newValue) 468var self = this; 480public ImmutableSegmentedList<T> Replace(T oldValue, T newValue, IEqualityComparer<T>? equalityComparer) 482var self = this; 494public ImmutableSegmentedList<T> Reverse() 496var self = this; 506public ImmutableSegmentedList<T> Reverse(int index, int count) 514public ImmutableSegmentedList<T> SetItem(int index, T value) 523public ImmutableSegmentedList<T> Sort() 525var self = this; 537public ImmutableSegmentedList<T> Sort(IComparer<T>? comparer) 539var self = this; 551public ImmutableSegmentedList<T> Sort(Comparison<T> comparison) 558var self = this; 570public ImmutableSegmentedList<T> Sort(int index, int count, IComparer<T>? comparer) 590return obj is ImmutableSegmentedList<T> other 594public bool Equals(ImmutableSegmentedList<T> other)
src\Dependencies\Collections\ImmutableSegmentedList`1+Builder.cs (5)
21internal Builder(ImmutableSegmentedList<T> list) 78public ImmutableSegmentedList<TOutput> ConvertAll<TOutput>(Converter<T, TOutput> converter) 101public ImmutableSegmentedList<T> FindAll(Predicate<T> match) 141public ImmutableSegmentedList<T> GetRange(int index, int count) 217public ImmutableSegmentedList<T> ToImmutable()
src\Dependencies\Collections\ImmutableSegmentedList`1+PrivateMarshal.cs (12)
18internal static ImmutableSegmentedList<T> VolatileRead(in ImmutableSegmentedList<T> location) 27internal static ImmutableSegmentedList<T> InterlockedExchange(ref ImmutableSegmentedList<T> location, ImmutableSegmentedList<T> value) 36internal static ImmutableSegmentedList<T> InterlockedCompareExchange(ref ImmutableSegmentedList<T> location, ImmutableSegmentedList<T> value, ImmutableSegmentedList<T> comparand) 46internal static ImmutableSegmentedList<T> AsImmutableSegmentedList(SegmentedList<T>? list) 49/// <inheritdoc cref="SegmentedCollectionsMarshal.AsSegmentedList{T}(ImmutableSegmentedList{T})"/> 50internal static SegmentedList<T>? AsSegmentedList(ImmutableSegmentedList<T> list)
src\Dependencies\Collections\ImmutableSegmentedList`1+ValueBuilder.cs (7)
19private ImmutableSegmentedList<T> _list; 27internal ValueBuilder(ImmutableSegmentedList<T> list) 74var originalList = RoslynImmutableInterlocked.InterlockedExchange(ref _list, default); 123public readonly ImmutableSegmentedList<TOutput> ConvertAll<TOutput>(Converter<T, TOutput> converter) 141public readonly ImmutableSegmentedList<T> FindAll(Predicate<T> match) 189public ImmutableSegmentedList<T> GetRange(int index, int count) 323public ImmutableSegmentedList<T> ToImmutable()
src\Dependencies\Collections\ImmutableSegmentedListExtensions.cs (8)
15public static bool All<T>(this ImmutableSegmentedList<T> immutableList, Func<T, bool> predicate) 31public static bool Any<T>(this ImmutableSegmentedList<T> immutableList) 39public static bool Any<T>(this ImmutableSegmentedList<T>.Builder builder) 47public static bool Any<T>(this ImmutableSegmentedList<T> immutableList, Func<T, bool> predicate) 63public static T Last<T>(this ImmutableSegmentedList<T> immutableList) 72public static T Last<T>(this ImmutableSegmentedList<T>.Builder builder) 84public static T Last<T>(this ImmutableSegmentedList<T> immutableList, Func<T, bool> predicate) 101public static IEnumerable<TResult> Select<T, TResult>(this ImmutableSegmentedList<T> immutableList, Func<T, TResult> selector)
src\Dependencies\Collections\RoslynImmutableInterlocked.cs (26)
31public static bool Update<T>(ref ImmutableSegmentedList<T> location, Func<ImmutableSegmentedList<T>, ImmutableSegmentedList<T>> transformer) 36var oldValue = ImmutableSegmentedList<T>.PrivateMarshal.VolatileRead(in location); 39var newValue = transformer(oldValue); 46var interlockedResult = InterlockedCompareExchange(ref location, newValue, oldValue); 72public static bool Update<T, TArg>(ref ImmutableSegmentedList<T> location, Func<ImmutableSegmentedList<T>, TArg, ImmutableSegmentedList<T>> transformer, TArg transformerArgument) 77var oldValue = ImmutableSegmentedList<T>.PrivateMarshal.VolatileRead(in location); 80var newValue = transformer(oldValue, transformerArgument); 87var interlockedResult = InterlockedCompareExchange(ref location, newValue, oldValue); 103public static ImmutableSegmentedList<T> InterlockedExchange<T>(ref ImmutableSegmentedList<T> location, ImmutableSegmentedList<T> value) 105return ImmutableSegmentedList<T>.PrivateMarshal.InterlockedExchange(ref location, value); 117public static ImmutableSegmentedList<T> InterlockedCompareExchange<T>(ref ImmutableSegmentedList<T> location, ImmutableSegmentedList<T> value, ImmutableSegmentedList<T> comparand) 119return ImmutableSegmentedList<T>.PrivateMarshal.InterlockedCompareExchange(ref location, value, comparand); 131public static bool InterlockedInitialize<T>(ref ImmutableSegmentedList<T> location, ImmutableSegmentedList<T> value) 133return InterlockedCompareExchange(ref location, value, default(ImmutableSegmentedList<T>)).IsDefault;
src\Dependencies\Collections\SegmentedCollectionsMarshal.cs (16)
96/// Gets an <see cref="ImmutableSegmentedList{T}"/> value wrapping the input <see cref="SegmentedList{T}"/>. 99/// <param name="list">The input segmented list to wrap in the returned <see cref="ImmutableSegmentedList{T}"/> value.</param> 100/// <returns>An <see cref="ImmutableSegmentedList{T}"/> value wrapping <paramref name="list"/>.</returns> 104/// list, and that it won't be modified once the returned <see cref="ImmutableSegmentedList{T}"/> value starts 106/// <see cref="ImmutableSegmentedList{T}"/> values to change after its creation. 109/// If <paramref name="list"/> is <see langword="null"/>, the returned <see cref="ImmutableSegmentedList{T}"/> value 110/// will be uninitialized (i.e. its <see cref="ImmutableSegmentedList{T}.IsDefault"/> property will be 114public static ImmutableSegmentedList<T> AsImmutableSegmentedList<T>(SegmentedList<T>? list) 115=> ImmutableSegmentedList<T>.PrivateMarshal.AsImmutableSegmentedList(list); 118/// Gets the underlying <see cref="SegmentedList{T}"/> for an input <see cref="ImmutableSegmentedList{T}"/> value. 120/// <typeparam name="T">The type of elements in the input <see cref="ImmutableSegmentedList{T}"/> value.</typeparam> 121/// <param name="list">The input <see cref="ImmutableSegmentedList{T}"/> value to get the underlying <see cref="SegmentedList{T}"/> from.</param> 127/// don't expect the contents of the <see cref="ImmutableSegmentedList{T}"/> value to change. 130/// If <paramref name="list"/> is uninitialized (i.e. its <see cref="ImmutableSegmentedList{T}.IsDefault"/> property is 134public static SegmentedList<T>? AsSegmentedList<T>(ImmutableSegmentedList<T> list) 135=> ImmutableSegmentedList<T>.PrivateMarshal.AsSegmentedList(list);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\AbstractVirtualCharService.cs (4)
192protected static int ConvertTextAtIndexToRune(string tokenText, int index, ImmutableSegmentedList<VirtualChar>.Builder result, int offset) 195protected static int ConvertTextAtIndexToRune(SourceText tokenText, int index, ImmutableSegmentedList<VirtualChar>.Builder result, int offset) 199T tokenText, int index, TTextInfo info, ImmutableSegmentedList<VirtualChar>.Builder result, int offset) 232ImmutableSegmentedList<VirtualChar>.Builder result)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\VirtualCharSequence.Chunks.cs (2)
33/// Thin wrapper over an actual <see cref="ImmutableSegmentedList{T}"/>. 37private sealed class ImmutableSegmentedListChunk(ImmutableSegmentedList<VirtualChar> array) : Chunk
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\VirtualCharSequence.cs (2)
30public static readonly VirtualCharSequence Empty = Create(ImmutableSegmentedList<VirtualChar>.Empty); 32public static VirtualCharSequence Create(ImmutableSegmentedList<VirtualChar> virtualChars)