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