-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Extensions: fix GetDocumentationCommentXml with netmodule #80297
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
Conversation
| ExtensionGroupingInfo extensionGroupingInfo = ((SourceMemberContainerTypeSymbol)containingType).GetExtensionGroupingInfo(); | ||
|
|
||
| foreach (ImmutableArray<SourceNamedTypeSymbol> extensions in extensionGroupingInfo.EnumerateMergedExtensionBlocks()) | ||
| if (containingType is SourceMemberContainerTypeSymbol sourceContainingType) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any benefit in visiting declarations from added modules? Does this have effect on xml doc comment file? For example, if we stop this component from visiting declarations form added modules (this is probably not the right place to do that though), will any tests fail?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My understanding is that added modules cannot contribute any doc comments. It was not my goal to address this bigger question in this PR, but adding if (symbol is not SourceNamedTypeSymbol) { return; } in VisitNamedType indeed didn't break any test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My understanding is that added modules cannot contribute any doc comments.
If that is what we think, then a proper fix, in my opinion, would be to stop visiting declarations from added modules in this component. Where exactly the change should be made can be discussed off-line. I do not think it should be the change that was tried. Quite possibly it belongs in the caller of this component.
However, if we think that added modules can contribute doc comments , then most likely extensions should contribute as well, and the change in commit 1 is not correct. More specifically, it does prevent the crash, but most likely doesn't result in correct behavior.
|
Done with review pass (commit 1) |
AlekseyTs
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM (commit 4)
| </doc> | ||
| """, GetDocumentationCommentText(comp)); | ||
| } | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
trailing whitespace
Fixes #80294