-
Notifications
You must be signed in to change notification settings - Fork 413
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
Display doc comments for all swift extensions #819
Conversation
Swift extensions of Foundation classes like `NSString` are given their doc comments rather than 'Undocumented'.
What happens when no documentation is provided? Will this introduce new entries in It seems odd to me to require documentation when the symbol is already documented at its declaration (even if in another module), and the extension documentation is inaccessible to Quick Help and friends. On the other hand, thumbs up if this stops Jazzy from publishing the nonsense text “Undocumented” under each extended type. That has been annoying me for a while. I don’t mind if I will have to add |
If no doc were provided then you would get the 'nonsense' text 😄 as today, no change. The only thing this change does is display the doc comment -- if you wrote one -- instead of 'Undocumented'. I think it is often natural + useful to write doc comments on extensions of existing types to explain their purpose in the context of a module's complete documentation; several user issues along this line. So, you would be able to get rid of 'undocumented' with an empty doc comment '///'. Extensions of types from other modules never contribute to ...so it is a bit unhelpful to stick 'undocumented' on them without warning. OK, I'm convinced: we should never see this particular 'Undocumented'. New proposal for undocumented symbols:
Thanks a lot for the comments. |
Sounds perfect, @johnfairh. Thanks for listening. |
Awesome, thanks @johnfairh 👏 |
cheers! |
See #454, #620.
Now sourcekitten is passing on doc comments of extensions, this PR displays them. The corner case where this wasn't working is Swift extensions of Objective C classes like
Foundation.NSDate
: in this case sourcekit does not provide the full_as_xml field.Specs changes show one fix in Siesta demonstrating exactly this, and another 'fix' in realm-swift where a previously missed doc comment is now displayed --- the declaration shouldn't be present at all, I think, but that's another story + not a regression here...
edit with latest push: also propose dropping the 'undocumented' label on swift extensions of objc classes without doc comments, for consistency with other extensions + because they do not contribute to undocumented%. Spec changes reflect that.