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))
88
foreach (
var
nsOrType in this.GetUsings(basesBeingResolved: null))
137
foreach (
var
typeOrNamespace in this.GetUsings(basesBeingResolved))
205
foreach (
var
namespaceSymbol in this.GetUsings(basesBeingResolved: null))
262
internal static WithUsingNamespacesAndTypesBinder Create(ImmutableArray<
NamespaceOrTypeAndUsingDirective
> namespacesOrTypes, Binder next, bool withImportChainEntry = false)
271
private ImmutableArray<
NamespaceOrTypeAndUsingDirective
> _lazyUsings;
281
internal override ImmutableArray<
NamespaceOrTypeAndUsingDirective
> GetUsings(ConsList<TypeSymbol>? basesBeingResolved)
311
internal override ImmutableArray<
NamespaceOrTypeAndUsingDirective
> GetUsings(ConsList<TypeSymbol>? basesBeingResolved)
336
private readonly ImmutableArray<
NamespaceOrTypeAndUsingDirective
> _usings;
338
internal FromNamespacesOrTypes(ImmutableArray<
NamespaceOrTypeAndUsingDirective
> namespacesOrTypes, Binder next, bool withImportChainEntry)
345
internal override ImmutableArray<
NamespaceOrTypeAndUsingDirective
> GetUsings(ConsList<TypeSymbol>? basesBeingResolved)
Compilation\CSharpCompilation.cs (6)
55
private ImmutableArray<
NamespaceOrTypeAndUsingDirective
> _lazyGlobalImports;
1562
internal ImmutableArray<
NamespaceOrTypeAndUsingDirective
> GlobalImports
1565
private ImmutableArray<
NamespaceOrTypeAndUsingDirective
> BindGlobalImports()
1569
var previousSubmissionImports = previousSubmission is object ? Imports.ExpandPreviousSubmissionImports(previousSubmission.GlobalImports, this) : ImmutableArray<
NamespaceOrTypeAndUsingDirective
>.Empty;
1580
var boundUsings = ArrayBuilder<
NamespaceOrTypeAndUsingDirective
>.GetInstance();
1586
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; }