13 instantiations of OneOrMany
Microsoft.CodeAnalysis (6)
DiagnosticAnalyzer\AnalysisResultBuilder.cs (1)
85value = new OneOrMany<AdditionalText>(file);
InternalUtilities\OneOrMany.cs (5)
22public static readonly OneOrMany<T> Empty = new OneOrMany<T>(ImmutableArray<T>.Empty); 87return new OneOrMany<T>(builder.ToImmutableAndFree()); 125return builder.Count == Count ? this : new OneOrMany<T>(builder.ToImmutableAndFree()); 205=> new OneOrMany<T>(one); 208=> new OneOrMany<T>(many);
Microsoft.CodeAnalysis.UnitTests (7)
InternalUtilities\OneOrManyTests.cs (7)
38Verify(new OneOrMany<int>(ImmutableArray<int>.Empty)); 47Verify(new OneOrMany<int>(1), 1); 48Verify(new OneOrMany<int>(ImmutableArray.Create(2)), 2); 49Verify(new OneOrMany<int>(ImmutableArray<int>.Empty).Add(3), 3); 58Verify(new OneOrMany<int>(ImmutableArray.Create(1, 2, 3)).Add(4), 1, 2, 3, 4); 59Verify(new OneOrMany<int>(ImmutableArray.Create(1, 2, 3, 4)), 1, 2, 3, 4); 60Verify(new OneOrMany<int>(ImmutableArray<int>.Empty).Add(1).Add(2).Add(3).Add(4), 1, 2, 3, 4);
79 references to OneOrMany
Microsoft.CodeAnalysis (28)
DiagnosticAnalyzer\AnalysisResultBuilder.cs (7)
24private static readonly ImmutableDictionary<string, OneOrMany<AdditionalText>> s_emptyPathToAdditionalTextMap = 25ImmutableDictionary<string, OneOrMany<AdditionalText>>.Empty.WithComparers(PathUtilities.Comparer); 34private readonly ImmutableDictionary<string, OneOrMany<AdditionalText>> _pathToAdditionalTextMap; 63private static ImmutableDictionary<string, OneOrMany<AdditionalText>> CreatePathToAdditionalTextMap(ImmutableArray<AdditionalText> additionalFiles) 70var builder = ImmutableDictionary.CreateBuilder<string, OneOrMany<AdditionalText>>(PathUtilities.Comparer); 79if (builder.TryGetValue(path, out var value)) 310if (_pathToAdditionalTextMap.TryGetValue(externalFileLocation.GetLineSpan().Path, out var additionalTexts))
InternalUtilities\OneOrMany.cs (9)
22public static readonly OneOrMany<T> Empty = new OneOrMany<T>(ImmutableArray<T>.Empty); 74public OneOrMany<T> Add(T one) 104public OneOrMany<T> RemoveAll(T item) 128public OneOrMany<TResult> Select<TResult>(Func<T, TResult> selector) 135public OneOrMany<TResult> Select<TResult, TArg>(Func<T, TArg, TResult> selector, TArg arg) 183private readonly OneOrMany<T> _collection; 186internal Enumerator(OneOrMany<T> collection) 204public static OneOrMany<T> Create<T>(T one) 207public static OneOrMany<T> Create<T>(ImmutableArray<T> many)
MetadataReference\AssemblyIdentityMap.cs (5)
20private readonly Dictionary<string, OneOrMany<KeyValuePair<AssemblyIdentity, TValue>>> _map; 24_map = new Dictionary<string, OneOrMany<KeyValuePair<AssemblyIdentity, TValue>>>(AssemblyIdentityComparer.SimpleNameComparer); 35OneOrMany<KeyValuePair<AssemblyIdentity, TValue>> sameName; 78OneOrMany<KeyValuePair<AssemblyIdentity, TValue>> sameName; 102OneOrMany<KeyValuePair<AssemblyIdentity, TValue>> sameName;
SourceGeneration\Nodes\NodeStateTable.cs (6)
208public bool TryRemoveEntries(TimeSpan elapsedTime, ImmutableArray<(IncrementalGeneratorRunStep InputStep, int OutputIndex)> stepInputs, out OneOrMany<T> entries) 469private readonly OneOrMany<T> _items; 477public TableEntry(OneOrMany<T> items, EntryState state) 480private TableEntry(OneOrMany<T> items, ImmutableArray<EntryState> states) 516public OneOrMany<T> Items => _items; 631OneOrMany<T> items;
SourceGeneration\Nodes\PredicateSyntaxStrategy.cs (1)
72if (_filterTable.TryRemoveEntries(TimeSpan.Zero, noInputStepsStepInfo, out var removedNodes))
Microsoft.CodeAnalysis.CSharp (27)
Symbols\Source\LambdaParameterSymbol.cs (1)
45internal override OneOrMany<SyntaxList<AttributeListSyntax>> GetAttributeDeclarations() => OneOrMany.Create(_attributeLists);
Symbols\Source\LambdaSymbol.cs (1)
270internal override OneOrMany<SyntaxList<AttributeListSyntax>> GetAttributeDeclarations()
Symbols\Source\LocalFunctionSymbol.cs (1)
312internal override OneOrMany<SyntaxList<AttributeListSyntax>> GetAttributeDeclarations()
Symbols\Source\SourceComplexParameterSymbol.cs (2)
490internal virtual OneOrMany<SyntaxList<AttributeListSyntax>> GetAttributeDeclarations() 588var attributeSyntax = this.GetAttributeDeclarations();
Symbols\Source\SourceConstructorSymbol.cs (1)
161internal override OneOrMany<SyntaxList<AttributeListSyntax>> GetAttributeDeclarations()
Symbols\Source\SourceConstructorSymbolBase.cs (1)
172internal sealed override OneOrMany<SyntaxList<AttributeListSyntax>> GetReturnTypeAttributeDeclarations()
Symbols\Source\SourceCustomEventAccessorSymbol.cs (1)
80internal override OneOrMany<SyntaxList<AttributeListSyntax>> GetAttributeDeclarations()
Symbols\Source\SourceDelegateMethodSymbol.cs (3)
202internal sealed override OneOrMany<SyntaxList<AttributeListSyntax>> GetAttributeDeclarations() 239internal override OneOrMany<SyntaxList<AttributeListSyntax>> GetReturnTypeAttributeDeclarations() 396internal override OneOrMany<SyntaxList<AttributeListSyntax>> GetReturnTypeAttributeDeclarations()
Symbols\Source\SourceDestructorSymbol.cs (2)
153internal override OneOrMany<SyntaxList<AttributeListSyntax>> GetAttributeDeclarations() 159internal override OneOrMany<SyntaxList<AttributeListSyntax>> GetReturnTypeAttributeDeclarations()
Symbols\Source\SourceMethodSymbolWithAttributes.cs (2)
166internal virtual OneOrMany<SyntaxList<AttributeListSyntax>> GetAttributeDeclarations() 174internal virtual OneOrMany<SyntaxList<AttributeListSyntax>> GetReturnTypeAttributeDeclarations()
Symbols\Source\SourceOrdinaryMethodSymbol.cs (1)
493internal override OneOrMany<SyntaxList<AttributeListSyntax>> GetAttributeDeclarations()
Symbols\Source\SourceOrdinaryMethodSymbolBase.cs (1)
199internal abstract override OneOrMany<SyntaxList<AttributeListSyntax>> GetAttributeDeclarations();
Symbols\Source\SourcePropertyAccessorSymbol.cs (1)
633internal sealed override OneOrMany<SyntaxList<AttributeListSyntax>> GetAttributeDeclarations()
Symbols\Source\SourceUserDefinedConversionSymbol.cs (1)
122internal sealed override OneOrMany<SyntaxList<AttributeListSyntax>> GetAttributeDeclarations()
Symbols\Source\SourceUserDefinedOperatorSymbol.cs (1)
122internal sealed override OneOrMany<SyntaxList<AttributeListSyntax>> GetAttributeDeclarations()
Symbols\Symbol_Attributes.cs (3)
291OneOrMany<SyntaxList<AttributeListSyntax>> attributesSyntaxLists, 525protected ImmutableArray<(CSharpAttributeData, BoundAttribute)> BindAttributes(OneOrMany<SyntaxList<AttributeListSyntax>> attributeDeclarations, Binder? rootBinder) 570OneOrMany<SyntaxList<AttributeListSyntax>> attributeDeclarationSyntaxLists,
Symbols\Synthesized\Records\SynthesizedRecordEqualityOperatorBase.cs (1)
54internal sealed override OneOrMany<SyntaxList<AttributeListSyntax>> GetAttributeDeclarations() => OneOrMany.Create(default(SyntaxList<AttributeListSyntax>));
Symbols\Synthesized\Records\SynthesizedRecordOrdinaryMethod.cs (1)
77internal sealed override OneOrMany<SyntaxList<AttributeListSyntax>> GetAttributeDeclarations() => OneOrMany.Create(default(SyntaxList<AttributeListSyntax>));
Symbols\Synthesized\SynthesizedAccessorValueParameterSymbol.cs (1)
69internal override OneOrMany<SyntaxList<AttributeListSyntax>> GetAttributeDeclarations()
Symbols\Synthesized\SynthesizedEventAccessorSymbol.cs (1)
61internal override OneOrMany<SyntaxList<AttributeListSyntax>> GetAttributeDeclarations()
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (2)
SourceGeneration\StateTableTests.cs (2)
88bool didRemoveEntries = builder.TryRemoveEntries(TimeSpan.Zero, default, out var removedEntries); //((6, EntryState.Removed)) 99private static IEnumerable<int> YieldItems(OneOrMany<int> items)
Microsoft.CodeAnalysis.UnitTests (3)
InternalUtilities\OneOrManyTests.cs (3)
15private static void Verify<T>(OneOrMany<T> actual, params T[] expected) 114var single = OneOrMany.Create(123); 115var quad = OneOrMany.Create(ImmutableArray.Create<int>(10, 20, 30, 40));
Microsoft.CodeAnalysis.VisualBasic (19)
Symbols\Source\CustomEventAccessorSymbol.vb (2)
126Protected Overrides Function GetAttributeDeclarations() As OneOrMany(Of SyntaxList(Of AttributeListSyntax)) 130Protected Overrides Function GetReturnTypeAttributeDeclarations() As OneOrMany(Of SyntaxList(Of AttributeListSyntax))
Symbols\Source\SourceComplexParameterSymbol.vb (1)
61Private Function GetAttributeDeclarations() As OneOrMany(Of SyntaxList(Of AttributeListSyntax))
Symbols\Source\SourceDelegateMethodSymbol.vb (4)
206Protected NotOverridable Overrides Function GetAttributeDeclarations() As OneOrMany(Of SyntaxList(Of AttributeListSyntax)) 238Protected Overrides Function GetReturnTypeAttributeDeclarations() As OneOrMany(Of SyntaxList(Of AttributeListSyntax)) 313Protected Overrides Function GetReturnTypeAttributeDeclarations() As OneOrMany(Of SyntaxList(Of AttributeListSyntax)) 360Protected Overrides Function GetReturnTypeAttributeDeclarations() As OneOrMany(Of SyntaxList(Of AttributeListSyntax))
Symbols\Source\SourceEnumConstantSymbol.vb (1)
51Friend NotOverridable Overrides ReadOnly Property GetAttributeDeclarations As OneOrMany(Of SyntaxList(Of AttributeListSyntax))
Symbols\Source\SourceFieldSymbol.vb (1)
611Friend MustOverride ReadOnly Property GetAttributeDeclarations() As OneOrMany(Of SyntaxList(Of AttributeListSyntax))
Symbols\Source\SourceMemberFieldSymbol.vb (1)
42Friend NotOverridable Overrides ReadOnly Property GetAttributeDeclarations As OneOrMany(Of SyntaxList(Of AttributeListSyntax))
Symbols\Source\SourceMemberMethodSymbol.vb (1)
141Protected Overrides Function GetAttributeDeclarations() As OneOrMany(Of SyntaxList(Of AttributeListSyntax))
Symbols\Source\SourceMethodSymbol.vb (2)
1375Protected Overridable Function GetAttributeDeclarations() As OneOrMany(Of SyntaxList(Of AttributeListSyntax)) 1379Protected Overridable Function GetReturnTypeAttributeDeclarations() As OneOrMany(Of SyntaxList(Of AttributeListSyntax))
Symbols\Source\SourcePropertyAccessorSymbol.vb (2)
353Protected Overrides Function GetAttributeDeclarations() As OneOrMany(Of SyntaxList(Of AttributeListSyntax)) 361Protected Overrides Function GetReturnTypeAttributeDeclarations() As OneOrMany(Of SyntaxList(Of AttributeListSyntax))
Symbols\Source\SourcePropertySymbol.vb (2)
471Private Function GetAttributeDeclarations() As OneOrMany(Of SyntaxList(Of AttributeListSyntax)) 479Private Function GetReturnTypeAttributeDeclarations() As OneOrMany(Of SyntaxList(Of AttributeListSyntax))
Symbols\Symbol_Attributes.vb (2)
241Friend Sub LoadAndValidateAttributes(attributeBlockSyntaxList As OneOrMany(Of SyntaxList(Of AttributeListSyntax)), 299Private Function GetAttributesToBind(attributeDeclarationSyntaxLists As OneOrMany(Of SyntaxList(Of AttributeListSyntax)),