5 instantiations of OneOrMany
Microsoft.CodeAnalysis.Workspaces (5)
src\Compilers\Core\Portable\Collections\TemporaryArray`1.cs (1)
291
return
new
(this.ToImmutableAndClear());
src\Compilers\Core\Portable\InternalUtilities\OneOrMany.cs (3)
27
public static readonly OneOrMany<T> Empty = new
OneOrMany
<T>(ImmutableArray<T>.Empty);
165
? new
OneOrMany
<T>(from._one)
166
: new
OneOrMany
<T>(ImmutableArray<T>.CastUp(from._many));
Workspace\Workspace_Editor.cs (1)
809
docIds = new
OneOrMany
<DocumentId>(id);
39 references to OneOrMany
Microsoft.CodeAnalysis.Workspaces (39)
Options\GlobalOptionService.cs (1)
189
private bool SetGlobalOptions(
OneOrMany
<KeyValuePair<OptionKey2, object?>> options)
src\Compilers\Core\Portable\Collections\ImmutableArrayExtensions.cs (3)
307
public static ImmutableArray<TResult> SelectManyAsArray<TItem, TResult>(this ImmutableArray<TItem> array, Func<TItem,
OneOrMany
<TResult>> selector)
378
public static ImmutableArray<TResult> SelectManyAsArray<TItem, TResult>(this ImmutableArray<TItem> array, Func<TItem, bool> predicate, Func<TItem,
OneOrMany
<TResult>> selector)
403
public 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\Compilers\Core\Portable\Collections\OrderPreservingMultiDictionary.cs (2)
157
public
OneOrMany
<V> GetAsOneOrMany(K k)
165
return
OneOrMany
<V>.Empty;
src\Compilers\Core\Portable\Collections\TemporaryArray`1.cs (3)
277
/// Create an <see cref="
OneOrMany
{T}"/> with the elements currently held in the temporary array, and clear the
280
public
OneOrMany
<T> ToOneOrManyAndClear()
285
return
OneOrMany
<T>.Empty;
src\Compilers\Core\Portable\InternalUtilities\EnumerableExtensions.cs (1)
466
public static ImmutableArray<TResult> SelectManyAsArray<TSource, TResult>(this IEnumerable<TSource>? source, Func<TSource,
OneOrMany
<TResult>> selector)
src\Compilers\Core\Portable\InternalUtilities\OneOrMany.cs (13)
24
[DebuggerTypeProxy(typeof(
OneOrMany
<>.DebuggerProxy))]
27
public static readonly
OneOrMany
<T> Empty = new OneOrMany<T>(ImmutableArray<T>.Empty);
93
public
OneOrMany
<T> Add(T item)
113
public
OneOrMany
<T> RemoveAll(T item)
123
public
OneOrMany
<TResult> Select<TResult>(Func<T, TResult> selector)
130
public
OneOrMany
<TResult> Select<TResult, TArg>(Func<T, TArg, TResult> selector, TArg arg)
162
public static
OneOrMany
<T> CastUp<TDerived>(
OneOrMany
<TDerived> from) where TDerived : class, T
190
public bool SequenceEqual(
OneOrMany
<T> other, IEqualityComparer<T>? comparer = null)
236
private readonly
OneOrMany
<T> _collection;
239
internal Enumerator(
OneOrMany
<T> collection)
254
private sealed class DebuggerProxy(
OneOrMany
<T> instance)
256
private readonly
OneOrMany
<T> _instance = instance;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.cs (1)
211
private static
OneOrMany
<INamedTypeSymbol> Unwrap(INamedTypeSymbol namedType)
Workspace\ProjectSystem\ProjectSystemProject.cs (6)
1030
var
mappedPaths = GetMappedAnalyzerPaths(fullPath);
1073
var
mappedPaths = GetMappedAnalyzerPaths(fullPath);
1111
private
OneOrMany
<string> GetMappedAnalyzerPaths(string fullPath)
1119
return
OneOrMany
<string>.Empty;
1155
private
OneOrMany
<string> GetMappedRazorSourceGenerator(string fullPath)
1169
return
OneOrMany
<string>.Empty;
Workspace\Solution\TextDocumentStates.cs (6)
29
using FilePathToDocumentIds = ReadOnlyDictionary<string,
OneOrMany
<DocumentId>>;
48
new(new Dictionary<string,
OneOrMany
<DocumentId>>()));
335
if (_filePathToDocumentIds.TryGetValue(filePath, out
var
oneOrMany))
348
return _filePathToDocumentIds.TryGetValue(filePath, out
var
oneOrMany)
359
var result = new Dictionary<string,
OneOrMany
<DocumentId>>(SolutionState.FilePathComparer);
368
result[filePath] = result.TryGetValue(filePath, out
var
existingValue)
Workspace\Workspace_Editor.cs (3)
35
private readonly Dictionary<SourceTextContainer,
OneOrMany
<DocumentId>> _bufferToAssociatedDocumentsMap = [];
798
if (_bufferToAssociatedDocumentsMap.TryGetValue(textContainer, out
var
docIds))
824
if (!_bufferToAssociatedDocumentsMap.TryGetValue(textContainer, out
var
docIds))