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