Skip to content

Improve XML documentation clarity for IMethodSymbol.Arity property#80693

Merged
CyrusNajmabadi merged 3 commits intomainfrom
copilot/improve-quick-info-arity
Oct 16, 2025
Merged

Improve XML documentation clarity for IMethodSymbol.Arity property#80693
CyrusNajmabadi merged 3 commits intomainfrom
copilot/improve-quick-info-arity

Conversation

Copy link
Contributor

Copilot AI commented Oct 14, 2025

Fixes #6596

This PR improves the XML documentation for the IMethodSymbol.Arity property to provide better clarity when viewing Quick Info tooltips in IDEs.

Changes

The documentation has been updated from:

Returns the arity of this method, or the number of type parameters it takes. A non-generic method has zero arity.

To:

Returns the arity of this method. Arity is the number of type parameters a method declares. A non-generic method has zero arity.

Rationale

The new documentation provides better clarity by:

  1. First stating what the property returns
  2. Then providing an explicit definition of "arity" as a concept
  3. Using more accurate terminology ("declares" instead of "takes") for type parameters
  4. Maintaining the clarification about non-generic methods

This restructuring makes the documentation more digestible and educational for developers who may not be familiar with the term "arity".

Scope

The documentation was updated consistently across all four locations where the Arity property is documented:

  • IMethodSymbol.cs (public API interface)
  • MethodSymbol.cs (C# compiler implementation)
  • MethodSymbol.vb (Visual Basic compiler implementation)
  • SynthesizedDelegateMethodSymbol.vb (Visual Basic synthesized symbols)

These changes are documentation-only and do not affect any functionality or behavior of the compiler.

<issue_title>Minor quick info improvement for "Arity"</issue_title>

<issue_description>

The quick info documentation for "Arity" (which is already great) can be improved slightly. My suggestion - Returns the arity of this method. Arity is the number of type parameters a method takes. A non-generic method has zero arity.
</issue_description>

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

Fixes #6959

Original prompt

This section details on the original issue you should resolve

<issue_title>Minor quick info improvement for "Arity"</issue_title>
<issue_description>image

The quick info documentation for "Arity" (which is already great) can be improved slightly. My suggestion - Returns the arity of this method. Arity is the number of type parameters a method takes. A non-generic method has zero arity.
</issue_description>

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

Fixes #6959


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Co-authored-by: CyrusNajmabadi <4564579+CyrusNajmabadi@users.noreply.github.com>
Copilot AI changed the title [WIP] Improve quick info documentation for Arity Improve XML documentation clarity for IMethodSymbol.Arity property Oct 14, 2025
Copilot AI requested a review from CyrusNajmabadi October 14, 2025 10:12
@CyrusNajmabadi CyrusNajmabadi marked this pull request as ready for review October 15, 2025 10:57
@CyrusNajmabadi CyrusNajmabadi requested a review from a team as a code owner October 15, 2025 10:57
@CyrusNajmabadi
Copy link
Contributor

@dotnet/roslyn-compiler ptal.


/// <summary>
/// Returns the arity of this method, or the number of type parameters it takes.
/// Returns the arity of this method. Arity is the number of type parameters a method takes.
Copy link
Member

Choose a reason for hiding this comment

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

Arity is the number of type parameters a method takes.

This phrasing is very odd/wrong. The method doesn't take type parameters. "... the number of type parameters a method declares" would make more sense

Copy link
Contributor

Choose a reason for hiding this comment

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

'Takes' sounds right to me. A method takes these parameters. It takes an int, and a string, and a bool. But i'm also fine with updating it to 'declares'. @copilot can you update this to ".. the number of type parameters a method declares"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated to use "declares" instead of "takes" in commit ae871df.

Copy link
Member

Choose a reason for hiding this comment

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

declares sounds correct to me. takes feels more informal, and we tend to try to be precise in these.

@jcouv jcouv self-assigned this Oct 15, 2025
Copy link
Member

@jcouv jcouv left a comment

Choose a reason for hiding this comment

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

Done with review pass (commit 2)

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

@jcouv jcouv left a comment

Choose a reason for hiding this comment

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

LGTM Thanks (commit 3)

@CyrusNajmabadi CyrusNajmabadi enabled auto-merge (squash) October 16, 2025 06:17
@CyrusNajmabadi CyrusNajmabadi merged commit f5dcba8 into main Oct 16, 2025
23 of 24 checks passed
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone Oct 16, 2025
@CyrusNajmabadi CyrusNajmabadi deleted the copilot/improve-quick-info-arity branch October 16, 2025 11:18
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.

Minor quick info improvement for "Arity"

5 participants