6 implementations of ContainingNamespace
Microsoft.CodeAnalysis.CodeStyle.Fixes (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationSymbol.cs (1)
90public INamespaceSymbol ContainingNamespace => null;
Microsoft.CodeAnalysis.CSharp (2)
Symbols\PublicModel\PreprocessingSymbol.cs (1)
112INamespaceSymbol? ISymbol.ContainingNamespace => null;
Symbols\PublicModel\Symbol.cs (1)
209INamespaceSymbol ISymbol.ContainingNamespace => UnderlyingSymbol.ContainingNamespace.GetPublicSymbol();
Microsoft.CodeAnalysis.Features (1)
MetadataAsSource\AbstractMetadataAsSourceService.AbstractWrappedSymbol.cs (1)
35public INamespaceSymbol ContainingNamespace => _symbol.ContainingNamespace;
Microsoft.CodeAnalysis.VisualBasic (1)
Symbols\Symbol.vb (1)
1199Private ReadOnly Property ISymbol_ContainingNamespace As INamespaceSymbol Implements ISymbol.ContainingNamespace
Microsoft.CodeAnalysis.Workspaces (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationSymbol.cs (1)
90public INamespaceSymbol ContainingNamespace => null;
387 references to ContainingNamespace
ConfigurationSchemaGenerator (2)
RuntimeSource\Configuration.Binder\Parser\BinderInvocation.cs (1)
61ContainingNamespace: INamespaceSymbol containingNamespace,
RuntimeSource\Configuration.Binder\Parser\Extensions.cs (1)
125string? @namespace = type.ContainingNamespace is { IsGlobalNamespace: false } containingNamespace ? containingNamespace.ToDisplayString() : null;
ILLink.RoslynAnalyzer (4)
INamedTypeSymbolExtensions.cs (1)
26 currentType = (INamespaceOrTypeSymbol?) currentType.ContainingType ?? currentType.ContainingNamespace;
ITypeSymbolExtensions.cs (2)
60 return symbol.ContainingNamespace?.GetDisplayName () == @namespace && symbol.MetadataName == name; 75 _ => WellKnownTypeExtensions.GetWellKnownType (symbol.ContainingNamespace?.GetDisplayName () ?? "", symbol.MetadataName)
TrimAnalysis\TypeProxy.cs (1)
32 public string? Namespace { get => Type.ContainingNamespace?.Name; }
Microsoft.Analyzers.Extra (1)
UsingToStringInLoggersAnalyzer.cs (1)
59&& attributeSymbol.ContainingNamespace.ToString() == "Microsoft.Extensions.Logging";
Microsoft.AspNetCore.App.Analyzers (24)
Http\HeaderDictionaryAddAnalyzer.cs (4)
52ContainingNamespace: 55ContainingNamespace: 58ContainingNamespace: 61ContainingNamespace:
Http\HeaderDictionaryIndexerAnalyzer.cs (4)
55ContainingNamespace: 58ContainingNamespace: 61ContainingNamespace: 64ContainingNamespace:
Kestrel\ListenOnIPv6AnyAnalyzer.cs (9)
104ContainingNamespace: { Name: "Net", ContainingNamespace: { Name: "System", ContainingNamespace.IsGlobalNamespace: true } } 116ContainingNamespace: 119ContainingNamespace: 122ContainingNamespace: 125ContainingNamespace: 128ContainingNamespace: 131ContainingNamespace.IsGlobalNamespace: true
RouteEmbeddedLanguage\Infrastructure\RouteStringSyntaxDetector.cs (4)
339ContainingNamespace: 342ContainingNamespace: 345ContainingNamespace: 348ContainingNamespace.IsGlobalNamespace: true,
RouteHandlers\DetectMisplacedLambdaAttribute.cs (3)
45if (IsInValidNamespace(attribute.AttributeClass?.ContainingNamespace)) 60if (@namespace.Name.Equals("AspNetCore", System.StringComparison.Ordinal) && @namespace.ContainingNamespace.Name.Equals("Microsoft", System.StringComparison.Ordinal)) 65return IsInValidNamespace(@namespace.ContainingNamespace);
Microsoft.AspNetCore.Components.Analyzers (2)
ComponentInternalUsageDiagnosticAnalzyer.cs (2)
41var @namespace = symbol?.ContainingNamespace; 49@namespace = @namespace.ContainingNamespace;
Microsoft.AspNetCore.Components.SdkAnalyzers (2)
ComponentInternalUsageDiagnosticAnalzyer.cs (2)
41var @namespace = symbol?.ContainingNamespace; 49@namespace = @namespace.ContainingNamespace;
Microsoft.AspNetCore.Http.RequestDelegateGenerator (4)
StaticRouteHandlerModel\InvocationOperationExtensions.cs (4)
30targetOperation.TargetMethod.ContainingNamespace is { Name: "Builder", ContainingNamespace: { Name: "AspNetCore", ContainingNamespace: { Name: "Microsoft", ContainingNamespace.IsGlobalNamespace: true } } } &&
Microsoft.AspNetCore.Mvc.Analyzers (1)
TopLevelParameterNameAnalyzer.cs (1)
138var @namespace = type.ContainingNamespace?.ToString();
Microsoft.AspNetCore.SignalR.Client.SourceGenerator (2)
HubClientProxyGenerator.Parser.cs (1)
235sourceGenerationSpec.SetterNamespace = registerCallbackProviderClassSymbol.ContainingNamespace.ToString();
HubServerProxyGenerator.Parser.cs (1)
224sourceGenerationSpec.GetterNamespace = getProxyClassSymbol.ContainingNamespace.ToString();
Microsoft.CodeAnalysis (5)
DiagnosticAnalyzer\AnalyzerDriver.cs (1)
1697await processContainerOnMemberCompletedAsync(symbol.ContainingNamespace, symbol, analyzer).ConfigureAwait(false);
DiagnosticAnalyzer\SuppressMessageAttributeState.cs (1)
203namespaceSymbol = namespaceSymbol.ContainingNamespace;
Symbols\ISymbolExtensions.cs (3)
130ContainingNamespace: 133ContainingNamespace: 136ContainingNamespace.IsGlobalNamespace: true,
Microsoft.CodeAnalysis.CodeStyle (25)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\INamedTypeSymbolExtensions.cs (4)
672ContainingNamespace: 675ContainingNamespace: 678ContainingNamespace: 681ContainingNamespace.IsGlobalNamespace: true,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\INamespaceOrTypeSymbolExtensions.cs (1)
81GetNameParts(namespaceOrTypeSymbol.ContainingNamespace, result);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.cs (1)
809ContainingNamespace.Name: nameof(System),
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.cs (13)
235b.ContainingNamespace != null && 236b.ContainingNamespace.Name == "System" && 237b.ContainingNamespace.ContainingNamespace != null && 238b.ContainingNamespace.ContainingNamespace.IsGlobalNamespace) 251&& symbol.ContainingNamespace?.Name == "System" 252&& symbol.ContainingNamespace.ContainingNamespace?.IsGlobalNamespace == true; 751ContainingNamespace: { Name: nameof(System), ContainingNamespace.IsGlobalNamespace: true } 759ContainingNamespace: { Name: nameof(System), ContainingNamespace.IsGlobalNamespace: true }
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.ErrorTypeSymbolKey.cs (1)
59namespaceSymbol = namespaceSymbol.ContainingNamespace;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.NamespaceSymbolKey.cs (3)
29if (symbol.ContainingNamespace != null) 32visitor.WriteSymbolKey(symbol.ContainingNamespace); 660 => contextualSymbol?.ContainingNamespace,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.EquivalenceVisitor.cs (2)
384xNamespace = xNamespace.ContainingNamespace; 385yNamespace = yNamespace.ContainingNamespace;
Microsoft.CodeAnalysis.CodeStyle.Fixes (4)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationHelpers.cs (4)
402ContainingNamespace: 405ContainingNamespace: 408ContainingNamespace: 411ContainingNamespace.IsGlobalNamespace: true,
Microsoft.CodeAnalysis.CSharp (10)
Compilation\CSharpCompilation.cs (1)
1451var containingNamespace = namespaceSymbol.ContainingNamespace;
src\Compilers\CSharp\CSharpAnalyzerDriver\CSharpDeclarationComputer.cs (1)
94var declaredSymbol = getSymbol ? nsSymbol?.ContainingNamespace : null;
SymbolDisplay\SymbolDisplayVisitor.cs (1)
186var containingNamespace = symbol.ContainingNamespace;
SymbolDisplay\SymbolDisplayVisitor_Minimal.cs (5)
63Debug.Assert(symbol.ContainingNamespace != null || symbol.IsGlobalNamespace); 87var containingNamespace = symbol.ContainingNamespace == null 89: SemanticModelOpt.Compilation.GetCompilationNamespace(symbol.ContainingNamespace); 143var containingNamespace = symbol.ContainingNamespace == null 145: SemanticModelOpt.Compilation.GetCompilationNamespace(symbol.ContainingNamespace);
Symbols\ModuleSymbol.cs (2)
352if (namespaceSymbol.IsGlobalNamespace || (object)namespaceSymbol.ContainingNamespace == null) 358var cns = GetModuleNamespace(namespaceSymbol.ContainingNamespace);
Microsoft.CodeAnalysis.CSharp.CodeStyle (3)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeStyle\TypeStyle\TypeStyleHelper.cs (2)
160containingType.ContainingNamespace.Equals(returnType.ContainingNamespace))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseImplicitTypeHelper.cs (1)
325ContainingSymbol: INamespaceSymbol { Name: nameof(System), ContainingNamespace.IsGlobalNamespace: true }
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (23)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\MethodGenerator.cs (10)
154ContainingNamespace.Name: nameof(System.Runtime.CompilerServices), 155ContainingNamespace.ContainingNamespace.Name: nameof(System.Runtime), 156ContainingNamespace.ContainingNamespace.ContainingNamespace.Name: nameof(System), 157ContainingNamespace.ContainingNamespace.ContainingNamespace.ContainingNamespace.IsGlobalNamespace: true,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Editing\CSharpImportAdder.cs (1)
59var ns = symbol.ContainingNamespace;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.ExpressionSyntaxGeneratorVisitor.cs (6)
63else if (symbol.ContainingNamespace != null) 65if (symbol.ContainingNamespace.IsGlobalNamespace) 77var container = symbol.ContainingNamespace.Accept(this)!; 88if (symbol.ContainingNamespace == null) 93if (symbol.ContainingNamespace.IsGlobalNamespace) 102var container = symbol.ContainingNamespace.Accept(this)!;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.TypeSyntaxGeneratorVisitor.cs (6)
290else if (symbol.ContainingNamespace != null) 292if (symbol.ContainingNamespace.IsGlobalNamespace) 301var container = symbol.ContainingNamespace.Accept(this)!; 321if (symbol.ContainingNamespace == null) 326if (symbol.ContainingNamespace.IsGlobalNamespace) 332var container = symbol.ContainingNamespace.Accept(this)!;
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (1)
Attributes\AttributeTests_Nullable.cs (1)
579Assert.Equal("System.Runtime.CompilerServices", attributeType.ContainingNamespace.QualifiedName);
Microsoft.CodeAnalysis.CSharp.Features (7)
AddImport\CSharpAddImportFeatureService.cs (1)
534containingNamespaceSymbol = containingNamespaceSymbol.ContainingNamespace;
DecompiledSource\CSharpDecompiledSourceService.cs (1)
114symbol = (INamespaceOrTypeSymbol?)symbol.ContainingType ?? symbol.ContainingNamespace)
ExtractInterface\CSharpExtractInterfaceService.cs (2)
52return typeSymbol.ContainingNamespace.IsGlobalNamespace 54: typeSymbol.ContainingNamespace.ToDisplayString();
src\Compilers\CSharp\CSharpAnalyzerDriver\CSharpDeclarationComputer.cs (1)
94var declaredSymbol = getSymbol ? nsSymbol?.ContainingNamespace : null;
UseNamedArguments\CSharpUseNamedArgumentsCodeRefactoringProvider.cs (2)
46if (argType?.ContainingNamespace is { Name: nameof(System), ContainingNamespace.IsGlobalNamespace: true } &&
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (2)
Diagnostics\Suppression\RemoveUnnecessaryPragmaSuppressionsTests.cs (2)
1307if (!context.Symbol.ContainingNamespace.IsGlobalNamespace) 1309var diagnostic = Diagnostic.Create(Descriptor, context.Symbol.ContainingNamespace.Locations[0]);
Microsoft.CodeAnalysis.CSharp.Scripting.UnitTests (1)
InteractiveSessionTests.cs (1)
1192Assert.True(import.NamespaceOrType is INamespaceSymbol { Name: "System", ContainingNamespace.IsGlobalNamespace: true });
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (28)
Compilation\GetImportScopesTests.cs (26)
55Assert.True(scopes.Single().Imports.Single().NamespaceOrType is INamespaceSymbol { ContainingNamespace.IsGlobalNamespace: true, Name: nameof(System) }); 71Assert.True(scopes.Single().Imports.Single().NamespaceOrType is INamespaceSymbol { ContainingNamespace.IsGlobalNamespace: true, Name: nameof(System) }); 102Assert.True(scopes.Single().Imports.Single().NamespaceOrType is INamespaceSymbol { ContainingNamespace.IsGlobalNamespace: true, Name: nameof(System) }); 130Assert.True(scopes.Single().Imports.Single().NamespaceOrType is INamespaceSymbol { ContainingNamespace.IsGlobalNamespace: true, Name: nameof(System) }); 147Assert.True(scopes.Single().Imports.Any(i => i.NamespaceOrType is INamespaceSymbol { ContainingNamespace.IsGlobalNamespace: true, Name: nameof(System) })); 148Assert.True(scopes.Single().Imports.Any(i => i.NamespaceOrType is INamespaceSymbol { ContainingNamespace.IsGlobalNamespace: true, Name: nameof(Microsoft) })); 175Assert.True(scopes.Single().Imports.Single().NamespaceOrType is INamespaceSymbol { ContainingNamespace.IsGlobalNamespace: true, Name: nameof(System) }); 198Assert.True(scopes[0].Imports.Single().NamespaceOrType is INamespaceSymbol { ContainingNamespace.IsGlobalNamespace: true, Name: nameof(Microsoft) }); 200Assert.True(scopes[1].Imports.Single().NamespaceOrType is INamespaceSymbol { ContainingNamespace.IsGlobalNamespace: true, Name: nameof(System) }); 226Assert.True(scopes[0].Imports.Single().NamespaceOrType is INamespaceSymbol { ContainingNamespace.IsGlobalNamespace: true, Name: nameof(Microsoft) }); 228Assert.True(scopes[1].Imports.Single().NamespaceOrType is INamespaceSymbol { ContainingNamespace.IsGlobalNamespace: true, Name: nameof(System) }); 244Assert.True(scopes.Single().Aliases.Single() is { Name: "S", Target: INamespaceSymbol { ContainingNamespace.IsGlobalNamespace: true, Name: nameof(System) } }); 260Assert.True(scopes.Single().Aliases.Single() is { Name: "S", Target: { ContainingNamespace.IsGlobalNamespace: true, Name: nameof(System) } }); 291Assert.True(scopes.Single().Aliases.Single() is { Name: "S", Target: INamespaceSymbol { ContainingNamespace.IsGlobalNamespace: true, Name: nameof(System) } }); 319Assert.True(scopes.Single().Aliases.Single() is { Name: "S", Target: { ContainingNamespace.IsGlobalNamespace: true, Name: nameof(System) } }); 336Assert.True(scopes.Single().Aliases.Any(a => a is { Name: "S", Target: INamespaceSymbol { ContainingNamespace.IsGlobalNamespace: true, Name: nameof(System) } })); 337Assert.True(scopes.Single().Aliases.Any(a => a is { Name: "M", Target: INamespaceSymbol { ContainingNamespace.IsGlobalNamespace: true, Name: nameof(Microsoft) } })); 364Assert.True(scopes.Single().Aliases.Single() is { Name: "S", Target: INamespaceSymbol { ContainingNamespace.IsGlobalNamespace: true, Name: nameof(System) } }); 387Assert.True(scopes[0].Aliases.Single() is { Name: "M", Target: INamespaceSymbol { ContainingNamespace.IsGlobalNamespace: true, Name: nameof(Microsoft) } }); 389Assert.True(scopes[1].Aliases.Single() is { Name: "S", Target: INamespaceSymbol { ContainingNamespace.IsGlobalNamespace: true, Name: nameof(System) } }); 625Assert.True(scopes.Single().Imports.Single().NamespaceOrType is INamespaceSymbol { ContainingNamespace.IsGlobalNamespace: true, Name: nameof(System) }); 648Assert.True(scopes.Single().Imports.Single().NamespaceOrType is INamespaceSymbol { ContainingNamespace.IsGlobalNamespace: true, Name: nameof(System) }); 682Assert.True(scopes.Single().Imports.Any(i => i.NamespaceOrType is INamespaceSymbol { ContainingNamespace.IsGlobalNamespace: true, Name: nameof(System) })); 684Assert.True(scopes.Single().Imports.Any(i => i.NamespaceOrType is INamespaceSymbol { ContainingNamespace.IsGlobalNamespace: false, Name: nameof(System.IO) })); 688Assert.True(scopes.Single().Aliases.Any(i => i is { Name: "M", Target: INamespaceSymbol { ContainingNamespace.IsGlobalNamespace: true, Name: nameof(Microsoft) } })); 690Assert.True(scopes.Single().Aliases.Any(i => i is { Name: "T", Target: INamespaceSymbol { ContainingNamespace.IsGlobalNamespace: false, Name: nameof(System.Threading) } }));
Compilation\SemanticModelAPITests.cs (1)
1274Assert.Null(aliasTarget.ContainingNamespace);
Compilation\SemanticModelGetDeclaredSymbolAPITests.cs (1)
2541Assert.Equal("N", info.Type.ContainingNamespace.Name);
Microsoft.CodeAnalysis.CSharp.Test.Utilities (1)
TestAttributesVisitor.cs (1)
212if (containingType.Name == name && containingType.ContainingNamespace.QualifiedName == namespaceName)
Microsoft.CodeAnalysis.CSharp.Workspaces (29)
Simplification\CSharpSimplificationService.Expander.cs (3)
910if (replaceNode || symbol.ContainingType != null || symbol.ContainingNamespace != null) 914if (!replaceNode && symbol.ContainingType == null && symbol.ContainingNamespace.IsGlobalNamespace) 933: (symbol.ContainingType ?? (ISymbol)symbol.ContainingNamespace);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeStyle\TypeStyle\TypeStyleHelper.cs (2)
160containingType.ContainingNamespace.Equals(returnType.ContainingNamespace))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseImplicitTypeHelper.cs (1)
325ContainingSymbol: INamespaceSymbol { Name: nameof(System), ContainingNamespace.IsGlobalNamespace: true }
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\MethodGenerator.cs (10)
154ContainingNamespace.Name: nameof(System.Runtime.CompilerServices), 155ContainingNamespace.ContainingNamespace.Name: nameof(System.Runtime), 156ContainingNamespace.ContainingNamespace.ContainingNamespace.Name: nameof(System), 157ContainingNamespace.ContainingNamespace.ContainingNamespace.ContainingNamespace.IsGlobalNamespace: true,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Editing\CSharpImportAdder.cs (1)
59var ns = symbol.ContainingNamespace;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.ExpressionSyntaxGeneratorVisitor.cs (6)
63else if (symbol.ContainingNamespace != null) 65if (symbol.ContainingNamespace.IsGlobalNamespace) 77var container = symbol.ContainingNamespace.Accept(this)!; 88if (symbol.ContainingNamespace == null) 93if (symbol.ContainingNamespace.IsGlobalNamespace) 102var container = symbol.ContainingNamespace.Accept(this)!;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.TypeSyntaxGeneratorVisitor.cs (6)
290else if (symbol.ContainingNamespace != null) 292if (symbol.ContainingNamespace.IsGlobalNamespace) 301var container = symbol.ContainingNamespace.Accept(this)!; 321if (symbol.ContainingNamespace == null) 326if (symbol.ContainingNamespace.IsGlobalNamespace) 332var container = symbol.ContainingNamespace.Accept(this)!;
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (3)
MoveStaticMembers\TestMoveStaticMembersService.cs (3)
55var namespaceDisplay = selectedType.ContainingNamespace.IsGlobalNamespace 57: selectedType.ContainingNamespace.ToDisplayString(); 65var destination = selectedType.ContainingNamespace.GetAllTypes(CancellationToken.None).First(t => t.ToDisplayString() == DestinationName);
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (1)
SymbolFinder\DependentTypeFinderTests.cs (1)
789var namespaceSymbol = baseInterfaceSymbol.ContainingNamespace;
Microsoft.CodeAnalysis.Features (46)
Completion\Providers\ImportCompletionProvider\AbstractTypeImportCompletionProvider.cs (2)
79ContainingNamespace: not null, 105var namespaceOfTarget = target.ContainingNamespace.ToDisplayString(SymbolDisplayFormats.NameFormat);
Completion\Providers\ImportCompletionProvider\ExtensionMethodImportCompletionHelper.cs (4)
159var containingNamespacename = GetFullyQualifiedNamespaceName(symbol.ContainingNamespace, namespaceNameCache); 233if (symbol.ContainingNamespace == null || symbol.ContainingNamespace.IsGlobalNamespace) 243name = GetFullyQualifiedNamespaceName(symbol.ContainingNamespace, stringCache) + "." + symbol.Name;
ConvertToInterpolatedString\AbstractConvertPlaceholderToInterpolatedStringRefactoringProvider.cs (3)
93if (type is { Name: nameof(CultureInfo), ContainingNamespace.Name: nameof(System.Globalization), ContainingNamespace.ContainingNamespace.Name: nameof(System) })
Debugging\AbstractBreakpointResolver.cs (1)
188container = ((INamespaceOrTypeSymbol)container.ContainingType) ?? container.ContainingNamespace;
Debugging\AbstractDataTipInfoGetter.cs (6)
49ContainingType.ContainingNamespace.Name: nameof(System.Linq), 50ContainingType.ContainingNamespace.ContainingNamespace.Name: nameof(System), 51ContainingType.ContainingNamespace.ContainingNamespace.ContainingNamespace.IsGlobalNamespace: true,
DesignerAttribute\DesignerAttributeDiscoveryService.cs (6)
358ContainingNamespace.Name: nameof(System.ComponentModel), 359ContainingNamespace.ContainingNamespace.Name: nameof(System), 360ContainingNamespace.ContainingNamespace.ContainingNamespace.IsGlobalNamespace: true,
EmbeddedLanguages\EmbeddedLanguageDetector.cs (6)
179ContainingNamespace: 182ContainingNamespace.IsGlobalNamespace: true, 470ContainingNamespace: 473ContainingNamespace: 476ContainingNamespace: 479ContainingNamespace.IsGlobalNamespace: true,
ExtractInterface\AbstractExtractInterfaceService.cs (3)
115var containingNamespaceDisplay = refactoringResult.TypeToExtractFrom.ContainingNamespace.IsGlobalNamespace 117: refactoringResult.TypeToExtractFrom.ContainingNamespace.ToDisplayString(); 264var conflictingTypeNames = type.ContainingNamespace.GetAllTypes(cancellationToken).Select(t => t.Name);
ExtractMethod\MethodExtractor.VariableSymbol.cs (6)
43ContainingNamespace.Name: nameof(System.Threading), 44ContainingNamespace.ContainingNamespace.Name: nameof(System), 45ContainingNamespace.ContainingNamespace.ContainingNamespace.IsGlobalNamespace: true,
GenerateType\AbstractGenerateTypeService.State.cs (1)
358NamespaceToGenerateInOpt = TypeToGenerateInOpt.ContainingNamespace.ToDisplayString(format);
MetadataAsSource\AbstractMetadataAsSourceService.AbstractWrappedSymbol.cs (1)
35public INamespaceSymbol ContainingNamespace => _symbol.ContainingNamespace;
MetadataAsSource\AbstractMetadataAsSourceService.cs (1)
97var topLevelNamespaceSymbol = symbol.ContainingNamespace;
MetadataAsSource\MetadataAsSourceHelpers.cs (1)
58while (topLevelNamedType.ContainingSymbol != symbol.ContainingNamespace ||
MoveToNamespace\AbstractMoveToNamespaceService.cs (2)
276var offset = symbol.ContainingNamespace.IsGlobalNamespace 278: symbol.ContainingNamespace.ToDisplayString().Length + 1;
PdbSourceDocument\ImplementationAssemblyLookupService.cs (1)
65var namespaceName = typeSymbol.ContainingNamespace.ToDisplayString(s_metadataSymbolDisplayFormat);
RQName\RQNodeBuilder.cs (2)
46@namespace = @namespace.ContainingNamespace; 76var namespaceNames = RQNodeBuilder.GetNameParts(@type.ContainingNamespace);
Microsoft.CodeAnalysis.Scripting (1)
ScriptBuilder.cs (1)
191string entryPointTypeName = MetadataHelpers.BuildQualifiedName(entryPoint.ContainingNamespace.MetadataName, entryPoint.ContainingType.MetadataName);
Microsoft.CodeAnalysis.Test.Utilities (3)
Compilation\ControlFlowGraphVerifier.cs (1)
1999ContainingNamespace: { IsGlobalNamespace: true }
Diagnostics\CommonDiagnosticAnalyzers.cs (2)
2124if (symbolEnded.ContainingNamespace != null) 2126containersToVerify.Add(symbolEnded.ContainingNamespace);
Microsoft.CodeAnalysis.VisualBasic (11)
Compilation\VisualBasicCompilation.vb (2)
1477ElseIf namespaceSymbol.ContainingNamespace Is Nothing Then 1482Dim containingNs = GetCompilationNamespace(namespaceSymbol.ContainingNamespace)
SymbolDisplay\SymbolDisplayVisitor.vb (1)
236Dim containingNamespace = symbol.ContainingNamespace
SymbolDisplay\SymbolDisplayVisitor_Minimal.vb (5)
19Debug.Assert(symbol.ContainingNamespace IsNot Nothing OrElse symbol.IsGlobalNamespace) 62Dim containingNamespace = symbol.ContainingNamespace 103ElseIf symbol.ContainingNamespace IsNot Nothing Then 104If symbol.ContainingNamespace.IsGlobalNamespace Then 112symbol.ContainingNamespace.Accept(NotFirstVisitor)
Symbols\ModuleSymbol.vb (2)
269If namespaceSymbol.IsGlobalNamespace Or namespaceSymbol.ContainingNamespace Is Nothing Then 272Dim cns = GetModuleNamespace(namespaceSymbol.ContainingNamespace)
Symbols\Symbol.vb (1)
1199Private ReadOnly Property ISymbol_ContainingNamespace As INamespaceSymbol Implements ISymbol.ContainingNamespace
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (17)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Editing\VisualBasicImportAdder.vb (1)
51Dim ns = Symbol.ContainingNamespace
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ExpressionSyntaxGeneratorVisitor.vb (6)
46ElseIf symbol.ContainingNamespace IsNot Nothing Then 47If symbol.ContainingNamespace.IsGlobalNamespace Then 52Dim container = symbol.ContainingNamespace.Accept(Me) 62If symbol.ContainingNamespace Is Nothing Then 66If symbol.ContainingNamespace.IsGlobalNamespace Then 69Dim container = symbol.ContainingNamespace.Accept(Me)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\SymbolExtensions.vb (2)
16Dim containingNamespace = symbol.ContainingNamespace 43Dim containingNamespace = containingType.ContainingNamespace
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\TypeSyntaxGeneratorVisitor.vb (6)
165ElseIf symbol.ContainingNamespace IsNot Nothing Then 166If symbol.ContainingNamespace.IsGlobalNamespace Then 171Dim container = symbol.ContainingNamespace.Accept(Me) 181If symbol.ContainingNamespace Is Nothing Then 185If symbol.ContainingNamespace.IsGlobalNamespace Then 192Dim container = symbol.ContainingNamespace.Accept(Me)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Utilities\SymbolExtensions.vb (2)
19propertySymbol.ContainingType.ContainingNamespace IsNot Nothing AndAlso 20propertySymbol.ContainingType.ContainingNamespace.IsMyNamespace(compilation) Then
Microsoft.CodeAnalysis.VisualBasic.Features (2)
CodeFixes\GenerateEvent\GenerateEventCodeFixProvider.vb (1)
135AndAlso Equals(existingSymbol.ContainingNamespace, targetType.ContainingNamespace)) Then
ExtractInterface\VisualBasicExtractInterfaceService.vb (1)
50Dim namespaceSymbol = typeSymbol.ContainingNamespace
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (1)
Compilation\GetImportScopesTests.vb (1)
48Return symbol.Name = aliasName AndAlso symbol.Target.Name = targetName AndAlso TypeOf symbol.Target Is INamespaceSymbol AndAlso DirectCast(symbol.Target, INamespaceSymbol).ContainingNamespace.IsGlobalNamespace = inGlobalNamespace
Microsoft.CodeAnalysis.VisualBasic.Workspaces (19)
Simplification\VisualBasicSimplificationService.Expander.vb (1)
718If replaceNode OrElse symbol.ContainingType IsNot Nothing OrElse symbol.ContainingNamespace IsNot Nothing Then
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Editing\VisualBasicImportAdder.vb (1)
51Dim ns = Symbol.ContainingNamespace
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ExpressionSyntaxGeneratorVisitor.vb (6)
46ElseIf symbol.ContainingNamespace IsNot Nothing Then 47If symbol.ContainingNamespace.IsGlobalNamespace Then 52Dim container = symbol.ContainingNamespace.Accept(Me) 62If symbol.ContainingNamespace Is Nothing Then 66If symbol.ContainingNamespace.IsGlobalNamespace Then 69Dim container = symbol.ContainingNamespace.Accept(Me)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\SymbolExtensions.vb (2)
16Dim containingNamespace = symbol.ContainingNamespace 43Dim containingNamespace = containingType.ContainingNamespace
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\TypeSyntaxGeneratorVisitor.vb (6)
165ElseIf symbol.ContainingNamespace IsNot Nothing Then 166If symbol.ContainingNamespace.IsGlobalNamespace Then 171Dim container = symbol.ContainingNamespace.Accept(Me) 181If symbol.ContainingNamespace Is Nothing Then 185If symbol.ContainingNamespace.IsGlobalNamespace Then 192Dim container = symbol.ContainingNamespace.Accept(Me)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Utilities\SymbolExtensions.vb (2)
19propertySymbol.ContainingType.ContainingNamespace IsNot Nothing AndAlso 20propertySymbol.ContainingType.ContainingNamespace.IsMyNamespace(compilation) Then
Utilities\IntrinsicOperators\PredefinedCastExpressionDocumentation.vb (1)
62Return _resultingType.ContainingNamespace.Name + "." + _resultingType.MetadataName
Microsoft.CodeAnalysis.Workspaces (45)
FindSymbols\FindReferences\DependentProjectsFinder.cs (10)
251attrType.ContainingNamespace?.Name == nameof(System.Runtime.CompilerServices) && 252attrType.ContainingNamespace.ContainingNamespace?.Name == nameof(System.Runtime) && 253attrType.ContainingNamespace.ContainingNamespace.ContainingNamespace?.Name == nameof(System) && 254attrType.ContainingNamespace.ContainingNamespace.ContainingNamespace.ContainingNamespace?.IsGlobalNamespace == true;
FindSymbols\FindReferences\Finders\MethodTypeParameterSymbolReferenceFinder.cs (1)
70ContainingType: INamedTypeSymbol { Name: "Program", ContainingNamespace.IsGlobalNamespace: true }
FindSymbols\SymbolFinder_Helpers.cs (2)
173var candidateFullMetadataName = candidate.ContainingNamespace?.IsGlobalNamespace != false 175: $"{candidate.ContainingNamespace.ToDisplayString(SymbolDisplayFormats.SignatureFormat)}.{candidate.MetadataName}";
Shared\Extensions\INamespaceSymbolExtensions.cs (1)
36GetNameParts(namespaceSymbol.ContainingNamespace, result);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\INamedTypeSymbolExtensions.cs (4)
672ContainingNamespace: 675ContainingNamespace: 678ContainingNamespace: 681ContainingNamespace.IsGlobalNamespace: true,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\INamespaceOrTypeSymbolExtensions.cs (1)
81GetNameParts(namespaceOrTypeSymbol.ContainingNamespace, result);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.cs (1)
809ContainingNamespace.Name: nameof(System),
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.cs (13)
235b.ContainingNamespace != null && 236b.ContainingNamespace.Name == "System" && 237b.ContainingNamespace.ContainingNamespace != null && 238b.ContainingNamespace.ContainingNamespace.IsGlobalNamespace) 251&& symbol.ContainingNamespace?.Name == "System" 252&& symbol.ContainingNamespace.ContainingNamespace?.IsGlobalNamespace == true; 751ContainingNamespace: { Name: nameof(System), ContainingNamespace.IsGlobalNamespace: true } 759ContainingNamespace: { Name: nameof(System), ContainingNamespace.IsGlobalNamespace: true }
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.ErrorTypeSymbolKey.cs (1)
59namespaceSymbol = namespaceSymbol.ContainingNamespace;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.NamespaceSymbolKey.cs (3)
29if (symbol.ContainingNamespace != null) 32visitor.WriteSymbolKey(symbol.ContainingNamespace); 660 => contextualSymbol?.ContainingNamespace,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.EquivalenceVisitor.cs (2)
384xNamespace = xNamespace.ContainingNamespace; 385yNamespace = yNamespace.ContainingNamespace;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationHelpers.cs (4)
402ContainingNamespace: 405ContainingNamespace: 408ContainingNamespace: 411ContainingNamespace.IsGlobalNamespace: true,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Editing\ImportAdderService.cs (2)
205var namespaceSymbol = namedType.ContainingNamespace; 262containedNamespace = containedNamespace.ContainingNamespace;
Microsoft.CodeAnalysis.Workspaces.UnitTests (8)
SymbolKeyTests.cs (8)
1179Assert.Equal("Collections", propType.ContainingNamespace.Name); 1180Assert.Equal("System", propType.ContainingNamespace.ContainingNamespace.Name); 1193Assert.Equal(propType.ContainingNamespace.Name, found.ContainingNamespace.Name); 1226Assert.Equal("Collections", propType.ContainingNamespace.Name); 1227Assert.Equal("System", propType.ContainingNamespace.ContainingNamespace.Name); 1240Assert.Equal(propType.ContainingNamespace.Name, found.ContainingNamespace.Name);
Microsoft.DotNet.CodeAnalysis (1)
Analyzers\AppContextDefaultsAnalyzer.cs (1)
137if (!StringComparer.Ordinal.Equals(methodSym.ContainingNamespace.Name, "System"))
Microsoft.Extensions.Options.SourceGeneration (4)
Parser.cs (4)
137validatorType.ContainingNamespace.IsGlobalNamespace ? string.Empty : validatorType.ContainingNamespace.ToString()!, 716mt.ContainingNamespace.IsGlobalNamespace ? string.Empty : mt.ContainingNamespace.ToString()!,
Microsoft.Gen.ContextualOptions (2)
Model\OptionsContextType.cs (2)
18public string? Namespace => Symbol.ContainingNamespace.IsGlobalNamespace ? null : Symbol.ContainingNamespace.ToString();
Microsoft.Gen.ContextualOptions.Unit.Tests (6)
EmitterTests.cs (4)
32Mock.Of<INamedTypeSymbol>(sym => sym.Name == "Struct1" && sym.ContainingNamespace.ToString() == "Microsoft.GenContextualOptions.TestClasses"), 56Mock.Of<INamedTypeSymbol>(sym => sym.Name == "Class2" && sym.ContainingNamespace.ToString() == "Microsoft.GenContextualOptions.TestClasses"), 84Mock.Of<INamedTypeSymbol>(sym => sym.Name == "Record1" && sym.ContainingNamespace.ToString() == "Microsoft.GenContextualOptions.TestClasses"), 112Mock.Of<INamedTypeSymbol>(sym => sym.Name == "NamespacelessRecord" && sym.ContainingNamespace.IsGlobalNamespace),
SyntaxContextReceiverTests.cs (2)
37Assert.Equal("TestClasses", declaration.Key.ContainingNamespace.ToString()); 73Assert.Equal("TestClasses", declaration.Key.ContainingNamespace.ToString());
Microsoft.Gen.Logging (2)
src\Generators\Shared\SymbolHelpers.cs (2)
17return symbol.ContainingNamespace.IsGlobalNamespace ? string.Empty : symbol.ContainingNamespace.ToString();
Microsoft.Gen.Metrics (2)
src\Generators\Shared\SymbolHelpers.cs (2)
17return symbol.ContainingNamespace.IsGlobalNamespace ? string.Empty : symbol.ContainingNamespace.ToString();
Microsoft.Interop.JavaScript.JSImportGenerator (2)
JSSignatureContext.cs (2)
84if (!method.ContainingType.ContainingNamespace.IsGlobalNamespace) 85typeName = $"{method.ContainingType.ContainingNamespace.ToDisplayString()}.{typeName}";
Microsoft.Interop.SourceGeneration (1)
TypeSymbolExtensions.cs (1)
342current = (INamespaceOrTypeSymbol)current.ContainingType ?? current.ContainingNamespace;
Microsoft.Maui.Controls.BindingSourceGen (3)
InvocationParser.cs (3)
37 || symbol?.ContainingType?.ContainingNamespace.ToDisplayString() is not "Microsoft.Maui.Controls") 76 || methodSymbol.ContainingType?.ContainingNamespace.ToDisplayString() is not "Microsoft.Maui.Controls") 101 { Name: "Func", ContainingNamespace.Name: "System" } => Result<InterceptedMethodType>.Failure(DiagnosticsFactory.GetterIsNotLambda(secondArgument.GetLocation())),
Microsoft.VisualStudio.LanguageServices (19)
CallHierarchy\CallHierarchyItem.cs (1)
45ContainingNamespaceName = symbol.ContainingNamespace.ToDisplayString(ContainingNamespaceFormat);
ExtractClass\VisualStudioExtractClassOptionsService.cs (3)
67var conflictingTypeNames = selectedType.ContainingNamespace.GetAllTypes(cancellationToken).Select(t => t.Name); 71var containingNamespaceDisplay = selectedType.ContainingNamespace.IsGlobalNamespace 73: selectedType.ContainingNamespace.ToDisplayString();
Library\ObjectBrowser\AbstractDescriptionBuilder.cs (3)
100if (splitLink && !typeSymbol.ContainingNamespace.IsGlobalNamespace) 102await AddNamespaceLinkAsync(typeSymbol.ContainingNamespace, cancellationToken).ConfigureAwait(true); 190await BuildMemberOfAsync(symbol.ContainingNamespace, cancellationToken).ConfigureAwait(true);
Library\VsNavInfo\NavInfoFactory.cs (2)
110namespaceName: GetNamespaceName(typeSymbol.ContainingNamespace), 123namespaceName: GetNamespaceName(memberSymbol.ContainingNamespace),
MoveStaticMembers\VisualStudioMoveStaticMembersOptionsService.cs (4)
109var existingTypes = selectedType.ContainingNamespace.GetAllTypes(cancellationTokenSource.Token).ToImmutableArray(); 114var containingNamespaceDisplay = selectedType.ContainingNamespace.IsGlobalNamespace 116: selectedType.ContainingNamespace.ToDisplayString(); 124selectedType.ContainingNamespace,
Progression\GraphNodeIdCreation.cs (5)
84if (includeNamespace && !typeParameter.ContainingNamespace.IsGlobalNamespace) 91items.Add(GraphNodeId.GetPartial(CodeGraphNodeIdName.Namespace, typeParameter.ContainingNamespace.ToDisplayString())); 110else if (underlyingType.ContainingNamespace != null && !underlyingType.ContainingNamespace.IsGlobalNamespace) 112items.Add(GraphNodeId.GetPartial(CodeGraphNodeIdName.Namespace, underlyingType.ContainingNamespace.ToDisplayString()));
PullMemberUp\MainDialog\BaseTypeTreeNodeViewModel.cs (1)
34public string Namespace => string.Format(ServicesVSResources.Namespace_0, Symbol.ContainingNamespace?.ToDisplayString() ?? "global");
Microsoft.VisualStudio.LanguageServices.UnitTests (1)
CommonControls\NewTypeDestinationSelectionViewModelTests.vb (1)
245conflictingNames:=symbol.ContainingNamespace.GetAllTypes(CancellationToken.None).SelectAsArray(Function(t) t.Name),
System.Private.CoreLib.Generators (1)
IntrinsicsInSystemPrivateCoreLibAnalyzer.cs (1)
449return symbol.ContainingNamespace;
System.Text.Json.SourceGeneration (2)
Helpers\RoslynExtensions.cs (1)
381attr.AttributeClass.ContainingNamespace.ToDisplayString() == "System.Diagnostics.CodeAnalysis");
JsonSourceGenerator.Parser.cs (1)
157Namespace = contextTypeSymbol.ContainingNamespace is { IsGlobalNamespace: false } ns ? ns.ToDisplayString() : null,
System.Text.RegularExpressions.Generator (1)
RegexGenerator.Parser.cs (1)
202string? ns = regexMemberSymbol.ContainingType?.ContainingNamespace?.ToDisplayString(
System.Windows.Forms.Analyzers.CSharp (1)
System\Windows\Forms\CSharp\Analyzers\AvoidPassingTaskWithoutCancellationToken\AvoidPassingTaskWithoutCancellationTokenAnalyzer.cs (1)
51|| !funcType.ContainingNamespace.ToString().Equals("System"))
System.Windows.Forms.Analyzers.VisualBasic (1)
Analyzers\AvoidPassingTaskWithoutCancellationToken\AvoidPassingTaskWithoutCancellationTokenAnalyzer.vb (1)
60If funcType.TypeArguments.Length <> 1 OrElse funcType.ContainingNamespace.ToString() <> "System" Then