Skip to content

[5.7] [SymbolGraphGen] Add filename and module name to symbols' doc comments #58964

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

Merged
merged 4 commits into from
May 24, 2022

Conversation

QuietMisdreavus
Copy link
Contributor

Cherry-pick of #58857

Explanation: This PR adds new fields to the docComment structure in symbol graphs: uri and module, to indicate where given documentation came from. When documentation is inherited, the comment could from a different file or even a different module, creating confusing situations if a tool needs to parse these comments, like Swift-DocC does for symbol links. Adding this information allows Swift-DocC to emit the right source location for warnings it might emit based on doc comment information.

Scope: Restricted to SymbolGraphGen - the new fields are not emitted if the information is not available.

Bug: rdar://81190369

Risk: Low. This should not affect normal compilation.

Testing: A new lit test, SymbolGraph/Symbols/Mixins/DocComment/SourceModule.swift, has been added to verify that the source module correctly indicates where a doc comment came from. Existing lit tests which verified docComment information have also been updated to reflect the new data.

@QuietMisdreavus QuietMisdreavus requested a review from a team as a code owner May 18, 2022 16:04
@QuietMisdreavus
Copy link
Contributor Author

@swift-ci Please test

@QuietMisdreavus
Copy link
Contributor Author

@swift-ci Please test Windows

@QuietMisdreavus QuietMisdreavus merged commit 338374a into release/5.7 May 24, 2022
@QuietMisdreavus QuietMisdreavus deleted the QuietMisdreavus/5.7/comment-loc branch May 24, 2022 17:36
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

Successfully merging this pull request may close these issues.

2 participants