1 instantiation of FileScopedNamespaceDeclarationSyntax
Microsoft.CodeAnalysis.CSharp (1)
_generated\1\Syntax.xml.Internal.Generated.cs (1)
15910internal override SyntaxNode CreateRed(SyntaxNode? parent, int position) => new CSharp.Syntax.FileScopedNamespaceDeclarationSyntax(this, parent, position);
99 references to FileScopedNamespaceDeclarationSyntax
Microsoft.CodeAnalysis.CSharp (34)
_generated\0\Syntax.xml.Main.Generated.cs (7)
489public virtual TResult? VisitFileScopedNamespaceDeclaration(FileScopedNamespaceDeclarationSyntax node) => this.DefaultVisit(node); 1243public virtual void VisitFileScopedNamespaceDeclaration(FileScopedNamespaceDeclarationSyntax node) => this.DefaultVisit(node); 1996public override SyntaxNode? VisitFileScopedNamespaceDeclaration(FileScopedNamespaceDeclarationSyntax node) 4904public static FileScopedNamespaceDeclarationSyntax FileScopedNamespaceDeclaration(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, SyntaxToken namespaceKeyword, NameSyntax name, SyntaxToken semicolonToken, SyntaxList<ExternAliasDirectiveSyntax> externs, SyntaxList<UsingDirectiveSyntax> usings, SyntaxList<MemberDeclarationSyntax> members) 4909return (FileScopedNamespaceDeclarationSyntax)Syntax.InternalSyntax.SyntaxFactory.FileScopedNamespaceDeclaration(attributeLists.Node.ToGreenList<Syntax.InternalSyntax.AttributeListSyntax>(), modifiers.Node.ToGreenList<Syntax.InternalSyntax.SyntaxToken>(), (Syntax.InternalSyntax.SyntaxToken)namespaceKeyword.Node!, (Syntax.InternalSyntax.NameSyntax)name.Green, (Syntax.InternalSyntax.SyntaxToken)semicolonToken.Node!, externs.Node.ToGreenList<Syntax.InternalSyntax.ExternAliasDirectiveSyntax>(), usings.Node.ToGreenList<Syntax.InternalSyntax.UsingDirectiveSyntax>(), members.Node.ToGreenList<Syntax.InternalSyntax.MemberDeclarationSyntax>()).CreateRed(); 4913public static FileScopedNamespaceDeclarationSyntax FileScopedNamespaceDeclaration(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, NameSyntax name, SyntaxList<ExternAliasDirectiveSyntax> externs, SyntaxList<UsingDirectiveSyntax> usings, SyntaxList<MemberDeclarationSyntax> members) 4917public static FileScopedNamespaceDeclarationSyntax FileScopedNamespaceDeclaration(NameSyntax name)
_generated\2\Syntax.xml.Syntax.Generated.cs (15)
9850public FileScopedNamespaceDeclarationSyntax Update(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, SyntaxToken namespaceKeyword, NameSyntax name, SyntaxToken semicolonToken, SyntaxList<ExternAliasDirectiveSyntax> externs, SyntaxList<UsingDirectiveSyntax> usings, SyntaxList<MemberDeclarationSyntax> members) 9854var newNode = SyntaxFactory.FileScopedNamespaceDeclaration(attributeLists, modifiers, namespaceKeyword, name, semicolonToken, externs, usings, members); 9863public new FileScopedNamespaceDeclarationSyntax WithAttributeLists(SyntaxList<AttributeListSyntax> attributeLists) => Update(attributeLists, this.Modifiers, this.NamespaceKeyword, this.Name, this.SemicolonToken, this.Externs, this.Usings, this.Members); 9865public new FileScopedNamespaceDeclarationSyntax WithModifiers(SyntaxTokenList modifiers) => Update(this.AttributeLists, modifiers, this.NamespaceKeyword, this.Name, this.SemicolonToken, this.Externs, this.Usings, this.Members); 9867public new FileScopedNamespaceDeclarationSyntax WithNamespaceKeyword(SyntaxToken namespaceKeyword) => Update(this.AttributeLists, this.Modifiers, namespaceKeyword, this.Name, this.SemicolonToken, this.Externs, this.Usings, this.Members); 9869public new FileScopedNamespaceDeclarationSyntax WithName(NameSyntax name) => Update(this.AttributeLists, this.Modifiers, this.NamespaceKeyword, name, this.SemicolonToken, this.Externs, this.Usings, this.Members); 9870public FileScopedNamespaceDeclarationSyntax WithSemicolonToken(SyntaxToken semicolonToken) => Update(this.AttributeLists, this.Modifiers, this.NamespaceKeyword, this.Name, semicolonToken, this.Externs, this.Usings, this.Members); 9872public new FileScopedNamespaceDeclarationSyntax WithExterns(SyntaxList<ExternAliasDirectiveSyntax> externs) => Update(this.AttributeLists, this.Modifiers, this.NamespaceKeyword, this.Name, this.SemicolonToken, externs, this.Usings, this.Members); 9874public new FileScopedNamespaceDeclarationSyntax WithUsings(SyntaxList<UsingDirectiveSyntax> usings) => Update(this.AttributeLists, this.Modifiers, this.NamespaceKeyword, this.Name, this.SemicolonToken, this.Externs, usings, this.Members); 9876public new FileScopedNamespaceDeclarationSyntax WithMembers(SyntaxList<MemberDeclarationSyntax> members) => Update(this.AttributeLists, this.Modifiers, this.NamespaceKeyword, this.Name, this.SemicolonToken, this.Externs, this.Usings, members); 9879public new FileScopedNamespaceDeclarationSyntax AddAttributeLists(params AttributeListSyntax[] items) => WithAttributeLists(this.AttributeLists.AddRange(items)); 9881public new FileScopedNamespaceDeclarationSyntax AddModifiers(params SyntaxToken[] items) => WithModifiers(this.Modifiers.AddRange(items)); 9883public new FileScopedNamespaceDeclarationSyntax AddExterns(params ExternAliasDirectiveSyntax[] items) => WithExterns(this.Externs.AddRange(items)); 9885public new FileScopedNamespaceDeclarationSyntax AddUsings(params UsingDirectiveSyntax[] items) => WithUsings(this.Usings.AddRange(items)); 9887public new FileScopedNamespaceDeclarationSyntax AddMembers(params MemberDeclarationSyntax[] items) => WithMembers(this.Members.AddRange(items));
Binder\BinderFactory.BinderFactoryVisitor.cs (1)
842public override Binder VisitFileScopedNamespaceDeclaration(FileScopedNamespaceDeclarationSyntax parent)
Compilation\CSharpSemanticModel.cs (2)
2979public abstract INamespaceSymbol GetDeclaredSymbol(FileScopedNamespaceDeclarationSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken)); 5179return this.GetDeclaredSymbol((FileScopedNamespaceDeclarationSyntax)node, cancellationToken);
Compilation\MemberSemanticModel.cs (1)
605public override INamespaceSymbol GetDeclaredSymbol(FileScopedNamespaceDeclarationSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken))
Compilation\SpeculativeSemanticModelWithMemberModel.cs (1)
260public override INamespaceSymbol GetDeclaredSymbol(FileScopedNamespaceDeclarationSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken))
Compilation\SyntaxTreeSemanticModel.cs (1)
1314public override INamespaceSymbol GetDeclaredSymbol(FileScopedNamespaceDeclarationSyntax declarationSyntax, CancellationToken cancellationToken = default)
CSharpExtensions.cs (1)
1396public static INamespaceSymbol? GetDeclaredSymbol(this SemanticModel? semanticModel, FileScopedNamespaceDeclarationSyntax declarationSyntax, CancellationToken cancellationToken = default(CancellationToken))
Declarations\DeclarationTreeBuilder.cs (4)
495public override SingleNamespaceOrTypeDeclaration VisitFileScopedNamespaceDeclaration(FileScopedNamespaceDeclarationSyntax node) 528if (node is FileScopedNamespaceDeclarationSyntax) 532if (node.Parent is FileScopedNamespaceDeclarationSyntax) 574if (node.Parent is FileScopedNamespaceDeclarationSyntax)
Syntax\LookupPosition.cs (1)
170internal static bool IsInNamespaceDeclaration(int position, FileScopedNamespaceDeclarationSyntax namespaceDecl)
Microsoft.CodeAnalysis.CSharp.CodeStyle (6)
src\roslyn\src\Analyzers\CSharp\Analyzers\ConvertNamespace\ConvertNamespaceAnalysis.cs (1)
26if (declaration is not FileScopedNamespaceDeclarationSyntax)
src\roslyn\src\Analyzers\CSharp\Analyzers\ConvertNamespace\ConvertToBlockScopedNamespaceDiagnosticAnalyzer.cs (3)
33var namespaceDeclaration = (FileScopedNamespaceDeclarationSyntax)context.Node; 40private Diagnostic? AnalyzeNamespace(SyntaxNodeAnalysisContext context, FileScopedNamespaceDeclarationSyntax declaration)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\ElasticTriviaFormattingRule.cs (1)
185if (previousToken.Parent is not FileScopedNamespaceDeclarationSyntax)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\TokenBasedFormattingRule.cs (1)
246if (previousToken.Parent is FileScopedNamespaceDeclarationSyntax)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (16)
src\roslyn\src\Analyzers\CSharp\CodeFixes\ConvertNamespace\ConvertNamespaceTransform.cs (12)
29FileScopedNamespaceDeclarationSyntax fileScopedNamespace => ConvertFileScopedNamespaceAsync(document, fileScopedNamespace, options, cancellationToken), 84var converted = ConvertNamespaceDeclaration(namespaceDeclaration); 88var fileScopedNamespace = (FileScopedNamespaceDeclarationSyntax)updatedRoot.GetAnnotatedNodes(annotation).Single(); 115var fileScopedNamespace = (FileScopedNamespaceDeclarationSyntax)root.GetAnnotatedNodes(annotation).Single(); 239Document document, FileScopedNamespaceDeclarationSyntax fileScopedNamespace, CSharpSyntaxFormattingOptions options, CancellationToken cancellationToken) 260ParsedDocument document, FileScopedNamespaceDeclarationSyntax namespaceDeclaration, string lineEnding, NewLinePlacement newLinePlacement, SyntaxAnnotation annotation) 323private static FileScopedNamespaceDeclarationSyntax ConvertNamespaceDeclaration(NamespaceDeclarationSyntax namespaceDeclaration) 335var fileScopedNamespace = FileScopedNamespaceDeclaration( 382private static NamespaceDeclarationSyntax ConvertFileScopedNamespace(ParsedDocument document, FileScopedNamespaceDeclarationSyntax fileScopedNamespace, string lineEnding, NewLinePlacement newLinePlacement) 393FileScopedNamespaceDeclarationSyntax adjustedFileScopedNamespace;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTokenExtensions.cs (1)
225if (token.Parent is FileScopedNamespaceDeclarationSyntax namespaceDeclaration && namespaceDeclaration.SemicolonToken == token)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\SemanticModelExtensions.cs (1)
26: semanticModel.GetDeclaredSymbol((FileScopedNamespaceDeclarationSyntax)declarationSyntax, cancellationToken);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpAddImportsService.cs (1)
124public override SyntaxNode? VisitFileScopedNamespaceDeclaration(FileScopedNamespaceDeclarationSyntax node)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpRemoveUnnecessaryImportsService.Rewriter.cs (1)
194public override SyntaxNode VisitFileScopedNamespaceDeclaration(FileScopedNamespaceDeclarationSyntax node)
Microsoft.CodeAnalysis.CSharp.Features (23)
CodeRefactorings\SyncNamespace\CSharpChangeNamespaceService.cs (1)
474else if (baseNamespace is FileScopedNamespaceDeclarationSyntax fileScopedNamespace)
ConvertNamespace\ConvertNamespaceCodeRefactoringProvider.cs (1)
78if (baseDeclaration is FileScopedNamespaceDeclarationSyntax fileScopedNamespace)
ConvertProgram\ConvertProgramTransform_TopLevelStatements.cs (1)
64return root.Members.OfType<FileScopedNamespaceDeclarationSyntax>().FirstOrDefault() is { } fileScopedNamespace
MoveToNamespace\CSharpMoveToNamespaceService.cs (1)
42FileScopedNamespaceDeclarationSyntax fileScopedNamespace => fileScopedNamespace.SemicolonToken.Span.End,
src\roslyn\src\Analyzers\CSharp\Analyzers\ConvertNamespace\ConvertNamespaceAnalysis.cs (1)
26if (declaration is not FileScopedNamespaceDeclarationSyntax)
src\roslyn\src\Analyzers\CSharp\Analyzers\ConvertNamespace\ConvertToBlockScopedNamespaceDiagnosticAnalyzer.cs (3)
33var namespaceDeclaration = (FileScopedNamespaceDeclarationSyntax)context.Node; 40private Diagnostic? AnalyzeNamespace(SyntaxNodeAnalysisContext context, FileScopedNamespaceDeclarationSyntax declaration)
src\roslyn\src\Analyzers\CSharp\CodeFixes\ConvertNamespace\ConvertNamespaceTransform.cs (12)
29FileScopedNamespaceDeclarationSyntax fileScopedNamespace => ConvertFileScopedNamespaceAsync(document, fileScopedNamespace, options, cancellationToken), 84var converted = ConvertNamespaceDeclaration(namespaceDeclaration); 88var fileScopedNamespace = (FileScopedNamespaceDeclarationSyntax)updatedRoot.GetAnnotatedNodes(annotation).Single(); 115var fileScopedNamespace = (FileScopedNamespaceDeclarationSyntax)root.GetAnnotatedNodes(annotation).Single(); 239Document document, FileScopedNamespaceDeclarationSyntax fileScopedNamespace, CSharpSyntaxFormattingOptions options, CancellationToken cancellationToken) 260ParsedDocument document, FileScopedNamespaceDeclarationSyntax namespaceDeclaration, string lineEnding, NewLinePlacement newLinePlacement, SyntaxAnnotation annotation) 323private static FileScopedNamespaceDeclarationSyntax ConvertNamespaceDeclaration(NamespaceDeclarationSyntax namespaceDeclaration) 335var fileScopedNamespace = FileScopedNamespaceDeclaration( 382private static NamespaceDeclarationSyntax ConvertFileScopedNamespace(ParsedDocument document, FileScopedNamespaceDeclarationSyntax fileScopedNamespace, string lineEnding, NewLinePlacement newLinePlacement) 393FileScopedNamespaceDeclarationSyntax adjustedFileScopedNamespace;
Structure\CSharpBlockStructureProvider.cs (1)
36builder.Add<FileScopedNamespaceDeclarationSyntax, FileScopedNamespaceDeclarationStructureProvider>();
Structure\Providers\FileScopedNamespaceDeclarationStructureProvider.cs (2)
15internal sealed class FileScopedNamespaceDeclarationStructureProvider : AbstractSyntaxNodeStructureProvider<FileScopedNamespaceDeclarationSyntax> 19FileScopedNamespaceDeclarationSyntax fileScopedNamespaceDeclaration,
Microsoft.CodeAnalysis.CSharp.Workspaces (7)
OrganizeImports\CSharpOrganizeImportsService.Rewriter.cs (1)
32public override SyntaxNode VisitFileScopedNamespaceDeclaration(FileScopedNamespaceDeclarationSyntax node)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\ElasticTriviaFormattingRule.cs (1)
185if (previousToken.Parent is not FileScopedNamespaceDeclarationSyntax)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\TokenBasedFormattingRule.cs (1)
246if (previousToken.Parent is FileScopedNamespaceDeclarationSyntax)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTokenExtensions.cs (1)
225if (token.Parent is FileScopedNamespaceDeclarationSyntax namespaceDeclaration && namespaceDeclaration.SemicolonToken == token)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\SemanticModelExtensions.cs (1)
26: semanticModel.GetDeclaredSymbol((FileScopedNamespaceDeclarationSyntax)declarationSyntax, cancellationToken);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpAddImportsService.cs (1)
124public override SyntaxNode? VisitFileScopedNamespaceDeclaration(FileScopedNamespaceDeclarationSyntax node)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpRemoveUnnecessaryImportsService.Rewriter.cs (1)
194public override SyntaxNode VisitFileScopedNamespaceDeclaration(FileScopedNamespaceDeclarationSyntax node)
Microsoft.Extensions.Logging.Generators (1)
LoggerMessageGenerator.Parser.cs (1)
550&& potentialNamespaceParent is not FileScopedNamespaceDeclarationSyntax
Microsoft.Gen.Logging (1)
Parser.cs (1)
301potentialNamespaceParent is not FileScopedNamespaceDeclarationSyntax)
Microsoft.Gen.MetadataExtractor (1)
Parser_2.cs (1)
111potentialNamespaceParent is not FileScopedNamespaceDeclarationSyntax)
Microsoft.Gen.Metrics (1)
Parser.cs (1)
111potentialNamespaceParent is not FileScopedNamespaceDeclarationSyntax)
Microsoft.Gen.MetricsReports (1)
Parser.cs (1)
111potentialNamespaceParent is not FileScopedNamespaceDeclarationSyntax)
QuarantineTools.Tests (2)
ActiveIssueTests.cs (1)
345case FileScopedNamespaceDeclarationSyntax fsn:
QuarantineScriptTests.cs (1)
289case FileScopedNamespaceDeclarationSyntax fsn:
Roslyn.Diagnostics.CSharp.Analyzers (6)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\ElasticTriviaFormattingRule.cs (1)
185if (previousToken.Parent is not FileScopedNamespaceDeclarationSyntax)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\TokenBasedFormattingRule.cs (1)
246if (previousToken.Parent is FileScopedNamespaceDeclarationSyntax)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTokenExtensions.cs (1)
225if (token.Parent is FileScopedNamespaceDeclarationSyntax namespaceDeclaration && namespaceDeclaration.SemicolonToken == token)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\SemanticModelExtensions.cs (1)
26: semanticModel.GetDeclaredSymbol((FileScopedNamespaceDeclarationSyntax)declarationSyntax, cancellationToken);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpAddImportsService.cs (1)
124public override SyntaxNode? VisitFileScopedNamespaceDeclaration(FileScopedNamespaceDeclarationSyntax node)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpRemoveUnnecessaryImportsService.Rewriter.cs (1)
194public override SyntaxNode VisitFileScopedNamespaceDeclaration(FileScopedNamespaceDeclarationSyntax node)