Clarify SymbolDisplayDelegateStyle documentation to mention SymbolDisplayParameterOptions #80885
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #64632
Summary
The documentation for
SymbolDisplayDelegateStyle.NameAndSignatureandSymbolDisplayDelegateStyle.NameAndParameterswas unclear about what controls the content shown in delegate parameter lists. Users expected that usingNameAndSignaturewould automatically include parameter names and types based on the example in the documentation ("void SomeDelegate(int x)"), but were getting empty parameter lists instead.The Issue
Given this code:
Users expected:
bool SyntaxReceiverCreator(int a, bool b)But got:
bool A.SyntaxReceiverCreator()(empty parameter list)Root Cause
The
NameAndSignatureoption only controls whether the signature (return type + parameter list) is shown, not what is shown inside the parameter list. The actual content of the parameter list is controlled by theSymbolDisplayParameterOptionsflags.Changes Made
Updated the XML documentation for both enum values to explicitly clarify:
NameAndParameters: Added documentation stating that this option determines whether the parameter list (the(...)part) is shown, and that the content is controlled bySymbolDisplayParameterOptions.NameAndSignature: Added documentation stating that this option determines whether the full signature (return type and parameter list) is shown, and that the content is controlled bySymbolDisplayParameterOptions.Both now include explicit
<see cref="SymbolDisplayParameterOptions"/>references to guide users to the correct API for controlling parameter display content.Example
To get the expected output with parameter details, users need to combine both options:
This will produce:
bool SyntaxReceiverCreator(int a, bool b)✓Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.