2 instantiations of NamespaceOrTypeAndUsingDirective
Microsoft.CodeAnalysis.CSharp (2)
Binder\Imports.cs (1)
110expandedUsingsBuilder.Add(new NamespaceOrTypeAndUsingDirective(expandedNamespace, previousUsing.UsingDirective, dependencies: default));
Symbols\Source\SourceNamespaceSymbol.AliasesAndUsings.cs (1)
786getOrCreateUsingsBuilder(ref usings, globalUsingNamespacesOrTypes).Add(new NamespaceOrTypeAndUsingDirective(imported, usingDirective, dependencies: default));
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, 209private class UsingTargetComparer : IEqualityComparer<NamespaceOrTypeAndUsingDirective> 211public static readonly IEqualityComparer<NamespaceOrTypeAndUsingDirective> Instance = new UsingTargetComparer(); 215bool IEqualityComparer<NamespaceOrTypeAndUsingDirective>.Equals(NamespaceOrTypeAndUsingDirective x, NamespaceOrTypeAndUsingDirective y) 220int IEqualityComparer<NamespaceOrTypeAndUsingDirective>.GetHashCode(NamespaceOrTypeAndUsingDirective obj)
Binder\WithUsingNamespacesAndTypesBinder.cs (12)
35internal abstract ImmutableArray<NamespaceOrTypeAndUsingDirective> GetUsings(ConsList<TypeSymbol>? basesBeingResolved); 53foreach (var typeOrNamespace in GetUsings(basesBeingResolved: null)) 88foreach (var nsOrType in this.GetUsings(basesBeingResolved: null)) 137foreach (var typeOrNamespace in this.GetUsings(basesBeingResolved)) 205foreach (var namespaceSymbol in this.GetUsings(basesBeingResolved: null)) 262internal static WithUsingNamespacesAndTypesBinder Create(ImmutableArray<NamespaceOrTypeAndUsingDirective> namespacesOrTypes, Binder next, bool withImportChainEntry = false) 271private ImmutableArray<NamespaceOrTypeAndUsingDirective> _lazyUsings; 281internal override ImmutableArray<NamespaceOrTypeAndUsingDirective> GetUsings(ConsList<TypeSymbol>? basesBeingResolved) 311internal override ImmutableArray<NamespaceOrTypeAndUsingDirective> GetUsings(ConsList<TypeSymbol>? basesBeingResolved) 336private readonly ImmutableArray<NamespaceOrTypeAndUsingDirective> _usings; 338internal FromNamespacesOrTypes(ImmutableArray<NamespaceOrTypeAndUsingDirective> namespacesOrTypes, Binder next, bool withImportChainEntry) 345internal override ImmutableArray<NamespaceOrTypeAndUsingDirective> GetUsings(ConsList<TypeSymbol>? basesBeingResolved)
Compilation\CSharpCompilation.cs (6)
55private ImmutableArray<NamespaceOrTypeAndUsingDirective> _lazyGlobalImports; 1562internal ImmutableArray<NamespaceOrTypeAndUsingDirective> GlobalImports 1565private ImmutableArray<NamespaceOrTypeAndUsingDirective> BindGlobalImports() 1569var previousSubmissionImports = previousSubmission is object ? Imports.ExpandPreviousSubmissionImports(previousSubmission.GlobalImports, this) : ImmutableArray<NamespaceOrTypeAndUsingDirective>.Empty; 1580var boundUsings = ArrayBuilder<NamespaceOrTypeAndUsingDirective>.GetInstance(); 1586foreach (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)
206public ImmutableArray<NamespaceOrTypeAndUsingDirective> GetUsingNamespacesOrTypes(CSharpSyntaxNode declarationSyntax, ConsList<TypeSymbol>? basesBeingResolved) 227return ImmutableArray<NamespaceOrTypeAndUsingDirective>.Empty; 248private ImmutableArray<NamespaceOrTypeAndUsingDirective> GetGlobalUsingNamespacesOrTypes(ConsList<TypeSymbol>? basesBeingResolved) 264var mergedNamespacesOrTypes = ArrayBuilder<NamespaceOrTypeAndUsingDirective>.GetInstance(); 330foreach (var namespaceOrType in namespacesOrTypes) 530internal ImmutableArray<NamespaceOrTypeAndUsingDirective> GetUsingNamespacesOrTypes(SourceNamespaceSymbol declaringSymbol, CSharpSyntaxNode declarationSyntax, ConsList<TypeSymbol>? basesBeingResolved) 540internal ImmutableArray<NamespaceOrTypeAndUsingDirective> GetGlobalUsingNamespacesOrTypes(SourceNamespaceSymbol declaringSymbol, SyntaxReference declarationSyntax, ConsList<TypeSymbol>? basesBeingResolved) 625var globalUsingNamespacesOrTypes = ImmutableArray<NamespaceOrTypeAndUsingDirective>.Empty; 640ArrayBuilder<NamespaceOrTypeAndUsingDirective>? usings = null; 863static PooledHashSet<NamespaceOrTypeSymbol> getOrCreateUniqueUsings(ref PooledHashSet<NamespaceOrTypeSymbol>? uniqueUsings, ImmutableArray<NamespaceOrTypeAndUsingDirective> globalUsingNamespacesOrTypes) 874static PooledHashSet<NamespaceOrTypeSymbol> getOrCreateUniqueGlobalUsingsNotInTree(ref PooledHashSet<NamespaceOrTypeSymbol>? uniqueUsings, ImmutableArray<NamespaceOrTypeAndUsingDirective> globalUsingNamespacesOrTypes, SyntaxTree tree) 885static ArrayBuilder<NamespaceOrTypeAndUsingDirective> getOrCreateUsingsBuilder(ref ArrayBuilder<NamespaceOrTypeAndUsingDirective>? usings, ImmutableArray<NamespaceOrTypeAndUsingDirective> globalUsingNamespacesOrTypes) 889usings = ArrayBuilder<NamespaceOrTypeAndUsingDirective>.GetInstance(); 1001foreach (var @using in usingsAndDiagnostics.UsingNamespacesOrTypes) 1099UsingNamespacesOrTypes = ImmutableArray<NamespaceOrTypeAndUsingDirective>.Empty, 1105public ImmutableArray<NamespaceOrTypeAndUsingDirective> UsingNamespacesOrTypes { get; init; } 1123UsingNamespacesOrTypes = ImmutableArray<NamespaceOrTypeAndUsingDirective>.Empty, 1129public ImmutableArray<NamespaceOrTypeAndUsingDirective> UsingNamespacesOrTypes { get; init; }