5 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)
751getOrCreateUsingsBuilder(ref usings, globalUsingNamespacesOrTypes).Add(new NamespaceOrTypeAndUsingDirective(imported, usingDirective, dependencies: default)); 779getOrCreateUsingsBuilder(ref usings, globalUsingNamespacesOrTypes).Add(new NamespaceOrTypeAndUsingDirective(importedType, usingDirective, directiveDiagnostics.DependenciesBag.ToImmutableArray()));
Microsoft.CodeAnalysis.CSharp.ExpressionEvaluator.ExpressionCompiler (1)
CompilationContext.cs (1)
1191usingsBuilder.Add(new NamespaceOrTypeAndUsingDirective(targetSymbol, usingDirective: null, dependencies: default));
66 references to NamespaceOrTypeAndUsingDirective
Microsoft.CodeAnalysis.CSharp (60)
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 (7)
53private readonly Lazy<ImmutableArray<NamespaceOrTypeAndUsingDirective>> _globalImports; 464_globalImports = new Lazy<ImmutableArray<NamespaceOrTypeAndUsingDirective>>(BindGlobalImports); 1455internal ImmutableArray<NamespaceOrTypeAndUsingDirective> GlobalImports => _globalImports.Value; 1457private ImmutableArray<NamespaceOrTypeAndUsingDirective> BindGlobalImports() 1461var previousSubmissionImports = previousSubmission is object ? Imports.ExpandPreviousSubmissionImports(previousSubmission.GlobalImports, this) : ImmutableArray<NamespaceOrTypeAndUsingDirective>.Empty; 1472var boundUsings = ArrayBuilder<NamespaceOrTypeAndUsingDirective>.GetInstance(); 1478foreach (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)
195public ImmutableArray<NamespaceOrTypeAndUsingDirective> GetUsingNamespacesOrTypes(CSharpSyntaxNode declarationSyntax, ConsList<TypeSymbol>? basesBeingResolved) 216return ImmutableArray<NamespaceOrTypeAndUsingDirective>.Empty; 237private ImmutableArray<NamespaceOrTypeAndUsingDirective> GetGlobalUsingNamespacesOrTypes(ConsList<TypeSymbol>? basesBeingResolved) 253var mergedNamespacesOrTypes = ArrayBuilder<NamespaceOrTypeAndUsingDirective>.GetInstance(); 319foreach (var namespaceOrType in namespacesOrTypes) 519internal ImmutableArray<NamespaceOrTypeAndUsingDirective> GetUsingNamespacesOrTypes(SourceNamespaceSymbol declaringSymbol, CSharpSyntaxNode declarationSyntax, ConsList<TypeSymbol>? basesBeingResolved) 529internal ImmutableArray<NamespaceOrTypeAndUsingDirective> GetGlobalUsingNamespacesOrTypes(SourceNamespaceSymbol declaringSymbol, SyntaxReference declarationSyntax, ConsList<TypeSymbol>? basesBeingResolved) 614var globalUsingNamespacesOrTypes = ImmutableArray<NamespaceOrTypeAndUsingDirective>.Empty; 629ArrayBuilder<NamespaceOrTypeAndUsingDirective>? usings = null; 815static PooledHashSet<NamespaceOrTypeSymbol> getOrCreateUniqueUsings(ref PooledHashSet<NamespaceOrTypeSymbol>? uniqueUsings, ImmutableArray<NamespaceOrTypeAndUsingDirective> globalUsingNamespacesOrTypes) 826static PooledHashSet<NamespaceOrTypeSymbol> getOrCreateUniqueGlobalUsingsNotInTree(ref PooledHashSet<NamespaceOrTypeSymbol>? uniqueUsings, ImmutableArray<NamespaceOrTypeAndUsingDirective> globalUsingNamespacesOrTypes, SyntaxTree tree) 837static ArrayBuilder<NamespaceOrTypeAndUsingDirective> getOrCreateUsingsBuilder(ref ArrayBuilder<NamespaceOrTypeAndUsingDirective>? usings, ImmutableArray<NamespaceOrTypeAndUsingDirective> globalUsingNamespacesOrTypes) 841usings = ArrayBuilder<NamespaceOrTypeAndUsingDirective>.GetInstance(); 953foreach (var @using in usingsAndDiagnostics.UsingNamespacesOrTypes) 1051UsingNamespacesOrTypes = ImmutableArray<NamespaceOrTypeAndUsingDirective>.Empty, 1057public ImmutableArray<NamespaceOrTypeAndUsingDirective> UsingNamespacesOrTypes { get; init; } 1075UsingNamespacesOrTypes = ImmutableArray<NamespaceOrTypeAndUsingDirective>.Empty, 1081public ImmutableArray<NamespaceOrTypeAndUsingDirective> UsingNamespacesOrTypes { get; init; }
Microsoft.CodeAnalysis.CSharp.ExpressionEvaluator.ExpressionCompiler (2)
CompilationContext.cs (2)
1054var usingsBuilder = ArrayBuilder<NamespaceOrTypeAndUsingDirective>.GetInstance(); 1184ArrayBuilder<NamespaceOrTypeAndUsingDirective> usingsBuilder,
Microsoft.CodeAnalysis.CSharp.ExpressionEvaluator.ExpressionCompiler.UnitTests (2)
UsingDebugInfoTests.cs (2)
895var @using = imports.Usings.Single(); 1031var @using = imports.Usings.Single();
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (2)
Semantics\ImportsTests.cs (2)
125ImmutableArray<NamespaceOrTypeAndUsingDirective>.Empty, 130ImmutableArray<NamespaceOrTypeAndUsingDirective>.Empty,