Replies: 2 comments 1 reply
-
I agree that only the constructor should have these, as the primary constructor has these parameters, not the type. I would assume records should behave the same way. However, I'm curious to know what others think. @dotnet/roslyn-compiler. |
Beta Was this translation helpful? Give feedback.
-
For simplicity, we don't try to split content of the doc comment on parts that belong exclusively to the type and exclusively to the constructor. I am not even sure if it is possible to do so for every possible situation. For example, a parameter reference tag can probably appear anywhere. The summary can talk about type and the constructor, but perhaps in different paragraphs. We have chosen, perhaps, not the perfect world solution, but the simple and sufficiently good one. It is probably not ideal for generation of a stand-alone documentation, but sufficiently good for a dev to document the code itself. If the behavior is causing a problem for a user, there is a way out, to use a regular constructor instead. I am not sure whether it is worth to put any additional effort into trying to make the behavior perfect. |
Beta Was this translation helpful? Give feedback.
-
If you generate an XML documentation file for a class with a primary constructor, the parameter doc descriptions are duplicated on the type and on the constructor. Is that necessary? For maintenance and file size, it seems like it would be better to only have the descriptions on the constructor. Example XML doc file:
And the type itself:
Beta Was this translation helpful? Give feedback.
All reactions