-
Notifications
You must be signed in to change notification settings - Fork 226
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
doc.comment blank for many declarations, causing missing Jazzy docs #142
Comments
OK, I’ve narrowed it down to a pretty small case, and it’s formatting-dependent. Sourcekitten fails to generate
…but this works:
…and so does this:
|
Yeah, this is definitely a bug, it's due to the logic used to detect which declarations are documented, it only checks the line directly above (and the logic for I wish there was a more straightforward/correct way to get a documentation comment for a declaration using SourceKit. 😞 |
FWIW, whatever broke it is a recent addition (0.7.3-ish). |
It's not quite as simple as reverting the change... I know what broke this and I added it because it also fixes other things. We need an approach that fixes all of these 😄 |
It seems we need to fix here. |
No, the approach I'm taking there is entirely wrong. I'd rather use the actual Swift parser to detect the doc comment, because it may be many lines above. |
I understand. |
The “full xml” property in Sourcekitten’s output does work in all cases. (In some mythical future day when I have more than an hour of free time, I still mean to do a massive, terrifying PR which switches jazzy to using that and rips out its markdown parsing entirely. I say this now just to alarm JP.) |
Consider JP alarmed 😉 |
It seems the document in |
The idea is that |
Using existence of document in guard commentEndLine == tokenStartLine || commentEndLine == tokenStartLine?.predecessor() else { in |
Updating the Siesta docs, I noticed that a bunch of documentation had disappeared. I traced this to Sourcekitten omitting
doc.comment
from many of the declarations. I haven’t verified this, but at a glance, it seems like this might be happening on Swift classes that extendNSObject
.You can see the problem in the
Service
andResource
classes in Siesta. It shows in the integration specs as they’re currently checked in.This bug was introduced in jazzy when Sourcekitten was updated to 0.7.3. I didn’t chase it down the rabbit hole any further than that.
The text was updated successfully, but these errors were encountered: