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