Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Add XML documentation for GlobalStatementSyntax - #80697

#80697
Merged
CyrusNajmabadi merged 5 commits into
maindotnet/roslyn:mainfrom
copilot/add-globalstatementsyntax-docsdotnet/roslyn:copilot/add-globalstatementsyntax-docsCopy head branch name to clipboard
Oct 22, 2025
Merged

Add XML documentation for GlobalStatementSyntax#80697
CyrusNajmabadi merged 5 commits into
maindotnet/roslyn:mainfrom
copilot/add-globalstatementsyntax-docsdotnet/roslyn:copilot/add-globalstatementsyntax-docsCopy head branch name to clipboard

Conversation

Copilot AI commented Oct 14, 2025

Copy link
Copy Markdown
Contributor
  • Understand the issue: GlobalStatementSyntax lacks XML documentation comments
  • Identify the solution: Add TypeComment to Syntax.xml for GlobalStatementSyntax
  • Add XML documentation to GlobalStatementSyntax in Syntax.xml
  • Regenerate compiler code from Syntax.xml
  • Build and verify the changes
  • Review generated files to ensure documentation is present
  • Address code review feedback: Consolidate into summary to avoid duplicate remarks sections
  • Address review comment: Clarify that each top-level statement is wrapped in GlobalStatementSyntax
  • Remove broken link to top-level statements proposal
Original prompt

This section details on the original issue you should resolve

<issue_title>Need docs about GlobalStatementSyntax</issue_title>
<issue_description>As a user, how do I find out about the purpose of GlobalStatementSyntax? Is it documented anywhere?</issue_description>

<agent_instructions>Copilot. Please add a

section for GlobalStatementSyntax in Syntax.xml.</agent_instructions>

Comments on the Issue (you are @copilot in this section)

@tmat We also need a scripting specification.

Fixes #17118


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits October 14, 2025 11:48
Co-authored-by: CyrusNajmabadi <4564579+CyrusNajmabadi@users.noreply.github.com>
Co-authored-by: CyrusNajmabadi <4564579+CyrusNajmabadi@users.noreply.github.com>
Copilot AI changed the title [WIP] Add documentation for GlobalStatementSyntax Add XML documentation for GlobalStatementSyntax Oct 14, 2025
Copilot AI requested a review from CyrusNajmabadi October 14, 2025 11:58
<Node Name="GlobalStatementSyntax" Base="MemberDeclarationSyntax">
<Kind Name="GlobalStatement"/>
<TypeComment>
<summary>Represents a global statement in a compilation unit. Global statements are top-level statements that can appear in a C# program or script. In regular C# programs (C# 9.0+), they are synthesized into a Main method. In C# scripts, they are executed as top-level code. See https://github.com/dotnet/csharplang/blob/main/proposals/top-level-statements.md for more information.</summary>

@CyrusNajmabadi CyrusNajmabadi Oct 14, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot consider mentioning that each statement will be wrapped in a GlobalStatementSyntax at the top level. #Closed

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in commit e0a8c9a. Added clarification that each statement at the top level of a compilation unit is wrapped in a GlobalStatementSyntax node.

Co-authored-by: CyrusNajmabadi <4564579+CyrusNajmabadi@users.noreply.github.com>
@CyrusNajmabadi
CyrusNajmabadi marked this pull request as ready for review October 14, 2025 12:47
@CyrusNajmabadi
CyrusNajmabadi requested a review from a team as a code owner October 14, 2025 12:47
@CyrusNajmabadi

Copy link
Copy Markdown
Contributor

@dotnet/roslyn-compiler ptal.

@jcouv jcouv self-assigned this Oct 15, 2025

@jcouv jcouv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM Thanks (commit 4)

<Node Name="GlobalStatementSyntax" Base="MemberDeclarationSyntax">
<Kind Name="GlobalStatement"/>
<TypeComment>
<summary>Represents a global statement in a compilation unit. Each statement at the top level of a compilation unit is wrapped in a GlobalStatementSyntax node. Global statements are top-level statements that can appear in a C# program or script. In regular C# programs (C# 9.0+), they are synthesized into a Main method. In C# scripts, they are executed as top-level code. See https://github.com/dotnet/csharplang/blob/main/proposals/top-level-statements.md for more information.</summary>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This link 404s. Does it really need to be here in the first place?

public InterpolationFormatClauseSyntax WithFormatStringToken(SyntaxToken formatStringToken) => Update(this.ColonToken, formatStringToken);
}

/// <summary>Represents a global statement in a compilation unit. Each statement at the top level of a compilation unit is wrapped in a GlobalStatementSyntax node. Global statements are top-level statements that can appear in a C# program or script. In regular C# programs (C# 9.0+), they are synthesized into a Main method. In C# scripts, they are executed as top-level code. See https://github.com/dotnet/csharplang/blob/main/proposals/top-level-statements.md for more information.</summary>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot remove the final 'see' statement.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in commit 8f3e5d2. Removed the final 'see' statement with the link.

Co-authored-by: CyrusNajmabadi <4564579+CyrusNajmabadi@users.noreply.github.com>
@CyrusNajmabadi

Copy link
Copy Markdown
Contributor

@dotnet/roslyn-compiler ptal.

@jcouv jcouv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM Thanks (commit 5)

@CyrusNajmabadi

Copy link
Copy Markdown
Contributor

@dotnet/roslyn-compiler for another pair of eyes.

@jcouv

jcouv commented Oct 22, 2025

Copy link
Copy Markdown
Contributor

@CyrusNajmabadi This looks ready to merg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Need docs about GlobalStatementSyntax

5 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.