1 instantiation of GlobalStatementSyntax
Microsoft.CodeAnalysis.CSharp (1)
_generated\1\Syntax.xml.Internal.Generated.cs (1)
10031internal override SyntaxNode CreateRed(SyntaxNode? parent, int position) => new CSharp.Syntax.GlobalStatementSyntax(this, parent, position);
162 references to GlobalStatementSyntax
Microsoft.CodeAnalysis.CSharp (40)
_generated\0\Syntax.xml.Main.Generated.cs (6)
344public virtual TResult? VisitGlobalStatement(GlobalStatementSyntax node) => this.DefaultVisit(node); 1092public virtual void VisitGlobalStatement(GlobalStatementSyntax node) => this.DefaultVisit(node); 1839public override SyntaxNode? VisitGlobalStatement(GlobalStatementSyntax node) 3974public static GlobalStatementSyntax GlobalStatement(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, StatementSyntax statement) 3977return (GlobalStatementSyntax)Syntax.InternalSyntax.SyntaxFactory.GlobalStatement(attributeLists.Node.ToGreenList<Syntax.InternalSyntax.AttributeListSyntax>(), modifiers.Node.ToGreenList<Syntax.InternalSyntax.SyntaxToken>(), (Syntax.InternalSyntax.StatementSyntax)statement.Green).CreateRed(); 3981public static GlobalStatementSyntax GlobalStatement(StatementSyntax statement)
_generated\2\Syntax.xml.Syntax.Generated.cs (7)
6248public GlobalStatementSyntax Update(SyntaxList<AttributeListSyntax> attributeLists, SyntaxTokenList modifiers, StatementSyntax statement) 6252var newNode = SyntaxFactory.GlobalStatement(attributeLists, modifiers, statement); 6261public new GlobalStatementSyntax WithAttributeLists(SyntaxList<AttributeListSyntax> attributeLists) => Update(attributeLists, this.Modifiers, this.Statement); 6263public new GlobalStatementSyntax WithModifiers(SyntaxTokenList modifiers) => Update(this.AttributeLists, modifiers, this.Statement); 6264public GlobalStatementSyntax WithStatement(StatementSyntax statement) => Update(this.AttributeLists, this.Modifiers, statement); 6267public new GlobalStatementSyntax AddAttributeLists(params AttributeListSyntax[] items) => WithAttributeLists(this.AttributeLists.AddRange(items)); 6269public new GlobalStatementSyntax AddModifiers(params SyntaxToken[] items) => WithModifiers(this.Modifiers.AddRange(items));
Binder\Binder_Statements.cs (1)
3726if (statement is GlobalStatementSyntax topLevelStatement)
Binder\BinderFactory.BinderFactoryVisitor.cs (1)
103public override Binder VisitGlobalStatement(GlobalStatementSyntax node)
Binder\LocalBinderFactory.cs (1)
525public override void VisitGlobalStatement(GlobalStatementSyntax node)
Binder\ScriptLocalScopeBinder.cs (1)
88LocalScopeBinder.BuildLabels(scriptInitializer, ((GlobalStatementSyntax)member).Statement, ref builder);
Binder\SimpleProgramBinder.cs (3)
32if (statement is GlobalStatementSyntax topLevelStatement) 47if (statement is GlobalStatementSyntax topLevelStatement) 70if (statement is GlobalStatementSyntax topLevelStatement)
Compilation\CSharpCompilation.cs (3)
870if (root.DescendantNodes(n => n is GlobalStatementSyntax || n is StatementSyntax || n is CompilationUnitSyntax).Any(n => n.IsKind(SyntaxKind.ReturnStatement))) 876var lastGlobalStatement = (GlobalStatementSyntax?)root.Members.LastOrDefault(m => m.IsKind(SyntaxKind.GlobalStatement));
Compilation\CSharpSemanticModel.cs (1)
2415case GlobalStatementSyntax globalStatement:
Compilation\SyntaxTreeSemanticModel.cs (3)
938if (SyntaxFacts.IsSimpleProgramTopLevelStatement((GlobalStatementSyntax)memberDecl)) 2270bool isGlobalStatement = firstStatement.Parent is GlobalStatementSyntax; 2271if (isGlobalStatement && (lastStatement.Parent is not GlobalStatementSyntax || firstStatement.Parent.Parent != lastStatement.Parent.Parent))
Declarations\DeclarationTreeBuilder.cs (4)
146GlobalStatementSyntax firstGlobalStatement = null; 159var global = (GlobalStatementSyntax)member; 234private static SingleNamespaceOrTypeDeclaration CreateSimpleProgram(GlobalStatementSyntax firstGlobalStatement, bool hasAwaitExpressions, bool isIterator, bool hasReturnWithExpression, ImmutableArray<Diagnostic> diagnostics)
Symbols\Source\SourceMemberContainerSymbol.cs (2)
6034var globalStatement = ((GlobalStatementSyntax)m).Statement; 6081else if (reportMisplacedGlobalCode && !SyntaxFacts.IsSimpleProgramTopLevelStatement((GlobalStatementSyntax)m))
Symbols\Synthesized\SynthesizedSimpleProgramEntryPointSymbol.cs (2)
281foreach (var global in ((CompilationUnitSyntax)tree.GetRoot(cancellationToken)).Members.OfType<GlobalStatementSyntax>())
Syntax\GlobalStatementSyntax.cs (1)
9public GlobalStatementSyntax Update(StatementSyntax statement)
Syntax\SyntaxFactory.cs (2)
2421var globalStatement = (GlobalStatementSyntax)lastNode;
Syntax\SyntaxFacts.cs (2)
533internal static bool IsTopLevelStatement([NotNullWhen(true)] GlobalStatementSyntax? syntax) 538internal static bool IsSimpleProgramTopLevelStatement(GlobalStatementSyntax? syntax)
Microsoft.CodeAnalysis.CSharp.CodeStyle (22)
src\roslyn\src\Analyzers\CSharp\Analyzers\ConvertProgram\ConvertProgramAnalysis_ProgramMain.cs (2)
62return root.Members.OfType<GlobalStatementSyntax>().First().GetFirstToken().GetLocation(); 71TextSpan.FromBounds(start, root.Members.OfType<GlobalStatementSyntax>().Last().FullSpan.End));
src\roslyn\src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryLambdaExpression\CSharpRemoveUnnecessaryLambdaExpressionDiagnosticAnalyzer.cs (2)
188n => n is BlockSyntax or ArrowExpressionClauseSyntax or AnonymousFunctionExpressionSyntax or GlobalStatementSyntax); 189if (outermostBody is null or GlobalStatementSyntax)
src\roslyn\src\Analyzers\CSharp\Analyzers\RemoveUnnecessarySuppressions\UnnecessaryNullableWarningSuppressionsUtilities.cs (4)
104if (nodeToCheck is GlobalStatementSyntax globalStatement) 138var globalStatements = compilationUnit.Members.OfType<GlobalStatementSyntax>(); 193var globalStatement = updatedNode.Ancestors().OfType<GlobalStatementSyntax>().FirstOrDefault();
src\roslyn\src\Analyzers\CSharp\Analyzers\RemoveUnreachableCode\RemoveUnreachableCodeHelpers.cs (2)
26case GlobalStatementSyntax globalStatement: 38if (member is not GlobalStatementSyntax currentGlobalStatement)
src\roslyn\src\Analyzers\CSharp\Analyzers\UseDeconstruction\CSharpUseDeconstructionDiagnosticAnalyzer.cs (1)
110var searchScope = localDeclaration.Parent is GlobalStatementSyntax globalStatement
src\roslyn\src\Analyzers\CSharp\Analyzers\UseLocalFunction\CSharpUseLocalFunctionDiagnosticAnalyzer.cs (3)
96else if (localDeclaration.Parent is GlobalStatementSyntax { Parent: CompilationUnitSyntax compilationUnit }) 369else if (expressionStatement.Parent is GlobalStatementSyntax { Parent: CompilationUnitSyntax compilationUnit } globalStatement) 373&& compilationUnit.Members[globalStatementIndex - 1] is GlobalStatementSyntax previousGlobalStatement)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\CompilationUnitSyntaxExtensions.cs (1)
13=> compilationUnit.Members is [GlobalStatementSyntax, ..];
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.cs (1)
362case GlobalStatementSyntax:
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\NewLineUserSettingFormattingRule.cs (2)
171currentTokenParentParent is MemberDeclarationSyntax and not GlobalStatementSyntax) 375currentTokenParentParent is MemberDeclarationSyntax and not GlobalStatementSyntax)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpBlockFacts.cs (2)
32GlobalStatementSyntax globalStatement => globalStatement.Parent, 42CompilationUnitSyntax compilationUnit => compilationUnit.Members.OfType<GlobalStatementSyntax>().SelectAsArray(globalStatement => globalStatement.Statement),
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (2)
244=> node is GlobalStatementSyntax; 247=> ((GlobalStatementSyntax)node).Statement;
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (12)
src\roslyn\src\Analyzers\CSharp\CodeFixes\InlineDeclaration\CSharpInlineDeclarationCodeFixProvider.cs (1)
175editor.RemoveNode(localDeclarationStatement.Parent is GlobalStatementSyntax globalStatement
src\roslyn\src\Analyzers\CSharp\CodeFixes\RemoveUnusedLocalFunction\CSharpRemoveUnusedLocalFunctionCodeFixProvider.cs (1)
51editor.RemoveNode(localFunction.Parent is GlobalStatementSyntax globalStatement ? globalStatement : localFunction);
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseLocalFunction\CSharpUseLocalFunctionCodeFixProvider.cs (1)
171editor.RemoveNode(anonymousFunctionStatement.Parent is GlobalStatementSyntax globalStatement
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseSimpleUsingStatement\UseSimpleUsingStatementCodeFixProvider.cs (2)
48var blockLikes = topmostUsingStatements.Select(u => u.Parent is GlobalStatementSyntax ? u.Parent.GetRequiredParent() : u.GetRequiredParent()).ToSet(); 107compilationUnit.Members.ReplaceRange((GlobalStatementSyntax)usingStatement.GetRequiredParent(), expandedUsingStatements.Select(GlobalStatement))),
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeFixesAndRefactorings\CSharpFixAllSpanMappingService.cs (2)
29if (node.GetAncestorOrThis<GlobalStatementSyntax>() is null) 41var globalStatements = root.ChildNodes().OfType<GlobalStatementSyntax>();
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationService.cs (1)
118if (destination is GlobalStatementSyntax)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\NamedTypeGenerator.cs (2)
65after: static members => members.LastOrDefault(m => m is GlobalStatementSyntax), 66canPlaceAtIndex: static (members, index) => index >= members.Count || members[index] is not GlobalStatementSyntax);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTokenExtensions.cs (2)
219var globalStatement = token.GetAncestor<GlobalStatementSyntax>();
Microsoft.CodeAnalysis.CSharp.Features (56)
CodeRefactorings\ConvertLocalFunctionToMethod\CSharpConvertLocalFunctionToMethodCodeRefactoringProvider.cs (1)
47if (container is null or GlobalStatementSyntax or FieldDeclarationSyntax or EventFieldDeclarationSyntax)
CodeRefactorings\InlineTemporary\InlineTemporaryCodeRefactoringProvider.cs (1)
422if (newLocalDeclaration?.Parent is GlobalStatementSyntax globalStatement)
CodeRefactorings\NodeSelectionHelpers.cs (2)
43IncompleteMemberSyntax or GlobalStatementSyntax => [], 61return members.Any(m => m is GlobalStatementSyntax or IncompleteMemberSyntax)
ConvertProgram\ConvertProgramTransform_ProgramMain.cs (5)
44var newRoot = root.RemoveNodes(root.Members.OfType<GlobalStatementSyntax>().Skip(1), SyntaxGenerator.DefaultRemoveOptions); 53var firstGlobalStatement = newRoot.Members.OfType<GlobalStatementSyntax>().Single(); 127foreach (var globalStatement in root.Members.OfType<GlobalStatementSyntax>())
ConvertProgram\ConvertProgramTransform_TopLevelStatements.cs (2)
194private static ImmutableArray<GlobalStatementSyntax> GetGlobalStatements( 271var globalStatements = new FixedSizeArrayBuilder<GlobalStatementSyntax>(statements.Count);
Debugging\CSharpProximityExpressionsService.Worker.cs (1)
120&& _parentStatement.Parent is GlobalStatementSyntax { Parent: CompilationUnitSyntax compilationUnit } globalStatement
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (1)
1613var globalStatements = unit.Members.OfType<GlobalStatementSyntax>();
EditAndContinue\DeclarationBody\TopLevelCodeDeclarationBody.cs (3)
25private IEnumerable<GlobalStatementSyntax> GlobalStatements 26=> unit.Members.OfType<GlobalStatementSyntax>(); 32=> model.AnalyzeDataFlow(((GlobalStatementSyntax)unit.Members[0]).Statement, GlobalStatements.Last().Statement)!.CapturedInside;
EditAndContinue\SyntaxUtilities.cs (1)
134=> compilationUnit.Members is [GlobalStatementSyntax, ..];
ExtractMethod\CSharpMethodExtractor.cs (5)
55var globalStatement = root.FindToken(originalSpanStart).GetAncestor<GlobalStatementSyntax>(); 101if (currentNode is GlobalStatementSyntax globalStatement) 129if (memberNode is GlobalStatementSyntax globalStatement) 135SyntaxNode GetInsertionPointForGlobalStatement(GlobalStatementSyntax globalStatement, MemberDeclarationSyntax memberNode)
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.CallSiteContainerRewriter.cs (1)
342public override SyntaxNode VisitGlobalStatement(GlobalStatementSyntax node)
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.MultipleStatementsCodeGenerator.cs (2)
75GlobalStatementSyntax globalStatement => ((CompilationUnitSyntax)globalStatement.Parent).Members.OfType<GlobalStatementSyntax>().Select(globalStatement => globalStatement.Statement),
ExtractMethod\CSharpSelectionResult.StatementResult.cs (1)
100return container is GlobalStatementSyntax ? container.GetRequiredParent() : container;
ExtractMethod\CSharpSelectionValidator.cs (2)
152if (current is GlobalStatementSyntax) 232case GlobalStatementSyntax:
ExtractMethod\CSharpSelectionValidator.Validator.cs (1)
23GlobalStatementSyntax _ => CheckGlobalStatement(),
ExtractMethod\Extensions.cs (2)
39=> node is BlockSyntax or SwitchSectionSyntax or GlobalStatementSyntax; 70GlobalStatementSyntax or
IntroduceVariable\CSharpIntroduceVariableService_IntroduceLocal.cs (6)
37var globalStatement = expression.GetAncestor<GlobalStatementSyntax>(); 309? scope.ChildNodes().OfType<GlobalStatementSyntax>() 340var firstAffectedGlobalStatement = compilationUnit.Members.OfType<GlobalStatementSyntax>().Single(s => firstAffectedExpression.GetAncestorOrThis<GlobalStatementSyntax>()!.Contains(s));
src\roslyn\src\Analyzers\CSharp\Analyzers\ConvertProgram\ConvertProgramAnalysis_ProgramMain.cs (2)
62return root.Members.OfType<GlobalStatementSyntax>().First().GetFirstToken().GetLocation(); 71TextSpan.FromBounds(start, root.Members.OfType<GlobalStatementSyntax>().Last().FullSpan.End));
src\roslyn\src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryLambdaExpression\CSharpRemoveUnnecessaryLambdaExpressionDiagnosticAnalyzer.cs (2)
188n => n is BlockSyntax or ArrowExpressionClauseSyntax or AnonymousFunctionExpressionSyntax or GlobalStatementSyntax); 189if (outermostBody is null or GlobalStatementSyntax)
src\roslyn\src\Analyzers\CSharp\Analyzers\RemoveUnnecessarySuppressions\UnnecessaryNullableWarningSuppressionsUtilities.cs (4)
104if (nodeToCheck is GlobalStatementSyntax globalStatement) 138var globalStatements = compilationUnit.Members.OfType<GlobalStatementSyntax>(); 193var globalStatement = updatedNode.Ancestors().OfType<GlobalStatementSyntax>().FirstOrDefault();
src\roslyn\src\Analyzers\CSharp\Analyzers\RemoveUnreachableCode\RemoveUnreachableCodeHelpers.cs (2)
26case GlobalStatementSyntax globalStatement: 38if (member is not GlobalStatementSyntax currentGlobalStatement)
src\roslyn\src\Analyzers\CSharp\Analyzers\UseDeconstruction\CSharpUseDeconstructionDiagnosticAnalyzer.cs (1)
110var searchScope = localDeclaration.Parent is GlobalStatementSyntax globalStatement
src\roslyn\src\Analyzers\CSharp\Analyzers\UseLocalFunction\CSharpUseLocalFunctionDiagnosticAnalyzer.cs (3)
96else if (localDeclaration.Parent is GlobalStatementSyntax { Parent: CompilationUnitSyntax compilationUnit }) 369else if (expressionStatement.Parent is GlobalStatementSyntax { Parent: CompilationUnitSyntax compilationUnit } globalStatement) 373&& compilationUnit.Members[globalStatementIndex - 1] is GlobalStatementSyntax previousGlobalStatement)
src\roslyn\src\Analyzers\CSharp\CodeFixes\InlineDeclaration\CSharpInlineDeclarationCodeFixProvider.cs (1)
175editor.RemoveNode(localDeclarationStatement.Parent is GlobalStatementSyntax globalStatement
src\roslyn\src\Analyzers\CSharp\CodeFixes\RemoveUnusedLocalFunction\CSharpRemoveUnusedLocalFunctionCodeFixProvider.cs (1)
51editor.RemoveNode(localFunction.Parent is GlobalStatementSyntax globalStatement ? globalStatement : localFunction);
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseLocalFunction\CSharpUseLocalFunctionCodeFixProvider.cs (1)
171editor.RemoveNode(anonymousFunctionStatement.Parent is GlobalStatementSyntax globalStatement
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseSimpleUsingStatement\UseSimpleUsingStatementCodeFixProvider.cs (2)
48var blockLikes = topmostUsingStatements.Select(u => u.Parent is GlobalStatementSyntax ? u.Parent.GetRequiredParent() : u.GetRequiredParent()).ToSet(); 107compilationUnit.Members.ReplaceRange((GlobalStatementSyntax)usingStatement.GetRequiredParent(), expandedUsingStatements.Select(GlobalStatement))),
Microsoft.CodeAnalysis.CSharp.NetAnalyzers (1)
Microsoft.NetCore.Analyzers\Performance\CSharpPreferHashDataOverComputeHash.Fixer.cs (1)
178if (parent is GlobalStatementSyntax target)
Microsoft.CodeAnalysis.CSharp.Workspaces (16)
ReassignedVariable\CSharpReassignedVariableService.cs (1)
85return current is GlobalStatementSyntax
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\CompilationUnitSyntaxExtensions.cs (1)
13=> compilationUnit.Members is [GlobalStatementSyntax, ..];
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.cs (1)
362case GlobalStatementSyntax:
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\NewLineUserSettingFormattingRule.cs (2)
171currentTokenParentParent is MemberDeclarationSyntax and not GlobalStatementSyntax) 375currentTokenParentParent is MemberDeclarationSyntax and not GlobalStatementSyntax)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpBlockFacts.cs (2)
32GlobalStatementSyntax globalStatement => globalStatement.Parent, 42CompilationUnitSyntax compilationUnit => compilationUnit.Members.OfType<GlobalStatementSyntax>().SelectAsArray(globalStatement => globalStatement.Statement),
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (2)
244=> node is GlobalStatementSyntax; 247=> ((GlobalStatementSyntax)node).Statement;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeFixesAndRefactorings\CSharpFixAllSpanMappingService.cs (2)
29if (node.GetAncestorOrThis<GlobalStatementSyntax>() is null) 41var globalStatements = root.ChildNodes().OfType<GlobalStatementSyntax>();
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationService.cs (1)
118if (destination is GlobalStatementSyntax)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\NamedTypeGenerator.cs (2)
65after: static members => members.LastOrDefault(m => m is GlobalStatementSyntax), 66canPlaceAtIndex: static (members, index) => index >= members.Count || members[index] is not GlobalStatementSyntax);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTokenExtensions.cs (2)
219var globalStatement = token.GetAncestor<GlobalStatementSyntax>();
Roslyn.Diagnostics.CSharp.Analyzers (15)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\CompilationUnitSyntaxExtensions.cs (1)
13=> compilationUnit.Members is [GlobalStatementSyntax, ..];
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxNodeExtensions.cs (1)
362case GlobalStatementSyntax:
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\NewLineUserSettingFormattingRule.cs (2)
171currentTokenParentParent is MemberDeclarationSyntax and not GlobalStatementSyntax) 375currentTokenParentParent is MemberDeclarationSyntax and not GlobalStatementSyntax)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpBlockFacts.cs (2)
32GlobalStatementSyntax globalStatement => globalStatement.Parent, 42CompilationUnitSyntax compilationUnit => compilationUnit.Members.OfType<GlobalStatementSyntax>().SelectAsArray(globalStatement => globalStatement.Statement),
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (2)
244=> node is GlobalStatementSyntax; 247=> ((GlobalStatementSyntax)node).Statement;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeFixesAndRefactorings\CSharpFixAllSpanMappingService.cs (2)
29if (node.GetAncestorOrThis<GlobalStatementSyntax>() is null) 41var globalStatements = root.ChildNodes().OfType<GlobalStatementSyntax>();
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\CSharpCodeGenerationService.cs (1)
118if (destination is GlobalStatementSyntax)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\NamedTypeGenerator.cs (2)
65after: static members => members.LastOrDefault(m => m is GlobalStatementSyntax), 66canPlaceAtIndex: static (members, index) => index >= members.Count || members[index] is not GlobalStatementSyntax);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTokenExtensions.cs (2)
219var globalStatement = token.GetAncestor<GlobalStatementSyntax>();