2 interfaces inheriting from INamespaceOrTypeSymbol
Microsoft.CodeAnalysis (2)
Symbols\INamespaceSymbol.cs (1)
18public interface INamespaceSymbol : INamespaceOrTypeSymbol
Symbols\ITypeSymbol.cs (1)
20public interface ITypeSymbol : INamespaceOrTypeSymbol
5 implementations of INamespaceOrTypeSymbol
Microsoft.CodeAnalysis.CodeStyle.Fixes (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationNamespaceOrTypeSymbol.cs (1)
17internal abstract class CodeGenerationNamespaceOrTypeSymbol : CodeGenerationSymbol, INamespaceOrTypeSymbol
Microsoft.CodeAnalysis.CSharp (1)
Symbols\PublicModel\NamespaceOrTypeSymbol.cs (1)
9internal abstract class NamespaceOrTypeSymbol : Symbol, INamespaceOrTypeSymbol
Microsoft.CodeAnalysis.Features (1)
MetadataAsSource\AbstractMetadataAsSourceService.AbstractWrappedNamespaceOrTypeSymbol.cs (1)
14private abstract class AbstractWrappedNamespaceOrTypeSymbol : AbstractWrappedSymbol, INamespaceOrTypeSymbol
Microsoft.CodeAnalysis.VisualBasic (1)
Symbols\NamespaceOrTypeSymbol.vb (1)
20Implements INamespaceOrTypeSymbol, INamespaceOrTypeSymbolInternal
Microsoft.CodeAnalysis.Workspaces (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationNamespaceOrTypeSymbol.cs (1)
17internal abstract class CodeGenerationNamespaceOrTypeSymbol : CodeGenerationSymbol, INamespaceOrTypeSymbol
393 references to INamespaceOrTypeSymbol
ILLink.RoslynAnalyzer (2)
INamedTypeSymbolExtensions.cs (2)
18 INamespaceOrTypeSymbol? currentType = type; 26 currentType = (INamespaceOrTypeSymbol?) currentType.ContainingType ?? currentType.ContainingNamespace;
Microsoft.CodeAnalysis (40)
Compilation\Compilation.cs (2)
345public INamedTypeSymbol CreateErrorTypeSymbol(INamespaceOrTypeSymbol? container, string name, int arity) 360protected abstract INamedTypeSymbol CommonCreateErrorTypeSymbol(INamespaceOrTypeSymbol? container, string name, int arity);
Compilation\IImportScope.cs (3)
76/// Represents an <see cref="INamespaceOrTypeSymbol"/> that has been imported, and the location the import was 82public INamespaceOrTypeSymbol NamespaceOrType { get; } 93internal ImportedNamespaceOrType(INamespaceOrTypeSymbol namespaceOrType, SyntaxReference? declaringSyntaxReference)
Compilation\SemanticModel.cs (6)
465INamespaceOrTypeSymbol? container = null, 477INamespaceOrTypeSymbol? container, 552INamespaceOrTypeSymbol? container = null, 563INamespaceOrTypeSymbol? container, 586INamespaceOrTypeSymbol? container = null, 597INamespaceOrTypeSymbol? container,
DiagnosticAnalyzer\AnalyzerDriver.cs (6)
108private ConcurrentDictionary<(INamespaceOrTypeSymbol, DiagnosticAnalyzer), IGroupedAnalyzerActions>? _lazyPerSymbolAnalyzerActionsCache; 116private ConcurrentDictionary<(INamespaceOrTypeSymbol, DiagnosticAnalyzer), IGroupedAnalyzerActions> PerSymbolAnalyzerActionsCache 435_lazyPerSymbolAnalyzerActionsCache = new ConcurrentDictionary<(INamespaceOrTypeSymbol, DiagnosticAnalyzer), IGroupedAnalyzerActions>(); 1692if (symbol is INamespaceOrTypeSymbol namespaceOrType) 1703async Task processContainerOnMemberCompletedAsync(INamespaceOrTypeSymbol containerSymbol, ISymbol processedMemberSymbol, DiagnosticAnalyzer analyzer) 2154if (symbol is not INamespaceOrTypeSymbol namespaceOrType)
DiagnosticAnalyzer\AnalyzerExecutor.cs (1)
409INamespaceOrTypeSymbol containingSymbol,
DiagnosticAnalyzer\SuppressMessageAttributeState.TargetSymbolResolver.cs (4)
92INamespaceOrTypeSymbol containingSymbol = _compilation.GlobalNamespace; 576INamespaceOrTypeSymbol containingSymbol = _compilation.GlobalNamespace; 828private static INamespaceOrTypeSymbol GetFirstMatchingNamespaceOrType(ImmutableArray<ISymbol> candidateMembers) 830return (INamespaceOrTypeSymbol)candidateMembers
DocumentationCommentId.cs (13)
42private static readonly ListPool<INamespaceOrTypeSymbol> s_namespaceOrTypeListPool = new ListPool<INamespaceOrTypeSymbol>(); 826containers.AddRange(results.OfType<INamespaceOrTypeSymbol>()); 1155private static void GetMatchingTypes(List<INamespaceOrTypeSymbol> containers, string memberName, int arity, List<ISymbol> results) 1163private static void GetMatchingTypes(INamespaceOrTypeSymbol container, string memberName, int arity, List<ISymbol> results) 1180private static void GetMatchingNamespaceOrTypes(List<INamespaceOrTypeSymbol> containers, string memberName, List<ISymbol> results) 1188private static void GetMatchingNamespaceOrTypes(INamespaceOrTypeSymbol container, string memberName, List<ISymbol> results) 1201private static void GetMatchingNamespaces(List<INamespaceOrTypeSymbol> containers, string memberName, List<ISymbol> results) 1209private static void GetMatchingNamespaces(INamespaceOrTypeSymbol container, string memberName, List<ISymbol> results) 1222private static void GetMatchingMethods(string id, ref int index, List<INamespaceOrTypeSymbol> containers, string memberName, int arity, Compilation compilation, List<ISymbol> results) 1289private static void GetMatchingProperties(string id, ref int index, List<INamespaceOrTypeSymbol> containers, string memberName, Compilation compilation, List<ISymbol> results) 1347private static void GetMatchingFields(List<INamespaceOrTypeSymbol> containers, string memberName, List<ISymbol> results) 1363private static void GetMatchingEvents(List<INamespaceOrTypeSymbol> containers, string memberName, List<ISymbol> results)
Symbols\IAliasSymbol.cs (2)
19/// Gets the <see cref="INamespaceOrTypeSymbol"/> for the 22INamespaceOrTypeSymbol Target { get; }
Symbols\INamespaceSymbol.cs (2)
23new IEnumerable<INamespaceOrTypeSymbol> GetMembers(); 28new IEnumerable<INamespaceOrTypeSymbol> GetMembers(string name);
Symbols\ISymbolExtensions.cs (1)
95foreach (var sym in container.GetMembers(name))
Microsoft.CodeAnalysis.CodeStyle (26)
src\Compilers\Core\Portable\DiagnosticAnalyzer\SuppressMessageAttributeState.TargetSymbolResolver.cs (4)
92INamespaceOrTypeSymbol containingSymbol = _compilation.GlobalNamespace; 576INamespaceOrTypeSymbol containingSymbol = _compilation.GlobalNamespace; 828private static INamespaceOrTypeSymbol GetFirstMatchingNamespaceOrType(ImmutableArray<ISymbol> candidateMembers) 830return (INamespaceOrTypeSymbol)candidateMembers
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\INamespaceOrTypeSymbolExtensions.cs (8)
17private static readonly ConditionalWeakTable<INamespaceOrTypeSymbol, List<string>> s_namespaceOrTypeToNameMap = new(); 22public static string GetShortName(this INamespaceOrTypeSymbol symbol) 25public static IEnumerable<IPropertySymbol> GetIndexers(this INamespaceOrTypeSymbol? symbol) 32public static IReadOnlyList<string> GetNameParts(this INamespaceOrTypeSymbol symbol) 74private static void GetNameParts(INamespaceOrTypeSymbol? namespaceOrTypeSymbol, List<string> result) 90this INamespaceOrTypeSymbol namespaceOrTypeSymbol, 93using var _ = ArrayBuilder<INamespaceOrTypeSymbol>.GetInstance(out var stack); 96while (stack.TryPop(out var current))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.cs (2)
529var namespaceOrType = symbol is IAliasSymbol alias ? alias.Target : symbol as INamespaceOrTypeSymbol;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.ErrorTypeSymbolKey.cs (2)
96foreach (var container in containingSymbolResolution.OfType<INamespaceOrTypeSymbol>())
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.NamedTypeSymbolKey.cs (5)
128foreach (var container in containingSymbolResolution.OfType<INamespaceOrTypeSymbol>()) 156foreach (var nsOrType in containingSymbolResolution.OfType<INamespaceOrTypeSymbol>()) 168INamespaceOrTypeSymbol container,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.NamespaceSymbolKey.cs (1)
103foreach (var member in namespaceSymbol.GetMembers(metadataName))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (1)
698=> symbol is INamespaceOrTypeSymbol or { IsStatic: true };
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AliasSymbolCache.cs (3)
15using TreeMap = ConcurrentDictionary<(SyntaxTree tree, int namespaceId), ImmutableDictionary<INamespaceOrTypeSymbol, IAliasSymbol>>; 30INamespaceOrTypeSymbol targetSymbol, 59var builder = ImmutableDictionary.CreateBuilder<INamespaceOrTypeSymbol, IAliasSymbol>();
Microsoft.CodeAnalysis.CodeStyle.Fixes (15)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService.cs (2)
232INamespaceOrTypeSymbol destination, 465public Task<Document> AddNamespaceOrTypeAsync(CodeGenerationSolutionContext context, INamespaceSymbol destination, INamespaceOrTypeSymbol namespaceOrType, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService_FindDeclaration.cs (3)
128INamespaceOrTypeSymbol namespaceOrType, 138INamespaceOrTypeSymbol namespaceOrType, 145var symbol = namespaceOrType;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationSymbolFactory.cs (1)
508public static INamespaceSymbol CreateNamespaceSymbol(string name, IList<ISymbol>? imports = null, IList<INamespaceOrTypeSymbol>? members = null)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerator.cs (1)
79public static Task<Document> AddNamespaceOrTypeDeclarationAsync(CodeGenerationSolutionContext context, INamespaceSymbol destination, INamespaceOrTypeSymbol namespaceOrType, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\ICodeGenerationService.cs (2)
169Task<Document> AddNamespaceOrTypeAsync(CodeGenerationSolutionContext context, INamespaceSymbol destination, INamespaceOrTypeSymbol namespaceOrType, CancellationToken cancellationToken); 192Task<SyntaxNode?> FindMostRelevantNameSpaceOrTypeDeclarationAsync(Solution solution, INamespaceOrTypeSymbol namespaceOrType, Location? location, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationNamespaceSymbol.cs (5)
14internal sealed class CodeGenerationNamespaceSymbol(string name, IList<INamespaceOrTypeSymbol> members) : CodeGenerationNamespaceOrTypeSymbol(null, null, default, Accessibility.NotApplicable, default, name), INamespaceSymbol 16private readonly IList<INamespaceOrTypeSymbol> _members = members ?? SpecializedCollections.EmptyList<INamespaceOrTypeSymbol>(); 36public new IEnumerable<INamespaceOrTypeSymbol> GetMembers() 39IEnumerable<INamespaceOrTypeSymbol> INamespaceSymbol.GetMembers(string name)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\SimplificationHelpers.cs (1)
105if (expressionInfo.Symbol is INamespaceOrTypeSymbol)
Microsoft.CodeAnalysis.CSharp (25)
Compilation\CSharpCompilation.cs (1)
323protected override INamedTypeSymbol CommonCreateErrorTypeSymbol(INamespaceOrTypeSymbol? container, string name, int arity)
Compilation\CSharpSemanticModel.cs (3)
5279protected sealed override ImmutableArray<ISymbol> LookupSymbolsCore(int position, INamespaceOrTypeSymbol container, string name, bool includeReducedExtensionMethods) 5289protected sealed override ImmutableArray<ISymbol> LookupStaticMembersCore(int position, INamespaceOrTypeSymbol container, string name) 5294protected sealed override ImmutableArray<ISymbol> LookupNamespacesAndTypesCore(int position, INamespaceOrTypeSymbol container, string name)
SymbolDisplay\SymbolDisplayVisitor.cs (2)
23private IDictionary<INamespaceOrTypeSymbol, IAliasSymbol>? _lazyAliasMap; 47IDictionary<INamespaceOrTypeSymbol, IAliasSymbol>? aliasMap,
SymbolDisplay\SymbolDisplayVisitor_Minimal.cs (6)
19INamespaceOrTypeSymbol symbol, 171private IDictionary<INamespaceOrTypeSymbol, IAliasSymbol> CreateAliasMap() 175return SpecializedCollections.EmptyDictionary<INamespaceOrTypeSymbol, IAliasSymbol>(); 213var builder = ImmutableDictionary.CreateBuilder<INamespaceOrTypeSymbol, IAliasSymbol>(); 304private IDictionary<INamespaceOrTypeSymbol, IAliasSymbol> AliasMap 319private IAliasSymbol? GetAliasSymbol(INamespaceOrTypeSymbol symbol)
Symbols\PublicModel\AliasSymbol.cs (1)
21INamespaceOrTypeSymbol IAliasSymbol.Target
Symbols\PublicModel\NamespaceOrTypeSymbol.cs (7)
13ImmutableArray<ISymbol> INamespaceOrTypeSymbol.GetMembers() 18ImmutableArray<ISymbol> INamespaceOrTypeSymbol.GetMembers(string name) 23ImmutableArray<INamedTypeSymbol> INamespaceOrTypeSymbol.GetTypeMembers() 28ImmutableArray<INamedTypeSymbol> INamespaceOrTypeSymbol.GetTypeMembers(string name) 33ImmutableArray<INamedTypeSymbol> INamespaceOrTypeSymbol.GetTypeMembers(string name, int arity) 38bool INamespaceOrTypeSymbol.IsNamespace => UnderlyingSymbol.Kind == SymbolKind.Namespace; 40bool INamespaceOrTypeSymbol.IsType => UnderlyingSymbol.Kind != SymbolKind.Namespace;
Symbols\PublicModel\NamespaceSymbol.cs (2)
41IEnumerable<INamespaceOrTypeSymbol> INamespaceSymbol.GetMembers() 49IEnumerable<INamespaceOrTypeSymbol> INamespaceSymbol.GetMembers(string name)
Symbols\SymbolExtensions.cs (3)
408internal static NamespaceOrTypeSymbol? EnsureCSharpSymbolOrNull(this INamespaceOrTypeSymbol? symbol, string paramName) 611internal static INamespaceOrTypeSymbol? GetPublicSymbol(this NamespaceOrTypeSymbol? symbol) 613return symbol.GetPublicSymbol<INamespaceOrTypeSymbol>();
Microsoft.CodeAnalysis.CSharp.CodeStyle (2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SemanticModelExtensions.cs (2)
110INamespaceOrTypeSymbol symbol = null; 121symbol = symbolInfo.Symbol as INamespaceOrTypeSymbol;
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (9)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\NamespaceGenerator.cs (2)
162else if (symbol is INamespaceOrTypeSymbol namespaceOrType) 174private static NameSyntax GenerateName(INamespaceOrTypeSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (1)
3048var target = ((IAliasSymbol)symbol).Target;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.cs (5)
30public static NameSyntax GenerateNameSyntax(this INamespaceOrTypeSymbol symbol, bool allowVar = true) 33public static TypeSyntax GenerateTypeSyntax(this INamespaceOrTypeSymbol symbol, bool allowVar = true) 37INamespaceOrTypeSymbol symbol, bool nameSyntax, bool allowVar = true) 75this INamespaceOrTypeSymbol symbol) 85this INamespaceOrTypeSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.TypeSyntaxGeneratorVisitor.cs (1)
343private static TypeSyntax AddGlobalAlias(INamespaceOrTypeSymbol symbol, SimpleNameSyntax syntax)
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (7)
SymbolKey\SymbolKeyCompilationsTests.cs (2)
267var members1 = symbols1.OfType<INamespaceOrTypeSymbol>().SelectMany(n => n.GetMembers()).ToList(); 268var members2 = symbols2.OfType<INamespaceOrTypeSymbol>().SelectMany(n => n.GetMembers()).ToList();
SymbolKey\SymbolKeyTestBase.cs (2)
218private static void GetSourceMemberSymbols(INamespaceOrTypeSymbol symbol, List<ISymbol> list, LocalSymbolDumper localDumper) 228GetSourceMemberSymbols((INamespaceOrTypeSymbol)memberSymbol, list, localDumper);
SymbolKey\SymbolKeyTests.cs (2)
47var type = compilation.GlobalNamespace.GetMembers("C1").Single(); 86var type = members[0];
Workspaces\WorkspaceTests_EditorFeatures.cs (1)
415var classC = compilation.SourceModule.GlobalNamespace.GetMembers("C").Single();
Microsoft.CodeAnalysis.CSharp.Features (16)
AddImport\CSharpAddImportFeatureService.cs (7)
288INamespaceOrTypeSymbol namespaceOrTypeSymbol, 327private static string GetUsingDirectiveString(INamespaceOrTypeSymbol namespaceOrTypeSymbol) 337INamespaceOrTypeSymbol namespaceOrTypeSymbol, 348Document document, CompilationUnitSyntax root, SyntaxNode contextNode, INamespaceOrTypeSymbol namespaceOrTypeSymbol, 416INamespaceOrTypeSymbol namespaceSymbol, 434INamespaceOrTypeSymbol namespaceOrTypeSymbol, 553INamespaceOrTypeSymbol namespaceSymbol,
Completion\CompletionProviders\CrefCompletionProvider.cs (3)
216var container = (leftSymbol ?? leftType) as INamespaceOrTypeSymbol; 287if (symbol is INamespaceOrTypeSymbol && token.IsKind(SyntaxKind.DotToken))
DecompiledSource\CSharpDecompiledSourceService.cs (2)
112for (INamespaceOrTypeSymbol? symbol = containingType; 114symbol = (INamespaceOrTypeSymbol?)symbol.ContainingType ?? symbol.ContainingNamespace)
GenerateType\CSharpGenerateTypeService.cs (1)
567public override async Task<(INamespaceSymbol, INamespaceOrTypeSymbol, Location)> GetOrGenerateEnclosingNamespaceSymbolAsync(
SignatureHelp\GenericNameSignatureHelpProvider.cs (2)
97: semanticModel.GetSymbolInfo(beforeDotExpression, cancellationToken).GetAnySymbol() as INamespaceOrTypeSymbol; 100: semanticModel.GetTypeInfo(beforeDotExpression, cancellationToken).Type as INamespaceOrTypeSymbol;
SignatureHelp\InvocationExpressionSignatureHelpProviderBase_MethodGroup.cs (1)
62(throughSymbol is not INamespaceOrTypeSymbol && semanticModel.LookupSymbols(throughExpression.SpanStart, container: throughSymbol?.ContainingType).Any(static s => s is not INamedTypeSymbol));
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (6)
Compilation\SemanticModelGetDeclaredSymbolAPITests.cs (6)
1146var container = (INamespaceOrTypeSymbol)symbols.Single(); 2167Func<int, INamespaceOrTypeSymbol, string, bool, ImmutableArray<ISymbol>> lookupAttributeTypeWithQualifier = (pos, qualifierOpt, name, isVerbatim) => 2213var qnInvalidWithoutSuffix = (INamespaceOrTypeSymbol)qnSymbols[0]; 3756var memSymbol = compilation.GlobalNamespace.GetMembers("System").Single();
Microsoft.CodeAnalysis.CSharp.Test.Utilities (10)
CompilationTestUtils.cs (1)
341public static List<string> LookupNames(this SemanticModel model, int position, INamespaceOrTypeSymbol container = null, bool namespacesAndTypesOnly = false, bool useBaseReferenceAccessibility = false)
Extensions.cs (9)
257private static ImmutableArray<ISymbol> GetMembers(INamespaceOrTypeSymbol container, string qualifiedName, out INamespaceOrTypeSymbol lastContainer) 264var nestedContainer = (INamespaceOrTypeSymbol)lastContainer.GetMember(parts[i]); 296public static ISymbol GetMember(this INamespaceOrTypeSymbol container, string qualifiedName) 298INamespaceOrTypeSymbol lastContainer; 317public static T GetMember<T>(this INamespaceOrTypeSymbol symbol, string qualifiedName) where T : ISymbol 347public static INamedTypeSymbol GetTypeMember(this INamespaceOrTypeSymbol symbol, string name) 861foreach (var sym in ns.GetMembers(name))
Microsoft.CodeAnalysis.CSharp.Workspaces (26)
CodeGeneration\CSharpSyntaxGenerator.cs (1)
3414public override SyntaxNode NameExpression(INamespaceOrTypeSymbol namespaceOrTypeSymbol)
Recommendations\CSharpRecommendationServiceRunner.cs (5)
531if (nameBinding.Symbol is not INamespaceOrTypeSymbol symbol) 576if (boundSymbol.Symbol is not INamespaceOrTypeSymbol namespaceOrType) 588if (reinterpretedSymbol is not INamespaceOrTypeSymbol) 616.WhereAsArray(symbol => symbol is INamespaceOrTypeSymbol or IFieldSymbol { IsConst: true } 713if (reinterpretedSymbol is INamespaceOrTypeSymbol)
Simplification\CSharpSimplificationService.Expander.cs (2)
460var aliasTarget = aliasInfo.Target; 653(INamespaceOrTypeSymbol)symbol,
Simplification\Simplifiers\AbstractCSharpSimplifier.cs (3)
179aliasReplacement = GetAliasForSymbol((INamespaceOrTypeSymbol)symbol, node.GetFirstToken(), semanticModel, cancellationToken); 289if (symbolInfo.Symbol is not INamespaceOrTypeSymbol) 314private static IAliasSymbol GetAliasForSymbol(INamespaceOrTypeSymbol symbol, SyntaxToken token, SemanticModel semanticModel, CancellationToken cancellationToken)
Simplification\Simplifiers\ExpressionSimplifier.cs (1)
228var containsNamespaceOrTypeSymbol = actualSymbol is INamespaceOrTypeSymbol;
Simplification\Simplifiers\NameSimplifier.cs (1)
97if (symbol is not INamespaceOrTypeSymbol)
Simplification\Simplifiers\QualifiedCrefSimplifier.cs (1)
85var speculativeBindingOption = oldSymbol is INamespaceOrTypeSymbol
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SemanticModelExtensions.cs (2)
110INamespaceOrTypeSymbol symbol = null; 121symbol = symbolInfo.Symbol as INamespaceOrTypeSymbol;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\NamespaceGenerator.cs (2)
162else if (symbol is INamespaceOrTypeSymbol namespaceOrType) 174private static NameSyntax GenerateName(INamespaceOrTypeSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (1)
3048var target = ((IAliasSymbol)symbol).Target;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.cs (5)
30public static NameSyntax GenerateNameSyntax(this INamespaceOrTypeSymbol symbol, bool allowVar = true) 33public static TypeSyntax GenerateTypeSyntax(this INamespaceOrTypeSymbol symbol, bool allowVar = true) 37INamespaceOrTypeSymbol symbol, bool nameSyntax, bool allowVar = true) 75this INamespaceOrTypeSymbol symbol) 85this INamespaceOrTypeSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.TypeSyntaxGeneratorVisitor.cs (1)
343private static TypeSyntax AddGlobalAlias(INamespaceOrTypeSymbol symbol, SimpleNameSyntax syntax)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\TypeSyntaxExtensions.cs (1)
47var typeSymbol = firstSymbol != null && firstSymbol.Kind == SymbolKind.Alias
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (13)
CodeGeneration\SymbolEditorTests.cs (5)
193var symbolA = comp.GlobalNamespace.GetMembers("A").First(); 194var symbolB = comp.GlobalNamespace.GetMembers("B").First(); 239var symbolA = comp.GlobalNamespace.GetMembers("A").First(); 240var symbolB = comp.GlobalNamespace.GetMembers("B").First(); 317var symbol = comp.GlobalNamespace.GetMembers("C").First();
CodeGeneration\SyntaxGeneratorTests.cs (8)
1669var symbol = compilation.GlobalNamespace.GetMembers("I").Single(); 4129var symbolC = comp.GlobalNamespace.GetMembers("C").First(); 4276var symbolC = comp.GlobalNamespace.GetMembers("C").First(); 4306var symbolC = comp.GlobalNamespace.GetMembers("C").First(); 4398var symbolC = comp.GlobalNamespace.GetMembers("C").First(); 4671var symbol = comp.GlobalNamespace.GetMembers("C").First(); 4910var symbol = compilation.GlobalNamespace.GetMembers("S").Single(); 4966var symbol = compilation.GlobalNamespace.GetMembers("C").Single();
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (6)
CodeGeneration\CodeGenerationTests.cs (6)
42IList<INamespaceOrTypeSymbol> members = null, 642var symbol = TestContext.GetSelectedSymbol<INamespaceOrTypeSymbol>(destSpan, semanticModel); 643var destination = testContext.GetDestination(); 889public INamespaceOrTypeSymbol GetDestination() 892return GetSelectedSymbol<INamespaceOrTypeSymbol>(destSpan, this.SemanticModel);
Microsoft.CodeAnalysis.Features (37)
AddImport\AbstractAddImportFeatureService.cs (2)
55protected abstract Task<Document> AddImportAsync(SyntaxNode contextNode, INamespaceOrTypeSymbol symbol, Document document, AddImportPlacementOptions options, CancellationToken cancellationToken); 61protected abstract (string description, bool hasExistingImport) GetDescription(Document document, AddImportPlacementOptions options, INamespaceOrTypeSymbol symbol, SemanticModel semanticModel, SyntaxNode root, CancellationToken cancellationToken);
AddImport\References\MetadataSymbolReference.cs (1)
23SymbolResult<INamespaceOrTypeSymbol> symbolResult,
AddImport\References\ProjectSymbolReference.cs (1)
29SymbolResult<INamespaceOrTypeSymbol> symbolResult,
AddImport\References\SymbolReference.cs (2)
23SymbolResult<INamespaceOrTypeSymbol> symbolResult) : Reference(provider, new SearchResult(symbolResult)) 25public readonly SymbolResult<INamespaceOrTypeSymbol> SymbolResult = symbolResult;
AddImport\SearchScopes\MetadataSymbolsSearchScope.cs (1)
30searchResult.WithSymbol<INamespaceOrTypeSymbol>(searchResult.Symbol),
AddImport\SearchScopes\ProjectSearchScope.cs (1)
28provider, symbol.WithSymbol<INamespaceOrTypeSymbol>(symbol.Symbol), _project);
AddImport\SearchScopes\SearchScope.cs (1)
38public abstract SymbolReference CreateReference<T>(SymbolResult<T> symbol) where T : INamespaceOrTypeSymbol;
AddImport\SymbolResult.cs (1)
29public SearchResult(SymbolResult<INamespaceOrTypeSymbol> result)
Completion\Providers\AbstractPartialTypeCompletionProvider.cs (1)
90if (declaredSymbol.ContainingSymbol is not INamespaceOrTypeSymbol containingSymbol)
Debugging\AbstractBreakpointResolver.cs (5)
158private static bool MatchesName(INamespaceOrTypeSymbol typeOrNamespace, NameAndArity nameAndArity, IEqualityComparer<string> comparer) 177INamespaceOrTypeSymbol container = type; 188container = ((INamespaceOrTypeSymbol)container.ContainingType) ?? container.ContainingNamespace; 200private IEnumerable<ISymbol> FindMembers(IEnumerable<INamespaceOrTypeSymbol> containers, params NameAndArity[] names) 292private static IEnumerable<INamedTypeSymbol> GetTypeMembersRecursive(INamespaceOrTypeSymbol container)
FullyQualify\AbstractFullyQualifyService.cs (4)
198var container = symbolResult.Symbol; 220private async Task<IEnumerable<TextChange>> ProcessNodeAsync(Document document, TSimpleNameSyntax simpleName, string containerName, INamespaceOrTypeSymbol originalSymbol, CancellationToken cancellationToken) 298var containingSymbol = symbolResult.Symbol.ContainingSymbol as INamespaceOrTypeSymbol;
FullyQualify\AbstractFullyQualifyService.SymbolResult.cs (6)
16public readonly INamespaceOrTypeSymbol Symbol; 18public readonly INamespaceOrTypeSymbol? OriginalSymbol; 21public SymbolResult(INamespaceOrTypeSymbol symbol, int weight) 26private SymbolResult(INamespaceOrTypeSymbol symbol, int weight, INamespaceOrTypeSymbol? originalSymbol) 43public SymbolResult WithSymbol(INamespaceOrTypeSymbol other)
GenerateType\AbstractGenerateTypeService.cs (1)
69public abstract Task<(INamespaceSymbol, INamespaceOrTypeSymbol, Location)> GetOrGenerateEnclosingNamespaceSymbolAsync(INamedTypeSymbol namedTypeSymbol, string[] containers, Document selectedDocument, SyntaxNode selectedDocumentRoot, CancellationToken cancellationToken);
GenerateType\AbstractGenerateTypeService.Editor.cs (1)
417(INamespaceSymbol, INamespaceOrTypeSymbol, Location) enclosingNamespaceGeneratedTypeToAddAndLocation;
GenerateType\IGenerateTypeService.cs (1)
17Task<(INamespaceSymbol, INamespaceOrTypeSymbol, Location)> GetOrGenerateEnclosingNamespaceSymbolAsync(INamedTypeSymbol namedTypeSymbol, string[] containers, Document selectedDocument, SyntaxNode selectedDocumentRoot, CancellationToken cancellationToken);
MetadataAsSource\AbstractMetadataAsSourceService.AbstractWrappedNamespaceOrTypeSymbol.cs (2)
16private readonly INamespaceOrTypeSymbol _symbol; 18protected AbstractWrappedNamespaceOrTypeSymbol(INamespaceOrTypeSymbol symbol, bool canImplementImplicitly, IDocumentationCommentFormattingService docCommentFormattingService)
MetadataAsSource\AbstractMetadataAsSourceService.cs (2)
94private static INamespaceOrTypeSymbol CreateCodeGenerationSymbol(Document document, ISymbol symbol) 103INamespaceOrTypeSymbol wrappedType = new WrappedNamedTypeSymbol(topLevelNamedType, canImplementImplicitly, docCommentFormattingService);
src\Compilers\Core\Portable\DiagnosticAnalyzer\SuppressMessageAttributeState.TargetSymbolResolver.cs (4)
92INamespaceOrTypeSymbol containingSymbol = _compilation.GlobalNamespace; 576INamespaceOrTypeSymbol containingSymbol = _compilation.GlobalNamespace; 828private static INamespaceOrTypeSymbol GetFirstMatchingNamespaceOrType(ImmutableArray<ISymbol> candidateMembers) 830return (INamespaceOrTypeSymbol)candidateMembers
Microsoft.CodeAnalysis.VisualBasic (25)
Compilation\SemanticModel.vb (7)
1598Optional container As INamespaceOrTypeSymbol = Nothing, 1682Optional container As INamespaceOrTypeSymbol = Nothing, 1714Optional container As INamespaceOrTypeSymbol = Nothing, 3216Protected NotOverridable Overrides Function LookupSymbolsCore(position As Integer, container As INamespaceOrTypeSymbol, name As String, includeReducedExtensionMethods As Boolean) As ImmutableArray(Of ISymbol) 3224Protected NotOverridable Overrides Function LookupStaticMembersCore(position As Integer, container As INamespaceOrTypeSymbol, name As String) As ImmutableArray(Of ISymbol) 3228Protected NotOverridable Overrides Function LookupNamespacesAndTypesCore(position As Integer, container As INamespaceOrTypeSymbol, name As String) As ImmutableArray(Of ISymbol) 3236Private Shared Function ToLanguageSpecific(container As INamespaceOrTypeSymbol) As NamespaceOrTypeSymbol
Compilation\VisualBasicCompilation.vb (1)
2835Protected Overrides Function CommonCreateErrorTypeSymbol(container As INamespaceOrTypeSymbol, name As String, arity As Integer) As INamedTypeSymbol
SymbolDisplay\SymbolDisplayVisitor_Minimal.vb (2)
125symbol As INamespaceOrTypeSymbol, 148Private Function GetAliasSymbol(symbol As INamespaceOrTypeSymbol) As IAliasSymbol
Symbols\AliasSymbol.vb (1)
109Private ReadOnly Property IAliasSymbol_Target As INamespaceOrTypeSymbol Implements IAliasSymbol.Target
Symbols\NamespaceOrTypeSymbol.vb (7)
31Public ReadOnly Property IsNamespace As Boolean Implements INamespaceOrTypeSymbol.IsNamespace 40Public ReadOnly Property IsType As Boolean Implements INamespaceOrTypeSymbol.IsType 268Private Function INamespaceOrTypeSymbol_GetMembers() As ImmutableArray(Of ISymbol) Implements INamespaceOrTypeSymbol.GetMembers 272Private Function INamespaceOrTypeSymbol_GetMembers(name As String) As ImmutableArray(Of ISymbol) Implements INamespaceOrTypeSymbol.GetMembers 276Private Function INamespaceOrTypeSymbol_GetTypeMembers() As ImmutableArray(Of INamedTypeSymbol) Implements INamespaceOrTypeSymbol.GetTypeMembers 280Private Function INamespaceOrTypeSymbol_GetTypeMembers(name As String) As ImmutableArray(Of INamedTypeSymbol) Implements INamespaceOrTypeSymbol.GetTypeMembers 284Public Function INamespaceOrTypeSymbol_GetTypeMembers(name As String, arity As Integer) As ImmutableArray(Of INamedTypeSymbol) Implements INamespaceOrTypeSymbol.GetTypeMembers
Symbols\NamespaceSymbol.vb (4)
539Private Function INamespaceSymbol_GetMembers() As IEnumerable(Of INamespaceOrTypeSymbol) Implements INamespaceSymbol.GetMembers 540Return Me.GetMembers().OfType(Of INamespaceOrTypeSymbol)() 543Private Function INamespaceSymbol_GetMembers(name As String) As IEnumerable(Of INamespaceOrTypeSymbol) Implements INamespaceSymbol.GetMembers 544Return Me.GetMembers(name).OfType(Of INamespaceOrTypeSymbol)()
VisualBasicExtensions.vb (3)
755Public Function MemberImports(compilation As Compilation) As ImmutableArray(Of INamespaceOrTypeSymbol) 758Return StaticCast(Of INamespaceOrTypeSymbol).From(vbcomp.MemberImports) 760Return ImmutableArray.Create(Of INamespaceOrTypeSymbol)()
Microsoft.CodeAnalysis.VisualBasic.CodeStyle (4)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SemanticModelExtensions.vb (2)
53Dim symbol As INamespaceOrTypeSymbol = Nothing 61symbol = TryCast(symbolInfo.Symbol, INamespaceOrTypeSymbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Helpers\RemoveUnnecessaryImports\VisualBasicUnnecessaryImportsProvider.vb (2)
117Dim namespaceOrType = TryCast(semanticInfo.Symbol, INamespaceOrTypeSymbol) 140Dim namespaceOrType = TryCast(semanticInfo.Symbol, INamespaceOrTypeSymbol)
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (5)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\NamespaceGenerator.vb (3)
115ElseIf TypeOf import Is INamespaceOrTypeSymbol Then 116Dim name = GenerateName(DirectCast(import, INamespaceOrTypeSymbol)) 127Private Function GenerateName(symbol As INamespaceOrTypeSymbol) As NameSyntax
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\INamespaceOrTypeSymbolExtensions.vb (2)
14Public Function GenerateTypeSyntax(symbol As INamespaceOrTypeSymbol, Optional addGlobal As Boolean = True) As TypeSyntax 19Public Function GetAliasForSymbol(symbol As INamespaceOrTypeSymbol, node As SyntaxNode, semanticModel As SemanticModel) As IAliasSymbol
Microsoft.CodeAnalysis.VisualBasic.Features (14)
AddImport\VisualBasicAddImportFeatureService.vb (3)
190symbol As INamespaceOrTypeSymbol, 202Private Shared Function GetImportsStatement(symbol As INamespaceOrTypeSymbol) As ImportsStatementSyntax 278symbol As INamespaceOrTypeSymbol,
Completion\CompletionProviders\CrefCompletionProvider.vb (1)
180Dim container = TryCast(If(leftSymbol, leftType), INamespaceOrTypeSymbol)
Completion\CompletionProviders\HandlesClauseCompletionProvider.vb (1)
94Dim symbols = context.SemanticModel.LookupSymbols(context.Position, DirectCast(containingType, INamespaceOrTypeSymbol), includeReducedExtensionMethods:=True)
Completion\CompletionProviders\ImplementsClauseCompletionProvider.vb (6)
117If TypeOf symbol Is INamespaceOrTypeSymbol Then 164Dim container As INamespaceOrTypeSymbol = leftHandTypeInfo.Type 166container = TryCast(leftHandBinding.Symbol, INamespaceOrTypeSymbol) 170container = TryCast(leftHandBinding.CandidateSymbols.FirstOrDefault(), INamespaceOrTypeSymbol) 247If node IsNot Nothing AndAlso semanticModel IsNot Nothing AndAlso TypeOf symbol Is INamespaceOrTypeSymbol Then 248Dim aliasSymbol = DirectCast(symbol, INamespaceOrTypeSymbol).GetAliasForSymbol(node, semanticModel)
GenerateType\VisualBasicGenerateTypeService.vb (1)
426Public Overrides Async Function GetOrGenerateEnclosingNamespaceSymbolAsync(namedTypeSymbol As INamedTypeSymbol, containers() As String, selectedDocument As Document, selectedDocumentRoot As SyntaxNode, cancellationToken As CancellationToken) As Task(Of (INamespaceSymbol, INamespaceOrTypeSymbol, Location))
SignatureHelp\GenericNameSignatureHelpProvider.vb (2)
75TryCast(semanticModel.GetSymbolInfo(beforeDotExpression, cancellationToken).GetAnySymbol(), INamespaceOrTypeSymbol)) 77TryCast(semanticModel.GetTypeInfo(beforeDotExpression, cancellationToken).Type, INamespaceOrTypeSymbol))
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (1)
Compilation\GetImportScopesTests.vb (1)
43Private Shared Function IsNamespaceWithName(symbol As INamespaceOrTypeSymbol, name As String) As Boolean
Microsoft.CodeAnalysis.VisualBasic.Test.Utilities (1)
CompilationTestUtils.vb (1)
1249Optional container As INamespaceOrTypeSymbol = Nothing,
Microsoft.CodeAnalysis.VisualBasic.Workspaces (21)
CaseCorrection\VisualBasicCaseCorrectionService.Rewriter.vb (2)
167Return TypeOf symbol Is INamespaceOrTypeSymbol OrElse 168(TypeOf symbol Is IAliasSymbol AndAlso TypeOf DirectCast(symbol, IAliasSymbol).Target Is INamespaceOrTypeSymbol) OrElse
CodeGeneration\VisualBasicSyntaxGenerator.vb (1)
382Public Overrides Function NameExpression(namespaceOrTypeSymbol As INamespaceOrTypeSymbol) As SyntaxNode
Recommendations\VisualBasicRecommendationServiceRunner.vb (5)
168Dim leftHandSymbol = TryCast(leftHandSymbolInfo.Symbol, INamespaceOrTypeSymbol) 247container = DirectCast(firstSymbol, INamespaceOrTypeSymbol) 266If TypeOf leftHandSymbolInfo.Symbol IsNot INamespaceOrTypeSymbol AndAlso speculativeAliasBinding Is Nothing AndAlso Equals(firstSymbol.GetSymbolType(), speculativeTypeBinding.Type) Then 469Private Function IsOrContainsValidAccessibleInterface(namespaceOrTypeSymbol As INamespaceOrTypeSymbol, within As ISymbol) As Boolean 517Private Function IsOrContainsValidAccessibleClass(namespaceOrTypeSymbol As INamespaceOrTypeSymbol, within As ISymbol) As Boolean
Simplification\Simplifiers\AbstractVisualBasicSimplifier.vb (2)
106If symbol Is Nothing OrElse Not TypeOf (symbol) Is INamespaceOrTypeSymbol Then 125aliasReplacement = DirectCast(symbol, INamespaceOrTypeSymbol).GetAliasForSymbol(node, semanticModel)
Simplification\Simplifiers\NameSimplifier.vb (1)
54If Not TypeOf symbol Is INamespaceOrTypeSymbol Then
Simplification\VisualBasicSimplificationService.Expander.vb (1)
636DirectCast(symbol, INamespaceOrTypeSymbol),
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SemanticModelExtensions.vb (2)
53Dim symbol As INamespaceOrTypeSymbol = Nothing 61symbol = TryCast(symbolInfo.Symbol, INamespaceOrTypeSymbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Helpers\RemoveUnnecessaryImports\VisualBasicUnnecessaryImportsProvider.vb (2)
117Dim namespaceOrType = TryCast(semanticInfo.Symbol, INamespaceOrTypeSymbol) 140Dim namespaceOrType = TryCast(semanticInfo.Symbol, INamespaceOrTypeSymbol)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\NamespaceGenerator.vb (3)
115ElseIf TypeOf import Is INamespaceOrTypeSymbol Then 116Dim name = GenerateName(DirectCast(import, INamespaceOrTypeSymbol)) 127Private Function GenerateName(symbol As INamespaceOrTypeSymbol) As NameSyntax
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\INamespaceOrTypeSymbolExtensions.vb (2)
14Public Function GenerateTypeSyntax(symbol As INamespaceOrTypeSymbol, Optional addGlobal As Boolean = True) As TypeSyntax 19Public Function GetAliasForSymbol(symbol As INamespaceOrTypeSymbol, node As SyntaxNode, semanticModel As SemanticModel) As IAliasSymbol
Microsoft.CodeAnalysis.Workspaces (66)
Editing\SyntaxGenerator.cs (2)
990public SyntaxNode AliasImportDeclaration(string aliasIdentifierName, INamespaceOrTypeSymbol symbol) 1924public abstract SyntaxNode NameExpression(INamespaceOrTypeSymbol namespaceOrTypeSymbol);
FindSymbols\SymbolTree\SymbolTreeInfo.cs (2)
397int index, INamespaceOrTypeSymbol rootContainer, ref TemporaryArray<ISymbol> results, CancellationToken cancellationToken) 420if (containerSymbol is INamespaceOrTypeSymbol nsOrType)
FindSymbols\SymbolTree\SymbolTreeInfo_Source.cs (9)
19private static readonly ObjectPool<MultiDictionary<string, INamespaceOrTypeSymbol>> s_symbolMapPool = new(() => []); 21private static MultiDictionary<string, INamespaceOrTypeSymbol> AllocateSymbolMap() 24private static void FreeSymbolMap(MultiDictionary<string, INamespaceOrTypeSymbol> symbolMap) 151MultiDictionary<string, INamespaceOrTypeSymbol>.ValueSet symbolsWithSameName, 166foreach (var symbol in symbolsWithSameName) 184foreach (var symbol in symbolsWithSameName) 202private static void AddChildNamespacesAndTypes(INamespaceOrTypeSymbol symbol, MultiDictionary<string, INamespaceOrTypeSymbol> symbolMap) 206foreach (var childNamespaceOrType in namespaceSymbol.GetMembers())
Recommendations\AbstractRecommendationServiceRunner.cs (4)
288protected ImmutableArray<ISymbol> GetSymbolsForEnumBaseList(INamespaceOrTypeSymbol container) 375if (container is not INamespaceOrTypeSymbol namespaceOrType) 389INamespaceOrTypeSymbol container, int position, bool excludeInstance) 528protected static ImmutableArray<ISymbol> SuppressDefaultTupleElements(INamespaceOrTypeSymbol container, ImmutableArray<ISymbol> symbols)
Rename\ConflictEngine\ConflictResolver.cs (2)
275if (renamedSymbol.IsKind(SymbolKind.NamedType) && renamedSymbol.ContainingSymbol is INamespaceOrTypeSymbol) 277var otherThingsNamedTheSame = ((INamespaceOrTypeSymbol)renamedSymbol.ContainingSymbol).GetMembers(renamedSymbol.Name)
Rename\SymbolicRenameLocations.ReferenceProcessing.cs (2)
77var target = ((IAliasSymbol)originalSymbol).Target; 85case INamespaceOrTypeSymbol s:
Shared\Extensions\INamedTypeSymbolExtensions.cs (2)
11public static INamespaceOrTypeSymbol GenerateRootNamespaceOrType(this INamedTypeSymbol namedType, string[] containers) 13INamespaceOrTypeSymbol currentSymbol = namedType;
Shared\Extensions\INamespaceSymbolExtensions.cs (6)
57public static IEnumerable<INamespaceOrTypeSymbol> GetAllNamespacesAndTypes( 61using var _ = ArrayBuilder<INamespaceOrTypeSymbol>.GetInstance(out var stack); 64while (stack.TryPop(out var current)) 131using var namespaceQueue = SharedPools.Default<Queue<INamespaceOrTypeSymbol>>().GetPooledObject(); 159Queue<INamespaceOrTypeSymbol> namespaceQueue) 180var ns = namespaceQueue.Dequeue();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\INamespaceOrTypeSymbolExtensions.cs (8)
17private static readonly ConditionalWeakTable<INamespaceOrTypeSymbol, List<string>> s_namespaceOrTypeToNameMap = new(); 22public static string GetShortName(this INamespaceOrTypeSymbol symbol) 25public static IEnumerable<IPropertySymbol> GetIndexers(this INamespaceOrTypeSymbol? symbol) 32public static IReadOnlyList<string> GetNameParts(this INamespaceOrTypeSymbol symbol) 74private static void GetNameParts(INamespaceOrTypeSymbol? namespaceOrTypeSymbol, List<string> result) 90this INamespaceOrTypeSymbol namespaceOrTypeSymbol, 93using var _ = ArrayBuilder<INamespaceOrTypeSymbol>.GetInstance(out var stack); 96while (stack.TryPop(out var current))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.cs (2)
529var namespaceOrType = symbol is IAliasSymbol alias ? alias.Target : symbol as INamespaceOrTypeSymbol;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.ErrorTypeSymbolKey.cs (2)
96foreach (var container in containingSymbolResolution.OfType<INamespaceOrTypeSymbol>())
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.NamedTypeSymbolKey.cs (5)
128foreach (var container in containingSymbolResolution.OfType<INamespaceOrTypeSymbol>()) 156foreach (var nsOrType in containingSymbolResolution.OfType<INamespaceOrTypeSymbol>()) 168INamespaceOrTypeSymbol container,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.NamespaceSymbolKey.cs (1)
103foreach (var member in namespaceSymbol.GetMembers(metadataName))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (1)
698=> symbol is INamespaceOrTypeSymbol or { IsStatic: true };
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AliasSymbolCache.cs (3)
15using TreeMap = ConcurrentDictionary<(SyntaxTree tree, int namespaceId), ImmutableDictionary<INamespaceOrTypeSymbol, IAliasSymbol>>; 30INamespaceOrTypeSymbol targetSymbol, 59var builder = ImmutableDictionary.CreateBuilder<INamespaceOrTypeSymbol, IAliasSymbol>();
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService.cs (2)
232INamespaceOrTypeSymbol destination, 465public Task<Document> AddNamespaceOrTypeAsync(CodeGenerationSolutionContext context, INamespaceSymbol destination, INamespaceOrTypeSymbol namespaceOrType, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractCodeGenerationService_FindDeclaration.cs (3)
128INamespaceOrTypeSymbol namespaceOrType, 138INamespaceOrTypeSymbol namespaceOrType, 145var symbol = namespaceOrType;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationSymbolFactory.cs (1)
508public static INamespaceSymbol CreateNamespaceSymbol(string name, IList<ISymbol>? imports = null, IList<INamespaceOrTypeSymbol>? members = null)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerator.cs (1)
79public static Task<Document> AddNamespaceOrTypeDeclarationAsync(CodeGenerationSolutionContext context, INamespaceSymbol destination, INamespaceOrTypeSymbol namespaceOrType, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\ICodeGenerationService.cs (2)
169Task<Document> AddNamespaceOrTypeAsync(CodeGenerationSolutionContext context, INamespaceSymbol destination, INamespaceOrTypeSymbol namespaceOrType, CancellationToken cancellationToken); 192Task<SyntaxNode?> FindMostRelevantNameSpaceOrTypeDeclarationAsync(Solution solution, INamespaceOrTypeSymbol namespaceOrType, Location? location, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationNamespaceSymbol.cs (5)
14internal sealed class CodeGenerationNamespaceSymbol(string name, IList<INamespaceOrTypeSymbol> members) : CodeGenerationNamespaceOrTypeSymbol(null, null, default, Accessibility.NotApplicable, default, name), INamespaceSymbol 16private readonly IList<INamespaceOrTypeSymbol> _members = members ?? SpecializedCollections.EmptyList<INamespaceOrTypeSymbol>(); 36public new IEnumerable<INamespaceOrTypeSymbol> GetMembers() 39IEnumerable<INamespaceOrTypeSymbol> INamespaceSymbol.GetMembers(string name)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\SimplificationHelpers.cs (1)
105if (expressionInfo.Symbol is INamespaceOrTypeSymbol)
Microsoft.CodeAnalysis.Workspaces.UnitTests (4)
SymbolKeyTests.cs (2)
1536private static void GetDeclaredSymbols(INamespaceOrTypeSymbol container, List<ISymbol> symbols) 1542if (member is INamespaceOrTypeSymbol nsOrType)
UtilityTest\DocumentationCommentIdTests.cs (2)
23private static void CheckDeclarationId(string expectedId, INamespaceOrTypeSymbol symbol, Compilation compilation) 51private static void CheckReferenceId(string expectedId, INamespaceOrTypeSymbol symbol, Compilation compilation)
Microsoft.Extensions.Options.SourceGeneration (1)
Parser.cs (1)
198private static bool AlreadyImplementsValidateMethod(INamespaceOrTypeSymbol validatorType, ISymbol modelType)
Microsoft.Interop.SourceGeneration (2)
TypeSymbolExtensions.cs (2)
335INamespaceOrTypeSymbol current = type; 342current = (INamespaceOrTypeSymbol)current.ContainingType ?? current.ContainingNamespace;
Microsoft.VisualStudio.LanguageServices (3)
Library\ObjectBrowser\AbstractListItemFactory.cs (2)
537private static bool ContainsAccessibleTypeMember(INamespaceOrTypeSymbol namespaceOrTypeSymbol, IAssemblySymbol assemblySymbol) 550private static ImmutableArray<INamedTypeSymbol> GetAccessibleTypeMembers(INamespaceOrTypeSymbol namespaceOrTypeSymbol, IAssemblySymbol assemblySymbol)
ProjectSystem\AbstractEntryPointFinder.cs (1)
21foreach (var member in symbol.GetMembers())
Microsoft.VisualStudio.LanguageServices.CSharp (2)
LanguageService\CSharpHelpContextService.cs (2)
542private static string FormatNamespaceOrTypeSymbol(INamespaceOrTypeSymbol symbol) 566return FormatNamespaceOrTypeSymbol((INamespaceOrTypeSymbol)symbol);
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (2)
GlyphExtensionsTests.cs (2)
184INamespaceOrTypeSymbol target = null, 201INamespaceOrTypeSymbol target = null,
Microsoft.VisualStudio.LanguageServices.VisualBasic (2)
Help\VisualBasicHelpContextService.vb (2)
73Private Shared Function FormatNamespaceOrTypeSymbol(symbol As INamespaceOrTypeSymbol) As String 113Return FormatNamespaceOrTypeSymbol(DirectCast(symbol, INamespaceOrTypeSymbol))