4 instantiations of NamespaceOrTypeAndUsingDirective
Microsoft.CodeAnalysis.CSharp (4)
Binder\Imports.cs (1)
110
expandedUsingsBuilder.Add(new
NamespaceOrTypeAndUsingDirective
(expandedNamespace, previousUsing.UsingDirective, dependencies: default));
Compilation\CSharpCompilation.UsingsFromOptionsAndDiagnostics.cs (1)
63
boundUsings.Add(new
NamespaceOrTypeAndUsingDirective
(imported, null, dependencies: directiveDiagnostics.DependenciesBag.ToImmutableArray()));
Symbols\Source\SourceNamespaceSymbol.AliasesAndUsings.cs (2)
807
getOrCreateUsingsBuilder(ref usings, globalUsingNamespacesOrTypes).Add(new
NamespaceOrTypeAndUsingDirective
(imported, usingDirective, dependencies: default));
836
getOrCreateUsingsBuilder(ref usings, globalUsingNamespacesOrTypes).Add(new
NamespaceOrTypeAndUsingDirective
(importedType, usingDirective, directiveDiagnostics.DependenciesBag.ToImmutableArray()));
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,
211
private class UsingTargetComparer : IEqualityComparer<
NamespaceOrTypeAndUsingDirective
>
213
public static readonly IEqualityComparer<
NamespaceOrTypeAndUsingDirective
> Instance = new UsingTargetComparer();
217
bool IEqualityComparer<
NamespaceOrTypeAndUsingDirective
>.Equals(
NamespaceOrTypeAndUsingDirective
x,
NamespaceOrTypeAndUsingDirective
y)
222
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))
85
foreach (
var
nsOrType in this.GetUsings(basesBeingResolved: null))
124
foreach (
var
typeOrNamespace in this.GetUsings(basesBeingResolved))
193
foreach (
var
namespaceSymbol in this.GetUsings(basesBeingResolved: null))
250
internal static WithUsingNamespacesAndTypesBinder Create(ImmutableArray<
NamespaceOrTypeAndUsingDirective
> namespacesOrTypes, Binder next, bool withImportChainEntry = false)
259
private ImmutableArray<
NamespaceOrTypeAndUsingDirective
> _lazyUsings;
269
internal override ImmutableArray<
NamespaceOrTypeAndUsingDirective
> GetUsings(ConsList<TypeSymbol>? basesBeingResolved)
299
internal override ImmutableArray<
NamespaceOrTypeAndUsingDirective
> GetUsings(ConsList<TypeSymbol>? basesBeingResolved)
324
private readonly ImmutableArray<
NamespaceOrTypeAndUsingDirective
> _usings;
326
internal FromNamespacesOrTypes(ImmutableArray<
NamespaceOrTypeAndUsingDirective
> namespacesOrTypes, Binder next, bool withImportChainEntry)
333
internal override ImmutableArray<
NamespaceOrTypeAndUsingDirective
> GetUsings(ConsList<TypeSymbol>? basesBeingResolved)
Compilation\CSharpCompilation.cs (6)
56
private ImmutableArray<
NamespaceOrTypeAndUsingDirective
> _lazyGlobalImports;
1654
internal ImmutableArray<
NamespaceOrTypeAndUsingDirective
> GlobalImports
1657
private ImmutableArray<
NamespaceOrTypeAndUsingDirective
> BindGlobalImports()
1661
var previousSubmissionImports = previousSubmission is object ? Imports.ExpandPreviousSubmissionImports(previousSubmission.GlobalImports, this) : ImmutableArray<
NamespaceOrTypeAndUsingDirective
>.Empty;
1672
var boundUsings = ArrayBuilder<
NamespaceOrTypeAndUsingDirective
>.GetInstance();
1678
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)
211
public ImmutableArray<
NamespaceOrTypeAndUsingDirective
> GetUsingNamespacesOrTypes(CSharpSyntaxNode declarationSyntax, ConsList<TypeSymbol>? basesBeingResolved)
232
return ImmutableArray<
NamespaceOrTypeAndUsingDirective
>.Empty;
253
private ImmutableArray<
NamespaceOrTypeAndUsingDirective
> GetGlobalUsingNamespacesOrTypes(ConsList<TypeSymbol>? basesBeingResolved)
269
var mergedNamespacesOrTypes = ArrayBuilder<
NamespaceOrTypeAndUsingDirective
>.GetInstance();
335
foreach (
var
namespaceOrType in namespacesOrTypes)
535
internal ImmutableArray<
NamespaceOrTypeAndUsingDirective
> GetUsingNamespacesOrTypes(SourceNamespaceSymbol declaringSymbol, CSharpSyntaxNode declarationSyntax, ConsList<TypeSymbol>? basesBeingResolved)
545
internal ImmutableArray<
NamespaceOrTypeAndUsingDirective
> GetGlobalUsingNamespacesOrTypes(SourceNamespaceSymbol declaringSymbol, SyntaxReference declarationSyntax, ConsList<TypeSymbol>? basesBeingResolved)
630
var globalUsingNamespacesOrTypes = ImmutableArray<
NamespaceOrTypeAndUsingDirective
>.Empty;
645
ArrayBuilder<
NamespaceOrTypeAndUsingDirective
>? usings = null;
885
static PooledHashSet<NamespaceOrTypeSymbol> getOrCreateUniqueUsings(ref PooledHashSet<NamespaceOrTypeSymbol>? uniqueUsings, ImmutableArray<
NamespaceOrTypeAndUsingDirective
> globalUsingNamespacesOrTypes)
896
static PooledHashSet<NamespaceOrTypeSymbol> getOrCreateUniqueGlobalUsingsNotInTree(ref PooledHashSet<NamespaceOrTypeSymbol>? uniqueUsings, ImmutableArray<
NamespaceOrTypeAndUsingDirective
> globalUsingNamespacesOrTypes, SyntaxTree tree)
907
static ArrayBuilder<
NamespaceOrTypeAndUsingDirective
> getOrCreateUsingsBuilder(ref ArrayBuilder<
NamespaceOrTypeAndUsingDirective
>? usings, ImmutableArray<
NamespaceOrTypeAndUsingDirective
> globalUsingNamespacesOrTypes)
911
usings = ArrayBuilder<
NamespaceOrTypeAndUsingDirective
>.GetInstance();
1030
foreach (
var
@using in usingsAndDiagnostics.UsingNamespacesOrTypes)
1133
UsingNamespacesOrTypes = ImmutableArray<
NamespaceOrTypeAndUsingDirective
>.Empty,
1139
public ImmutableArray<
NamespaceOrTypeAndUsingDirective
> UsingNamespacesOrTypes { get; init; }
1157
UsingNamespacesOrTypes = ImmutableArray<
NamespaceOrTypeAndUsingDirective
>.Empty,
1163
public ImmutableArray<
NamespaceOrTypeAndUsingDirective
> UsingNamespacesOrTypes { get; init; }