Skip to content

Check the module name to know when to skip inherited doc comments. #314

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 5 commits into from
Jun 21, 2022

Conversation

d-ronnqvist
Copy link
Contributor

Bug/issue #, if applicable: rdar://92185538

Summary

This updates Swift-DocC to use the new doc comment module information added in swiftlang/swift#58857 and swiftlang/swift-docc-symbolkit#42 to know when

Dependencies

This directly depend on swiftlang/swift-docc-symbolkit#42
The new doc comment module information is only available with swiftlang/swift#58857

Testing

With a recent trunk toolchain that include swiftlang/swift#58857

Create a project with two targets.

In the first target, define some public type and define a public protocol with links to the public type in its documentation. For example:

public protocol FirstProtocol {
   /// Documentation from the `First` target.
   ///
   /// Links to another type in the `First` target: ``FirstStruct``.
   func something()
}

public struct FirstStruct {}

In the second target, define a type that conform to the first target's protocol without overriding its documentation.

import First

public struct SecondStruct: FirstProtocol {
    public func something() {}
}

When building documentation for the second target, there shouldn't be warnings that the "Topic reference 'FirstStruct' couldn't be resolved."

Checklist

Make sure you check off the following items. If they cannot be completed, provide a reason.

  • Added Updated tests
  • Ran the ./bin/test script and it succeeded
  • Updated documentation if necessary

@d-ronnqvist
Copy link
Contributor Author

@swift-ci please test

@d-ronnqvist
Copy link
Contributor Author

@swift-ci please test

# Conflicts:
#	Package.resolved
#	Sources/SwiftDocC/Infrastructure/DocumentationContext.swift
#	Sources/SwiftDocC/Infrastructure/Symbol Graph/SymbolGraphRelationshipsBuilder.swift
@d-ronnqvist
Copy link
Contributor Author

@swift-ci please test

Copy link
Contributor

@QuietMisdreavus QuietMisdreavus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@d-ronnqvist
Copy link
Contributor Author

@swift-ci please test

@d-ronnqvist
Copy link
Contributor Author

@swift-ci please test

@d-ronnqvist d-ronnqvist merged commit 42c7ba9 into swiftlang:main Jun 21, 2022
d-ronnqvist added a commit to d-ronnqvist/swift-docc that referenced this pull request Jun 21, 2022
…wiftlang#314)

* Check the module name to know when to skip inherited doc comments.

* Fallback to the previous logic when the new doc comment info is missing

* Use new function in SymbolKit that handles older symbol graph versions

* Use merged version of SymbolKit changes
d-ronnqvist added a commit that referenced this pull request Jun 23, 2022
…ts. (#316)

* Check the module name to know when to skip inherited doc comments. (#314)

* Check the module name to know when to skip inherited doc comments.

* Fallback to the previous logic when the new doc comment info is missing

* Use new function in SymbolKit that handles older symbol graph versions

* Use merged version of SymbolKit changes

* Depend on cherry-picked SymbolKit changes

* Update to depend on additional cherry-picked SymbolKit changes

* Use merged version of SymbolKit changes
@d-ronnqvist d-ronnqvist deleted the check-doc-comment-module-info branch October 25, 2024 09:00
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