5 instantiations of OneOrMany
Microsoft.CodeAnalysis.Workspaces (5)
src\Dependencies\Collections\OneOrMany.cs (3)
26public static readonly OneOrMany<T> Empty = new OneOrMany<T>(ImmutableArray<T>.Empty); 164? new OneOrMany<T>(from._one) 165: new OneOrMany<T>(ImmutableArray<T>.CastUp(from._many));
src\Dependencies\Collections\TemporaryArray`1.cs (1)
291return new(this.ToImmutableAndClear());
Workspace\Workspace_Editor.cs (1)
809docIds = new OneOrMany<DocumentId>(id);
38 references to OneOrMany
Microsoft.CodeAnalysis.Workspaces (38)
Options\GlobalOptionService.cs (1)
147private bool SetGlobalOptions(OneOrMany<KeyValuePair<OptionKey2, object?>> options)
src\Compilers\Core\Portable\Collections\OrderPreservingMultiDictionary.cs (2)
157public OneOrMany<V> GetAsOneOrMany(K k) 165return OneOrMany<V>.Empty;
src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (1)
478public static ImmutableArray<TResult> SelectManyAsArray<TSource, TResult>(this IEnumerable<TSource>? source, Func<TSource, OneOrMany<TResult>> selector)
src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (3)
306public static ImmutableArray<TResult> SelectManyAsArray<TItem, TResult>(this ImmutableArray<TItem> array, Func<TItem, OneOrMany<TResult>> selector) 377public static ImmutableArray<TResult> SelectManyAsArray<TItem, TResult>(this ImmutableArray<TItem> array, Func<TItem, bool> predicate, Func<TItem, OneOrMany<TResult>> selector) 402public static ImmutableArray<TResult> SelectManyAsArray<TItem, TArg, TResult>(this ImmutableArray<TItem> array, Func<TItem, TArg, bool> predicate, Func<TItem, TArg, OneOrMany<TResult>> selector, TArg arg)
src\Dependencies\Collections\OneOrMany.cs (13)
23[DebuggerTypeProxy(typeof(OneOrMany<>.DebuggerProxy))] 26public static readonly OneOrMany<T> Empty = new OneOrMany<T>(ImmutableArray<T>.Empty); 92public OneOrMany<T> Add(T item) 112public OneOrMany<T> RemoveAll(T item) 122public OneOrMany<TResult> Select<TResult>(Func<T, TResult> selector) 129public OneOrMany<TResult> Select<TResult, TArg>(Func<T, TArg, TResult> selector, TArg arg) 161public static OneOrMany<T> CastUp<TDerived>(OneOrMany<TDerived> from) where TDerived : class, T 189public bool SequenceEqual(OneOrMany<T> other, IEqualityComparer<T>? comparer = null) 235private readonly OneOrMany<T> _collection; 238internal Enumerator(OneOrMany<T> collection) 253private sealed class DebuggerProxy(OneOrMany<T> instance) 255private readonly OneOrMany<T> _instance = instance;
src\Dependencies\Collections\TemporaryArray`1.cs (3)
277/// Create an <see cref="OneOrMany{T}"/> with the elements currently held in the temporary array, and clear the 280public OneOrMany<T> ToOneOrManyAndClear() 285return OneOrMany<T>.Empty;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.cs (1)
210private static OneOrMany<INamedTypeSymbol> Unwrap(INamedTypeSymbol namedType)
Workspace\ProjectSystem\ProjectSystemProject.cs (6)
1058var mappedPaths = GetMappedAnalyzerPaths(fullPath); 1101var mappedPaths = GetMappedAnalyzerPaths(fullPath); 1139private OneOrMany<string> GetMappedAnalyzerPaths(string fullPath) 1147return OneOrMany<string>.Empty; 1217private OneOrMany<string> GetMappedRazorSourceGenerator(string fullPath) 1231return OneOrMany<string>.Empty;
Workspace\Solution\TextDocumentStates.cs (5)
27using FilePathToDocumentIds = FrozenDictionary<string, OneOrMany<DocumentId>>; 39private static readonly ObjectPool<Dictionary<string, OneOrMany<DocumentId>>> s_filePathPool = new(() => new(SolutionState.FilePathComparer)); 334if (_filePathToDocumentIds.TryGetValue(filePath, out var oneOrMany)) 347return _filePathToDocumentIds.TryGetValue(filePath, out var oneOrMany) 367result[filePath] = result.TryGetValue(filePath, out var existingValue)
Workspace\Workspace_Editor.cs (3)
35private readonly Dictionary<SourceTextContainer, OneOrMany<DocumentId>> _bufferToAssociatedDocumentsMap = []; 798if (_bufferToAssociatedDocumentsMap.TryGetValue(textContainer, out var docIds)) 824if (!_bufferToAssociatedDocumentsMap.TryGetValue(textContainer, out var docIds))