Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation comments on partial methods #5193

Closed
RikkiGibson opened this issue Sep 15, 2021 · 0 comments
Closed

Documentation comments on partial methods #5193

RikkiGibson opened this issue Sep 15, 2021 · 0 comments
Labels
Proposal Question Question to be discussed in LDM related to a proposal

Comments

@RikkiGibson
Copy link
Contributor

RikkiGibson commented Sep 15, 2021

To date, it appears that doc comments on partial method definitions are ignored. The compiler will give diagnostics when the doc comment is invalid, but it won't include the comments in the documentation file, and the doc comments also appear to be absent from Quick Info. This introduces some painful scenarios where the user declares a partial definition, includes doc comments, and the partial implementation is provided by a source generator. See dotnet/roslyn#54103.

We intend to address the situation by making it so it's only necessary to provide doc comments on either the partial definition or implementation, not both. If doc comments are present on only one of the two, we use those doc comments on the symbol. If doc comments are present on both definition and implementation, we preserve existing behavior by using the implementation comments and dropping the definition comments.

Also, we add a rule which ensures that a partial method with doc comments and with no implementation is not included in the documentation file. In this scenario, we do still return any documentation on the symbol from public API such as ISymbol.GetDocumentationCommentXml.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Proposal Question Question to be discussed in LDM related to a proposal
Projects
None yet
Development

No branches or pull requests

1 participant