-
Notifications
You must be signed in to change notification settings - Fork 10.5k
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
[SymbolGraph] Add information about "inherited docs" for synthesized symbols #36863
Conversation
@swift-ci Please test |
@swift-ci Please build toolchain macOS platform |
macOS Toolchain Install command |
After some more discussion, it looks like we should handle docs inheritance for symbols that aren't synthesized. For example, in my test, the extension's default implementation appears as its own symbol, but inherits its documentation from the protocol. I've pushed a new commit that extends the "inherited docs" behavior to these non-synthesized symbols as well. @swift-ci Please test |
@swift-ci Please build toolchain macOS platform |
Build failed |
macOS Toolchain Install command |
While testing the toolchain, we ran into some issues where synthesized symbols were directly inheriting docs from the "base" symbol, and losing the @swift-ci Please test |
@swift-ci Please build toolchain macOS platform |
macOS Toolchain Install command |
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
Co-authored-by: Franklin Schrans <7278429+franklinsch@users.noreply.github.com>
@swift-ci Please smoke test |
Resolves rdar://75741632
This PR adds handling to symbol-graph related code about the concept of "inherited docs", on synthesized symbols inherited from default implementations and classes. There are two primary updates as part of this PR:
"sourceOrigin"
. This contains the USR and the display path of the parent symbol.-skip-inherited-docs
. This changes the symbol-graph code to skip emitting the"docComment"
field on synthesized symbols. Since the doc comment is going to be the same as the parent symbol's, this allows a user or tool to skip emitting duplicate information, optimizing the size of the output symbol graph.