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

Wrong doc.comment on undocumented overridden declarations #368

Closed
johnfairh opened this issue May 1, 2017 · 2 comments
Closed

Wrong doc.comment on undocumented overridden declarations #368

johnfairh opened this issue May 1, 2017 · 2 comments

Comments

@johnfairh
Copy link
Collaborator

Latest code; Xcode 832. This goes wrong:

protocol P {
    /// docs for P.m
    func m()
}

/// docs for S
struct S: P {
    func m() {}
}

SourceKitten reports doc.comment for S.m as "docs for S".

This happens because SourceKit produces full_as_xml for S.m from inherited P.m. So SyntaxMap.commentRange(beforeOffset:) scans back and finds the "docs for S" comment.

Would you consider accepting a PR to add some code along the lines of that removed by 114abc1 to detect this scenario?

(I do not think this is related to #269: the full_as_xml being present is enough to trigger.)

@jpsim
Copy link
Owner

jpsim commented May 1, 2017

As long as we don't regress in our docs detection in other scenarios, yes I'd gladly consider any PR 😄

@jpsim
Copy link
Owner

jpsim commented May 12, 2017

Fixed in #375.

@jpsim jpsim closed this as completed May 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants