143 references to NamespaceDeclaration
Microsoft.CodeAnalysis.CSharp (20)
Binder\BinderFactory.BinderFactoryVisitor.cs (1)
1036Debug.Assert(declarationSyntax.Kind() is SyntaxKind.CompilationUnit or SyntaxKind.NamespaceDeclaration or SyntaxKind.FileScopedNamespaceDeclaration);
Binder\BinderFactory.cs (1)
188case SyntaxKind.NamespaceDeclaration:
Binder\WithExternAliasesBinder.cs (1)
91Debug.Assert(declarationSyntax.Kind() is SyntaxKind.CompilationUnit or SyntaxKind.NamespaceDeclaration or SyntaxKind.FileScopedNamespaceDeclaration);
Binder\WithExternAndUsingAliasesBinder.cs (1)
120Debug.Assert(declarationSyntax.Kind() is SyntaxKind.CompilationUnit or SyntaxKind.NamespaceDeclaration or SyntaxKind.FileScopedNamespaceDeclaration);
Binder\WithUsingNamespacesAndTypesBinder.cs (2)
278Debug.Assert(declarationSyntax.Kind() is SyntaxKind.CompilationUnit or SyntaxKind.NamespaceDeclaration or SyntaxKind.FileScopedNamespaceDeclaration); 308Debug.Assert(declarationSyntax.IsKind(SyntaxKind.CompilationUnit) || declarationSyntax.IsKind(SyntaxKind.NamespaceDeclaration));
Compilation\CSharpSemanticModel.cs (1)
5115case SyntaxKind.NamespaceDeclaration:
Compilation\SyntaxTreeSemanticModel.cs (2)
2304if (memberDeclaration.Kind() is SyntaxKind.NamespaceDeclaration or SyntaxKind.FileScopedNamespaceDeclaration) 2335if (memberDeclaration.Kind() is SyntaxKind.NamespaceDeclaration or SyntaxKind.FileScopedNamespaceDeclaration
Declarations\DeclarationKind.cs (1)
38case SyntaxKind.NamespaceDeclaration:
Declarations\DeclarationTreeBuilder.cs (1)
129node.Kind() is SyntaxKind.NamespaceDeclaration or SyntaxKind.FileScopedNamespaceDeclaration ||
Parser\LanguageParser.cs (5)
309this.ParseNamespaceBody(ref openBrace, ref body, ref initialBadNodes, SyntaxKind.NamespaceDeclaration); 790case SyntaxKind.NamespaceDeclaration: 2417case SyntaxKind.NamespaceDeclaration: 2957else if (parentKind is SyntaxKind.NamespaceDeclaration or SyntaxKind.FileScopedNamespaceDeclaration || 4985parentKind is not SyntaxKind.NamespaceDeclaration and not SyntaxKind.FileScopedNamespaceDeclaration &&
src\Compilers\CSharp\CSharpAnalyzerDriver\CSharpDeclarationComputer.cs (1)
77case SyntaxKind.NamespaceDeclaration:
Symbols\Source\SourceMemberContainerSymbol.cs (2)
3543case SyntaxKind.NamespaceDeclaration: 5258m.Kind() is SyntaxKind.NamespaceDeclaration or
Syntax\SyntaxKindFacts.cs (1)
395kind == SyntaxKind.NamespaceDeclaration ||
Microsoft.CodeAnalysis.CSharp.CodeStyle (7)
src\Analyzers\CSharp\Analyzers\AddAccessibilityModifiers\CSharpAddAccessibilityModifiers.cs (1)
89case SyntaxKind.NamespaceDeclaration:
src\Analyzers\CSharp\Analyzers\ConvertNamespace\ConvertToFileScopedNamespaceDiagnosticAnalyzer.cs (1)
30=> context.RegisterSyntaxNodeAction(AnalyzeNamespace, SyntaxKind.NamespaceDeclaration);
src\Analyzers\CSharp\Analyzers\MatchFolderAndNamespace\CSharpMatchFolderAndNamespaceDiagnosticAnalyzer.cs (1)
37=> [SyntaxKind.NamespaceDeclaration, SyntaxKind.FileScopedNamespaceDeclaration];
src\Analyzers\CSharp\Analyzers\MisplacedUsingDirectives\MisplacedUsingDirectivesDiagnosticAnalyzer.cs (2)
53context.RegisterSyntaxNodeAction(AnalyzeNamespaceNode, SyntaxKind.NamespaceDeclaration, SyntaxKind.FileScopedNamespaceDeclaration); 95t => t.Kind() is not (SyntaxKind.UsingDirective or SyntaxKind.NamespaceDeclaration or SyntaxKind.FileScopedNamespaceDeclaration));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpAccessibilityFacts.cs (1)
191case SyntaxKind.NamespaceDeclaration:
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (1)
833case SyntaxKind.NamespaceDeclaration:
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (3)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationHelpers.cs (1)
237SyntaxKind.NamespaceDeclaration => CodeGenerationDestination.Namespace,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationService.cs (1)
919case SyntaxKind.NamespaceDeclaration:
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (1)
482else if (token.Parent.IsKind(SyntaxKind.NamespaceDeclaration))
Microsoft.CodeAnalysis.CSharp.Features (15)
Completion\KeywordRecommenders\ExternKeywordRecommender.cs (1)
91token.Parent.IsKind(SyntaxKind.NamespaceDeclaration))
Completion\KeywordRecommenders\NamespaceKeywordRecommender.cs (2)
105token.Parent.IsKind(SyntaxKind.NamespaceDeclaration)) 133else if (token.Parent.IsKind(SyntaxKind.NamespaceDeclaration))
Completion\KeywordRecommenders\UsingKeywordRecommender.cs (1)
103if ((token.Kind() == SyntaxKind.OpenBraceToken && token.Parent.IsKind(SyntaxKind.NamespaceDeclaration))
EditAndContinue\SyntaxComparer.cs (3)
321case SyntaxKind.NamespaceDeclaration: 584case SyntaxKind.NamespaceDeclaration: 1421case SyntaxKind.NamespaceDeclaration:
ExtractMethod\CSharpMethodExtractor.cs (1)
122Contract.ThrowIfTrue(memberNode.Kind() == SyntaxKind.NamespaceDeclaration);
LineSeparators\CSharpLineSeparatorService.cs (1)
79case SyntaxKind.NamespaceDeclaration:
src\Analyzers\CSharp\Analyzers\AddAccessibilityModifiers\CSharpAddAccessibilityModifiers.cs (1)
89case SyntaxKind.NamespaceDeclaration:
src\Analyzers\CSharp\Analyzers\ConvertNamespace\ConvertToFileScopedNamespaceDiagnosticAnalyzer.cs (1)
30=> context.RegisterSyntaxNodeAction(AnalyzeNamespace, SyntaxKind.NamespaceDeclaration);
src\Analyzers\CSharp\Analyzers\MatchFolderAndNamespace\CSharpMatchFolderAndNamespaceDiagnosticAnalyzer.cs (1)
37=> [SyntaxKind.NamespaceDeclaration, SyntaxKind.FileScopedNamespaceDeclaration];
src\Analyzers\CSharp\Analyzers\MisplacedUsingDirectives\MisplacedUsingDirectivesDiagnosticAnalyzer.cs (2)
53context.RegisterSyntaxNodeAction(AnalyzeNamespaceNode, SyntaxKind.NamespaceDeclaration, SyntaxKind.FileScopedNamespaceDeclaration); 95t => t.Kind() is not (SyntaxKind.UsingDirective or SyntaxKind.NamespaceDeclaration or SyntaxKind.FileScopedNamespaceDeclaration));
src\Compilers\CSharp\CSharpAnalyzerDriver\CSharpDeclarationComputer.cs (1)
77case SyntaxKind.NamespaceDeclaration:
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (4)
Diagnostics\Suppression\SuppressionTests.cs (4)
1068=> context.RegisterSyntaxNodeAction(AnalyzeNode, SyntaxKind.ClassDeclaration, SyntaxKind.EnumDeclaration, SyntaxKind.NamespaceDeclaration, SyntaxKind.MethodDeclaration, SyntaxKind.PropertyDeclaration, SyntaxKind.FieldDeclaration, SyntaxKind.EventDeclaration); 1079case SyntaxKind.NamespaceDeclaration: 2062=> context.RegisterSyntaxNodeAction(AnalyzeNode, SyntaxKind.ClassDeclaration, SyntaxKind.NamespaceDeclaration, SyntaxKind.MethodDeclaration); 2073case SyntaxKind.NamespaceDeclaration:
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (3)
Compilation\SemanticModelAPITests.cs (1)
404var nsArray = tree.GetCompilationUnitRoot().DescendantNodes().Where(node => node.IsKind(SyntaxKind.NamespaceDeclaration)).ToArray();
Symbols\ImplicitClassTests.cs (1)
37Assert.Equal(SyntaxKind.NamespaceDeclaration, implicitClass.DeclaringSyntaxReferences.Single().GetSyntax().Kind());
Symbols\Source\DeclaringSyntaxNodeTests.cs (1)
419CheckDeclaringSyntaxNodesWithoutGetDeclaredSymbol(comp, n1, 2, SyntaxKind.NamespaceDeclaration);
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (70)
Parsing\AsyncParsingTests.cs (1)
2309N(SyntaxKind.NamespaceDeclaration);
Parsing\DeclarationParsingTests.cs (11)
570Assert.Equal(SyntaxKind.NamespaceDeclaration, file.Members[0].Kind()); 613Assert.Equal(SyntaxKind.NamespaceDeclaration, file.Members[0].Kind()); 635Assert.Equal(SyntaxKind.NamespaceDeclaration, file.Members[0].Kind()); 680Assert.Equal(SyntaxKind.NamespaceDeclaration, file.Members[0].Kind()); 725Assert.Equal(SyntaxKind.NamespaceDeclaration, file.Members[0].Kind()); 749Assert.Equal(SyntaxKind.NamespaceDeclaration, file.Members[0].Kind()); 757Assert.Equal(SyntaxKind.NamespaceDeclaration, ns.Members[0].Kind()); 8413N(SyntaxKind.NamespaceDeclaration); 8656N(SyntaxKind.NamespaceDeclaration); 8703N(SyntaxKind.NamespaceDeclaration); 8750N(SyntaxKind.NamespaceDeclaration);
Parsing\FileModifierParsingTests.cs (3)
630N(SyntaxKind.NamespaceDeclaration); 2378N(SyntaxKind.NamespaceDeclaration); 2441N(SyntaxKind.NamespaceDeclaration);
Parsing\MemberDeclarationParsingTests.cs (16)
10502N(SyntaxKind.NamespaceDeclaration); 10587N(SyntaxKind.NamespaceDeclaration); 10695N(SyntaxKind.NamespaceDeclaration); 10820N(SyntaxKind.NamespaceDeclaration); 10979N(SyntaxKind.NamespaceDeclaration); 11330N(SyntaxKind.NamespaceDeclaration); 11338N(SyntaxKind.NamespaceDeclaration); 11458N(SyntaxKind.NamespaceDeclaration); 11630N(SyntaxKind.NamespaceDeclaration); 11927N(SyntaxKind.NamespaceDeclaration); 11986N(SyntaxKind.NamespaceDeclaration); 12048N(SyntaxKind.NamespaceDeclaration); 12108N(SyntaxKind.NamespaceDeclaration); 12170N(SyntaxKind.NamespaceDeclaration); 12251N(SyntaxKind.NamespaceDeclaration); 12342N(SyntaxKind.NamespaceDeclaration);
Parsing\ParsingErrorRecoveryTests.cs (14)
291Assert.Equal(SyntaxKind.NamespaceDeclaration, file.Members[0].Kind()); 484Assert.Equal(SyntaxKind.NamespaceDeclaration, file.Members[0].Kind()); 515Assert.Equal(SyntaxKind.NamespaceDeclaration, file.Members[0].Kind()); 529Assert.Equal(SyntaxKind.NamespaceDeclaration, file.Members[0].Kind()); 543Assert.Equal(SyntaxKind.NamespaceDeclaration, file.Members[0].Kind()); 557Assert.Equal(SyntaxKind.NamespaceDeclaration, file.Members[0].Kind()); 572Assert.Equal(SyntaxKind.NamespaceDeclaration, file.Members[0].Kind()); 767Assert.Equal(SyntaxKind.NamespaceDeclaration, file.Members[0].Kind()); 781Assert.Equal(SyntaxKind.NamespaceDeclaration, file.Members[0].Kind()); 795Assert.Equal(SyntaxKind.NamespaceDeclaration, file.Members[0].Kind()); 809Assert.Equal(SyntaxKind.NamespaceDeclaration, file.Members[0].Kind()); 823Assert.Equal(SyntaxKind.NamespaceDeclaration, file.Members[0].Kind()); 847Assert.Equal(SyntaxKind.NamespaceDeclaration, file.Members[0].Kind()); 7112Assert.Equal(SyntaxKind.NamespaceDeclaration, namespaceDeclaration.Kind());
Parsing\SingleLineDeclarationParsingTests.cs (7)
45N(SyntaxKind.NamespaceDeclaration); 74N(SyntaxKind.NamespaceDeclaration); 106N(SyntaxKind.NamespaceDeclaration); 143N(SyntaxKind.NamespaceDeclaration); 400N(SyntaxKind.NamespaceDeclaration); 443N(SyntaxKind.NamespaceDeclaration); 470N(SyntaxKind.NamespaceDeclaration);
Parsing\TopLevelStatementsParsingTests.cs (1)
308N(SyntaxKind.NamespaceDeclaration);
Parsing\UsingDirectiveParsingTests.cs (7)
1188N(SyntaxKind.NamespaceDeclaration); 1260N(SyntaxKind.NamespaceDeclaration); 1335N(SyntaxKind.NamespaceDeclaration); 1411N(SyntaxKind.NamespaceDeclaration); 1495N(SyntaxKind.NamespaceDeclaration); 1975N(SyntaxKind.NamespaceDeclaration); 2050N(SyntaxKind.NamespaceDeclaration);
Syntax\SyntaxTreeTests.cs (10)
403N(SyntaxKind.NamespaceDeclaration); 451N(SyntaxKind.NamespaceDeclaration); 546N(SyntaxKind.NamespaceDeclaration); 595N(SyntaxKind.NamespaceDeclaration); 708N(SyntaxKind.NamespaceDeclaration); 767N(SyntaxKind.NamespaceDeclaration); 816N(SyntaxKind.NamespaceDeclaration); 881N(SyntaxKind.NamespaceDeclaration); 889N(SyntaxKind.NamespaceDeclaration); 928N(SyntaxKind.NamespaceDeclaration);
Microsoft.CodeAnalysis.CSharp.Workspaces (7)
CodeGeneration\CSharpSyntaxGenerator.cs (1)
140case SyntaxKind.NamespaceDeclaration:
Simplification\Simplifiers\NameSimplifier.cs (1)
566case SyntaxKind.NamespaceDeclaration:
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpAccessibilityFacts.cs (1)
191case SyntaxKind.NamespaceDeclaration:
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (1)
833case SyntaxKind.NamespaceDeclaration:
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationHelpers.cs (1)
237SyntaxKind.NamespaceDeclaration => CodeGenerationDestination.Namespace,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationService.cs (1)
919case SyntaxKind.NamespaceDeclaration:
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (1)
482else if (token.Parent.IsKind(SyntaxKind.NamespaceDeclaration))
Microsoft.CodeAnalysis.Test.Utilities (1)
Diagnostics\CommonDiagnosticAnalyzers.cs (1)
695protected override SyntaxKind NamespaceDeclarationSyntaxKind => SyntaxKind.NamespaceDeclaration;
Microsoft.ML.InternalCodeAnalyzer (1)
NameAnalyzer.cs (1)
86context.RegisterSyntaxNodeAction(AnalyzeNamespace, SyntaxKind.NamespaceDeclaration);
Microsoft.VisualStudio.LanguageServices.CSharp (12)
CodeModel\CSharpCodeModelService.cs (9)
105case SyntaxKind.NamespaceDeclaration: 139case SyntaxKind.NamespaceDeclaration: 409if (member.Kind() != SyntaxKind.NamespaceDeclaration) 562case SyntaxKind.NamespaceDeclaration: 594case SyntaxKind.NamespaceDeclaration: 641=> (EnvDTE.CodeElement)CodeNamespace.CreateUnknown(state, fileCodeModel, (int)SyntaxKind.NamespaceDeclaration, string.Empty); 828case SyntaxKind.NamespaceDeclaration: 903case SyntaxKind.NamespaceDeclaration: 3507case SyntaxKind.NamespaceDeclaration:
CodeModel\CSharpCodeModelService.NodeLocator.cs (2)
67case SyntaxKind.NamespaceDeclaration: 118case SyntaxKind.NamespaceDeclaration:
CodeModel\CSharpCodeModelService.NodeNameGenerator.cs (1)
165case SyntaxKind.NamespaceDeclaration: