14 instantiations of ImmutableSegmentedList
Microsoft.CodeAnalysis.Workspaces (14)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1.cs (6)
76
public static readonly ImmutableSegmentedList<T> Empty =
new
(new SegmentedList<T>());
148
return new
ImmutableSegmentedList
<T>(list);
177
return new
ImmutableSegmentedList
<T>(list);
209
=> new
ImmutableSegmentedList
<TOutput>(_list.ConvertAll(converter));
232
=> new
ImmutableSegmentedList
<T>(_list.FindAll(match));
300
return new
ImmutableSegmentedList
<T>(self._list.GetRange(index, count));
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+PrivateMarshal.cs (4)
26
return new
ImmutableSegmentedList
<T>(list);
35
return new
ImmutableSegmentedList
<T>(list);
44
return new
ImmutableSegmentedList
<T>(list);
49
=> list is not null ? new
ImmutableSegmentedList
<T>(list) : default;
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+ValueBuilder.cs (4)
126
=> new
ImmutableSegmentedList
<TOutput>(ReadOnlyList.ConvertAll(converter));
144
=> new
ImmutableSegmentedList
<T>(ReadOnlyList.FindAll(match));
196
return new
ImmutableSegmentedList
<T>(ReadOnlyList.GetRange(index, count));
327
_list = new
ImmutableSegmentedList
<T>(ReadOnlyList);
194 references to ImmutableSegmentedList
Microsoft.CodeAnalysis.CSharp.Features (1)
ConvertToRawString\ConvertRegularStringToRawStringCodeRefactoringProvider.cs (1)
293
private static void AddRange(
ImmutableSegmentedList
<VirtualChar>.Builder result, VirtualCharSequence sequence)
Microsoft.CodeAnalysis.CSharp.Workspaces (2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\EmbeddedLanguages\VirtualChars\CSharpVirtualCharService.cs (2)
25
private static readonly ObjectPool<
ImmutableSegmentedList
<VirtualChar>.Builder> s_pooledBuilders = new(() => ImmutableSegmentedList.CreateBuilder<VirtualChar>());
305
private static void ConvertCharactersToRunes(ArrayBuilder<(char ch, TextSpan span)> charResults,
ImmutableSegmentedList
<VirtualChar>.Builder runeResults)
Microsoft.CodeAnalysis.Features (8)
Completion\CompletionService.ProviderManager.cs (1)
84
private ValueTask ProcessBatchAsync(
ImmutableSegmentedList
<IReadOnlyList<AnalyzerReference>> referencesList, CancellationToken cancellationToken)
Completion\Providers\CompletionUtilities.cs (1)
28
public static ImmutableArray<Project> GetDistinctProjectsFromLatestSolutionSnapshot(
ImmutableSegmentedList
<Project> projects)
Completion\Providers\ImportCompletionProvider\AbstractImportCompletionCacheServiceFactory.cs (2)
18
Func<
ImmutableSegmentedList
<Project>, CancellationToken, ValueTask> processBatchAsync,
25
private readonly Func<
ImmutableSegmentedList
<Project>, CancellationToken, ValueTask> _processBatchAsync = processBatchAsync;
Completion\Providers\ImportCompletionProvider\AbstractTypeImportCompletionService.cs (1)
157
public static async ValueTask BatchUpdateCacheAsync(
ImmutableSegmentedList
<Project> projects, CancellationToken cancellationToken)
Completion\Providers\ImportCompletionProvider\ExtensionMethodImportCompletionHelper.cs (1)
117
public static async ValueTask BatchUpdateCacheAsync(
ImmutableSegmentedList
<Project> projects, CancellationToken cancellationToken)
ExternalAccess\UnitTesting\Notification\AbstractGlobalOperationNotificationService.cs (1)
48
private ValueTask ProcessEventsAsync(
ImmutableSegmentedList
<bool> list, CancellationToken cancellationToken)
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.cs (1)
73
private async ValueTask ProcessWorkQueueAsync(
ImmutableSegmentedList
<Func<Task>> list, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.LanguageServer (1)
HostWorkspace\LanguageServerProjectLoader.cs (1)
136
private async ValueTask ReloadProjectsAsync(
ImmutableSegmentedList
<ProjectToLoad> projectPathsToLoadOrReload, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.LanguageServer.Protocol (2)
Handler\AbstractRefreshQueue.cs (1)
110
ImmutableSegmentedList
<DocumentUri?> documentUris,
Handler\References\FindUsagesLSPContext.cs (1)
371
private ValueTask ReportReferencesAsync(
ImmutableSegmentedList
<SumType<VSInternalReferenceItem, LSP.Location>> referencesToReport, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.Remote.ServiceHub (1)
Services\SemanticClassification\RemoteSemanticClassificationService.Caching.cs (1)
105
ImmutableSegmentedList
<(Document document, ClassificationType type, ClassificationOptions options)> documents,
Microsoft.CodeAnalysis.Workspaces (179)
FindSymbols\SymbolTree\SymbolTreeInfoCacheService.cs (1)
120
ImmutableSegmentedList
<ProjectId> projectIds, CancellationToken cancellationToken)
src\Dependencies\Collections\RoslynImmutableInterlocked.cs (26)
33
public static bool Update<T>(ref
ImmutableSegmentedList
<T> location, Func<
ImmutableSegmentedList
<T>,
ImmutableSegmentedList
<T>> transformer)
38
var
oldValue =
ImmutableSegmentedList
<T>.PrivateMarshal.VolatileRead(in location);
41
var
newValue = transformer(oldValue);
48
var
interlockedResult = InterlockedCompareExchange(ref location, newValue, oldValue);
74
public static bool Update<T, TArg>(ref
ImmutableSegmentedList
<T> location, Func<
ImmutableSegmentedList
<T>, TArg,
ImmutableSegmentedList
<T>> transformer, TArg transformerArgument)
79
var
oldValue =
ImmutableSegmentedList
<T>.PrivateMarshal.VolatileRead(in location);
82
var
newValue = transformer(oldValue, transformerArgument);
89
var
interlockedResult = InterlockedCompareExchange(ref location, newValue, oldValue);
105
public static
ImmutableSegmentedList
<T> InterlockedExchange<T>(ref
ImmutableSegmentedList
<T> location,
ImmutableSegmentedList
<T> value)
107
return
ImmutableSegmentedList
<T>.PrivateMarshal.InterlockedExchange(ref location, value);
119
public static
ImmutableSegmentedList
<T> InterlockedCompareExchange<T>(ref
ImmutableSegmentedList
<T> location,
ImmutableSegmentedList
<T> value,
ImmutableSegmentedList
<T> comparand)
121
return
ImmutableSegmentedList
<T>.PrivateMarshal.InterlockedCompareExchange(ref location, value, comparand);
133
public static bool InterlockedInitialize<T>(ref
ImmutableSegmentedList
<T> location,
ImmutableSegmentedList
<T> value)
135
return InterlockedCompareExchange(ref location, value, default(
ImmutableSegmentedList
<T>)).IsDefault;
src\Dependencies\Collections\Segmented\ImmutableSegmentedList.cs (15)
16
public static
ImmutableSegmentedList
<T> Create<T>()
17
=>
ImmutableSegmentedList
<T>.Empty;
20
public static
ImmutableSegmentedList
<T> Create<T>(T item)
21
=>
ImmutableSegmentedList
<T>.Empty.Add(item);
24
public static
ImmutableSegmentedList
<T> Create<T>(params T[] items)
25
=>
ImmutableSegmentedList
<T>.Empty.AddRange(items);
28
public static
ImmutableSegmentedList
<T>.Builder CreateBuilder<T>()
29
=>
ImmutableSegmentedList
<T>.Empty.ToBuilder();
32
public static
ImmutableSegmentedList
<T> CreateRange<T>(IEnumerable<T> items)
33
=>
ImmutableSegmentedList
<T>.Empty.AddRange(items);
36
public static
ImmutableSegmentedList
<T> ToImmutableSegmentedList<T>(this IEnumerable<T> source)
38
if (source is
ImmutableSegmentedList
<T> existingList)
41
return
ImmutableSegmentedList
<T>.Empty.AddRange(source);
45
public static
ImmutableSegmentedList
<T> ToImmutableSegmentedList<T>(this
ImmutableSegmentedList
<T>.Builder builder)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1.cs (61)
20
/// <para>There are different scenarios best for <see cref="
ImmutableSegmentedList
{T}"/> and others
24
/// <see cref="
ImmutableSegmentedList
{T}"/>:</para>
29
/// <description><see cref="
ImmutableSegmentedList
{T}"/> Complexity</description>
73
internal readonly partial struct ImmutableSegmentedList<T> : IImmutableList<T>, IReadOnlyList<T>, IList<T>, IList, IEquatable<
ImmutableSegmentedList
<T>>
76
public static readonly
ImmutableSegmentedList
<T> Empty = new(new SegmentedList<T>());
114
public static bool operator ==(
ImmutableSegmentedList
<T> left,
ImmutableSegmentedList
<T> right)
117
public static bool operator !=(
ImmutableSegmentedList
<T> left,
ImmutableSegmentedList
<T> right)
120
public static bool operator ==(
ImmutableSegmentedList
<T>? left,
ImmutableSegmentedList
<T>? right)
123
public static bool operator !=(
ImmutableSegmentedList
<T>? left,
ImmutableSegmentedList
<T>? right)
129
var
self = this;
141
public
ImmutableSegmentedList
<T> Add(T value)
143
var
self = this;
161
public
ImmutableSegmentedList
<T> AddRange(IEnumerable<T> items)
163
var
self = this;
171
if (items is
ImmutableSegmentedList
<T> immutableList)
173
else if (items is
ImmutableSegmentedList
<T>.Builder builder)
201
public
ImmutableSegmentedList
<T> Clear()
208
public
ImmutableSegmentedList
<TOutput> ConvertAll<TOutput>(Converter<T, TOutput> converter)
231
public
ImmutableSegmentedList
<T> FindAll(Predicate<T> match)
257
var
self = this;
272
var
self = this;
293
public
ImmutableSegmentedList
<T> GetRange(int index, int count)
295
var
self = this;
310
public
ImmutableSegmentedList
<T> Insert(int index, T item)
312
var
self = this;
325
public
ImmutableSegmentedList
<T> InsertRange(int index, IEnumerable<T> items)
327
var
self = this;
341
var
self = this;
361
public
ImmutableSegmentedList
<T> Remove(T value)
363
var
self = this;
373
public
ImmutableSegmentedList
<T> Remove(T value, IEqualityComparer<T>? equalityComparer)
375
var
self = this;
385
public
ImmutableSegmentedList
<T> RemoveAll(Predicate<T> match)
395
public
ImmutableSegmentedList
<T> RemoveAt(int index)
404
public
ImmutableSegmentedList
<T> RemoveRange(IEnumerable<T> items)
409
var
self = this;
428
public
ImmutableSegmentedList
<T> RemoveRange(IEnumerable<T> items, IEqualityComparer<T>? equalityComparer)
433
var
self = this;
452
public
ImmutableSegmentedList
<T> RemoveRange(int index, int count)
454
var
self = this;
468
public
ImmutableSegmentedList
<T> Replace(T oldValue, T newValue)
470
var
self = this;
482
public
ImmutableSegmentedList
<T> Replace(T oldValue, T newValue, IEqualityComparer<T>? equalityComparer)
484
var
self = this;
496
public
ImmutableSegmentedList
<T> Reverse()
498
var
self = this;
508
public
ImmutableSegmentedList
<T> Reverse(int index, int count)
516
public
ImmutableSegmentedList
<T> SetItem(int index, T value)
525
public
ImmutableSegmentedList
<T> Sort()
527
var
self = this;
539
public
ImmutableSegmentedList
<T> Sort(IComparer<T>? comparer)
541
var
self = this;
553
public
ImmutableSegmentedList
<T> Sort(Comparison<T> comparison)
560
var
self = this;
572
public
ImmutableSegmentedList
<T> Sort(int index, int count, IComparer<T>? comparer)
592
return obj is
ImmutableSegmentedList
<T> other
596
public bool Equals(
ImmutableSegmentedList
<T> other)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+Builder.cs (5)
23
internal Builder(
ImmutableSegmentedList
<T> list)
80
public
ImmutableSegmentedList
<TOutput> ConvertAll<TOutput>(Converter<T, TOutput> converter)
103
public
ImmutableSegmentedList
<T> FindAll(Predicate<T> match)
143
public
ImmutableSegmentedList
<T> GetRange(int index, int count)
219
public
ImmutableSegmentedList
<T> ToImmutable()
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+PrivateMarshal.cs (12)
20
internal static
ImmutableSegmentedList
<T> VolatileRead(in
ImmutableSegmentedList
<T> location)
29
internal static
ImmutableSegmentedList
<T> InterlockedExchange(ref
ImmutableSegmentedList
<T> location,
ImmutableSegmentedList
<T> value)
38
internal static
ImmutableSegmentedList
<T> InterlockedCompareExchange(ref
ImmutableSegmentedList
<T> location,
ImmutableSegmentedList
<T> value,
ImmutableSegmentedList
<T> comparand)
48
internal static
ImmutableSegmentedList
<T> AsImmutableSegmentedList(SegmentedList<T>? list)
51
/// <inheritdoc cref="SegmentedCollectionsMarshal.AsSegmentedList{T}(
ImmutableSegmentedList
{T})"/>
52
internal static SegmentedList<T>? AsSegmentedList(
ImmutableSegmentedList
<T> list)
src\Dependencies\Collections\Segmented\ImmutableSegmentedList`1+ValueBuilder.cs (7)
21
private
ImmutableSegmentedList
<T> _list;
29
internal ValueBuilder(
ImmutableSegmentedList
<T> list)
76
var
originalList = RoslynImmutableInterlocked.InterlockedExchange(ref _list, default);
125
public readonly
ImmutableSegmentedList
<TOutput> ConvertAll<TOutput>(Converter<T, TOutput> converter)
143
public readonly
ImmutableSegmentedList
<T> FindAll(Predicate<T> match)
191
public
ImmutableSegmentedList
<T> GetRange(int index, int count)
325
public
ImmutableSegmentedList
<T> ToImmutable()
src\Dependencies\Collections\Segmented\ImmutableSegmentedListExtensions.cs (9)
17
public static bool All<T>(this
ImmutableSegmentedList
<T> immutableList, Func<T, bool> predicate)
33
public static bool Any<T>(this
ImmutableSegmentedList
<T> immutableList)
41
public static bool Any<T>(this
ImmutableSegmentedList
<T>.Builder builder)
49
public static bool Any<T>(this
ImmutableSegmentedList
<T> immutableList, Func<T, bool> predicate)
65
public static T Last<T>(this
ImmutableSegmentedList
<T> immutableList)
74
public static T Last<T>(this
ImmutableSegmentedList
<T>.Builder builder)
86
public static T Last<T>(this
ImmutableSegmentedList
<T> immutableList, Func<T, bool> predicate)
103
public static IEnumerable<TResult> Select<T, TResult>(this
ImmutableSegmentedList
<T> immutableList, Func<T, TResult> selector)
120
public static int BinarySearch<TElement, TValue>(this
ImmutableSegmentedList
<TElement> array, TValue value, Func<TElement, TValue, int> comparer)
src\Dependencies\Collections\Segmented\SegmentedCollectionsMarshal.cs (16)
98
/// Gets an <see cref="
ImmutableSegmentedList
{T}"/> value wrapping the input <see cref="SegmentedList{T}"/>.
101
/// <param name="list">The input segmented list to wrap in the returned <see cref="
ImmutableSegmentedList
{T}"/> value.</param>
102
/// <returns>An <see cref="
ImmutableSegmentedList
{T}"/> value wrapping <paramref name="list"/>.</returns>
106
/// list, and that it won't be modified once the returned <see cref="
ImmutableSegmentedList
{T}"/> value starts
108
/// <see cref="
ImmutableSegmentedList
{T}"/> values to change after its creation.
111
/// If <paramref name="list"/> is <see langword="null"/>, the returned <see cref="
ImmutableSegmentedList
{T}"/> value
112
/// will be uninitialized (i.e. its <see cref="
ImmutableSegmentedList
{T}.IsDefault"/> property will be
116
public static
ImmutableSegmentedList
<T> AsImmutableSegmentedList<T>(SegmentedList<T>? list)
117
=>
ImmutableSegmentedList
<T>.PrivateMarshal.AsImmutableSegmentedList(list);
120
/// Gets the underlying <see cref="SegmentedList{T}"/> for an input <see cref="
ImmutableSegmentedList
{T}"/> value.
122
/// <typeparam name="T">The type of elements in the input <see cref="
ImmutableSegmentedList
{T}"/> value.</typeparam>
123
/// <param name="list">The input <see cref="
ImmutableSegmentedList
{T}"/> value to get the underlying <see cref="SegmentedList{T}"/> from.</param>
129
/// don't expect the contents of the <see cref="
ImmutableSegmentedList
{T}"/> value to change.
132
/// If <paramref name="list"/> is uninitialized (i.e. its <see cref="
ImmutableSegmentedList
{T}.IsDefault"/> property is
136
public static SegmentedList<T>? AsSegmentedList<T>(
ImmutableSegmentedList
<T> list)
137
=>
ImmutableSegmentedList
<T>.PrivateMarshal.AsSegmentedList(list);
src\Dependencies\Threading\AsyncBatchingWorkQueue`0.cs (1)
23
private static Func<
ImmutableSegmentedList
<VoidResult>, CancellationToken, ValueTask> Convert(Func<CancellationToken, ValueTask> processBatchAsync)
src\Dependencies\Threading\AsyncBatchingWorkQueue`1.cs (4)
19
Func<
ImmutableSegmentedList
<TItem>, CancellationToken, ValueTask> processBatchAsync,
26
Func<
ImmutableSegmentedList
<TItem>, CancellationToken, ValueTask> processBatchAsync,
37
private static Func<
ImmutableSegmentedList
<TItem>, CancellationToken, ValueTask<VoidResult>> Convert(Func<
ImmutableSegmentedList
<TItem>, CancellationToken, ValueTask> processBatchAsync)
src\Dependencies\Threading\AsyncBatchingWorkQueue`2.cs (5)
44
private readonly Func<
ImmutableSegmentedList
<TItem>, CancellationToken, ValueTask<TResult>> _processBatchAsync;
75
private readonly
ImmutableSegmentedList
<TItem>.Builder _nextBatch = ImmutableSegmentedList.CreateBuilder<TItem>();
107
Func<
ImmutableSegmentedList
<TItem>, CancellationToken, ValueTask<TResult>> processBatchAsync,
292
private (
ImmutableSegmentedList
<TItem> items, CancellationToken batchCancellationToken) GetNextBatchAndResetQueue()
296
var
nextBatch = _nextBatch.ToImmutable();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\AbstractVirtualCharService.cs (4)
191
protected static int ConvertTextAtIndexToRune(string tokenText, int index,
ImmutableSegmentedList
<VirtualChar>.Builder result, int offset)
194
protected static int ConvertTextAtIndexToRune(SourceText tokenText, int index,
ImmutableSegmentedList
<VirtualChar>.Builder result, int offset)
198
T tokenText, int index, TTextInfo info,
ImmutableSegmentedList
<VirtualChar>.Builder result, int offset)
231
ImmutableSegmentedList
<VirtualChar>.Builder result)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\VirtualCharSequence.Chunks.cs (2)
34
/// Thin wrapper over an actual <see cref="
ImmutableSegmentedList
{T}"/>.
38
private sealed class ImmutableSegmentedListChunk(
ImmutableSegmentedList
<VirtualChar> array) : Chunk
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\VirtualCharSequence.cs (2)
30
public static readonly VirtualCharSequence Empty = Create(
ImmutableSegmentedList
<VirtualChar>.Empty);
32
public static VirtualCharSequence Create(
ImmutableSegmentedList
<VirtualChar> virtualChars)
Workspace\ProjectSystem\FileWatchedPortableExecutableReferenceFactory.cs (1)
194
private async ValueTask ProcessWorkAsync(
ImmutableSegmentedList
<string> list, CancellationToken cancellationToken)
Workspace\ProjectSystem\ProjectSystemProject.BatchingDocumentCollection.cs (2)
397
public async ValueTask ProcessRegularFileChangesAsync(
ImmutableSegmentedList
<string> filePaths)
471
private async ValueTask ProcessDynamicFileChangesAsync(
ImmutableSegmentedList
<(string projectSystemFilePath, string workspaceFilePath)> batch, CancellationToken cancellationToken)
Workspace\ProjectSystem\ProjectSystemProject.cs (1)
1205
private async ValueTask ProcessFileChangesAsync(
ImmutableSegmentedList
<string> filePaths, CancellationToken cancellationToken)
Workspace\Solution\VersionSource\RecoverableTextAndVersion.RecoverableText.cs (1)
145
ImmutableSegmentedList
<(RecoverableText recoverableText, SourceText sourceText)> list, CancellationToken cancellationToken)
Workspace\Workspace.cs (2)
737
private async ValueTask ProcessEventHandlerWorkQueueAsync(
ImmutableSegmentedList
<(EventArgs Args, EventHandlerSet HandlerSet)> list, CancellationToken cancellationToken)
757
ImmutableSegmentedList
<(EventArgs Args, EventHandlerSet handlerSet)> list,
Workspace\Workspace_SourceGeneration.cs (2)
35
ImmutableSegmentedList
<(ProjectId? projectId, bool forceRegeneration)> projectIds, CancellationToken cancellationToken)
71
Solution solution,
ImmutableSegmentedList
<(ProjectId? projectId, bool forceRegeneration)> projectIds)