2 instantiations of NamespaceOrTypeAndUsingDirective
Microsoft.CodeAnalysis.CSharp (2)
Binder\Imports.cs (1)
110
expandedUsingsBuilder.Add(new
NamespaceOrTypeAndUsingDirective
(expandedNamespace, previousUsing.UsingDirective, dependencies: default));
Symbols\Source\SourceNamespaceSymbol.AliasesAndUsings.cs (1)
786
getOrCreateUsingsBuilder(ref usings, globalUsingNamespacesOrTypes).Add(new
NamespaceOrTypeAndUsingDirective
(imported, usingDirective, dependencies: default));
59 references to NamespaceOrTypeAndUsingDirective
Microsoft.CodeAnalysis.CSharp (59)
Binder\ImportChain.cs (2)
74
ImmutableArray<
NamespaceOrTypeAndUsingDirective
> usings = Imports.Usings;
77
foreach (
var
nsOrType in usings)
Binder\Imports.cs (15)
29
ImmutableArray<
NamespaceOrTypeAndUsingDirective
>.Empty,
33
public readonly ImmutableArray<
NamespaceOrTypeAndUsingDirective
> Usings;
38
ImmutableArray<
NamespaceOrTypeAndUsingDirective
> usings,
91
internal static ImmutableArray<
NamespaceOrTypeAndUsingDirective
> ExpandPreviousSubmissionImports(ImmutableArray<
NamespaceOrTypeAndUsingDirective
> previousSubmissionUsings, CSharpCompilation newSubmission)
97
var expandedUsingsBuilder = ArrayBuilder<
NamespaceOrTypeAndUsingDirective
>.GetInstance(previousSubmissionUsings.Length);
100
foreach (
var
previousUsing in previousSubmissionUsings)
153
ImmutableArray<
NamespaceOrTypeAndUsingDirective
> usings,
209
private class UsingTargetComparer : IEqualityComparer<
NamespaceOrTypeAndUsingDirective
>
211
public static readonly IEqualityComparer<
NamespaceOrTypeAndUsingDirective
> Instance = new UsingTargetComparer();
215
bool IEqualityComparer<
NamespaceOrTypeAndUsingDirective
>.Equals(
NamespaceOrTypeAndUsingDirective
x,
NamespaceOrTypeAndUsingDirective
y)
220
int IEqualityComparer<
NamespaceOrTypeAndUsingDirective
>.GetHashCode(
NamespaceOrTypeAndUsingDirective
obj)
Binder\WithUsingNamespacesAndTypesBinder.cs (12)
35
internal abstract ImmutableArray<
NamespaceOrTypeAndUsingDirective
> GetUsings(ConsList<TypeSymbol>? basesBeingResolved);
53
foreach (
var
typeOrNamespace in GetUsings(basesBeingResolved: null))
90
foreach (
var
nsOrType in this.GetUsings(basesBeingResolved: null))
139
foreach (
var
typeOrNamespace in this.GetUsings(basesBeingResolved))
207
foreach (
var
namespaceSymbol in this.GetUsings(basesBeingResolved: null))
264
internal static WithUsingNamespacesAndTypesBinder Create(ImmutableArray<
NamespaceOrTypeAndUsingDirective
> namespacesOrTypes, Binder next, bool withImportChainEntry = false)
273
private ImmutableArray<
NamespaceOrTypeAndUsingDirective
> _lazyUsings;
283
internal override ImmutableArray<
NamespaceOrTypeAndUsingDirective
> GetUsings(ConsList<TypeSymbol>? basesBeingResolved)
313
internal override ImmutableArray<
NamespaceOrTypeAndUsingDirective
> GetUsings(ConsList<TypeSymbol>? basesBeingResolved)
338
private readonly ImmutableArray<
NamespaceOrTypeAndUsingDirective
> _usings;
340
internal FromNamespacesOrTypes(ImmutableArray<
NamespaceOrTypeAndUsingDirective
> namespacesOrTypes, Binder next, bool withImportChainEntry)
347
internal override ImmutableArray<
NamespaceOrTypeAndUsingDirective
> GetUsings(ConsList<TypeSymbol>? basesBeingResolved)
Compilation\CSharpCompilation.cs (6)
55
private ImmutableArray<
NamespaceOrTypeAndUsingDirective
> _lazyGlobalImports;
1567
internal ImmutableArray<
NamespaceOrTypeAndUsingDirective
> GlobalImports
1570
private ImmutableArray<
NamespaceOrTypeAndUsingDirective
> BindGlobalImports()
1574
var previousSubmissionImports = previousSubmission is object ? Imports.ExpandPreviousSubmissionImports(previousSubmission.GlobalImports, this) : ImmutableArray<
NamespaceOrTypeAndUsingDirective
>.Empty;
1585
var boundUsings = ArrayBuilder<
NamespaceOrTypeAndUsingDirective
>.GetInstance();
1591
foreach (
var
previousUsing in previousSubmissionImports)
Compilation\CSharpCompilation.UsingsFromOptionsAndDiagnostics.cs (4)
19
public static readonly UsingsFromOptionsAndDiagnostics Empty = new UsingsFromOptionsAndDiagnostics() { UsingNamespacesOrTypes = ImmutableArray<
NamespaceOrTypeAndUsingDirective
>.Empty, Diagnostics = null };
21
public ImmutableArray<
NamespaceOrTypeAndUsingDirective
> UsingNamespacesOrTypes { get; init; }
38
var boundUsings = ArrayBuilder<
NamespaceOrTypeAndUsingDirective
>.GetInstance();
138
foreach (
var
@using in UsingNamespacesOrTypes)
Symbols\Source\SourceNamespaceSymbol.AliasesAndUsings.cs (20)
206
public ImmutableArray<
NamespaceOrTypeAndUsingDirective
> GetUsingNamespacesOrTypes(CSharpSyntaxNode declarationSyntax, ConsList<TypeSymbol>? basesBeingResolved)
227
return ImmutableArray<
NamespaceOrTypeAndUsingDirective
>.Empty;
248
private ImmutableArray<
NamespaceOrTypeAndUsingDirective
> GetGlobalUsingNamespacesOrTypes(ConsList<TypeSymbol>? basesBeingResolved)
264
var mergedNamespacesOrTypes = ArrayBuilder<
NamespaceOrTypeAndUsingDirective
>.GetInstance();
330
foreach (
var
namespaceOrType in namespacesOrTypes)
530
internal ImmutableArray<
NamespaceOrTypeAndUsingDirective
> GetUsingNamespacesOrTypes(SourceNamespaceSymbol declaringSymbol, CSharpSyntaxNode declarationSyntax, ConsList<TypeSymbol>? basesBeingResolved)
540
internal ImmutableArray<
NamespaceOrTypeAndUsingDirective
> GetGlobalUsingNamespacesOrTypes(SourceNamespaceSymbol declaringSymbol, SyntaxReference declarationSyntax, ConsList<TypeSymbol>? basesBeingResolved)
625
var globalUsingNamespacesOrTypes = ImmutableArray<
NamespaceOrTypeAndUsingDirective
>.Empty;
640
ArrayBuilder<
NamespaceOrTypeAndUsingDirective
>? usings = null;
863
static PooledHashSet<NamespaceOrTypeSymbol> getOrCreateUniqueUsings(ref PooledHashSet<NamespaceOrTypeSymbol>? uniqueUsings, ImmutableArray<
NamespaceOrTypeAndUsingDirective
> globalUsingNamespacesOrTypes)
874
static PooledHashSet<NamespaceOrTypeSymbol> getOrCreateUniqueGlobalUsingsNotInTree(ref PooledHashSet<NamespaceOrTypeSymbol>? uniqueUsings, ImmutableArray<
NamespaceOrTypeAndUsingDirective
> globalUsingNamespacesOrTypes, SyntaxTree tree)
885
static ArrayBuilder<
NamespaceOrTypeAndUsingDirective
> getOrCreateUsingsBuilder(ref ArrayBuilder<
NamespaceOrTypeAndUsingDirective
>? usings, ImmutableArray<
NamespaceOrTypeAndUsingDirective
> globalUsingNamespacesOrTypes)
889
usings = ArrayBuilder<
NamespaceOrTypeAndUsingDirective
>.GetInstance();
1001
foreach (
var
@using in usingsAndDiagnostics.UsingNamespacesOrTypes)
1099
UsingNamespacesOrTypes = ImmutableArray<
NamespaceOrTypeAndUsingDirective
>.Empty,
1105
public ImmutableArray<
NamespaceOrTypeAndUsingDirective
> UsingNamespacesOrTypes { get; init; }
1123
UsingNamespacesOrTypes = ImmutableArray<
NamespaceOrTypeAndUsingDirective
>.Empty,
1129
public ImmutableArray<
NamespaceOrTypeAndUsingDirective
> UsingNamespacesOrTypes { get; init; }