You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(#1257) Combined module link issue - public extension of dependent module causes resolution failure
The basic setup is this:
```swift
// ImportedModule
struct ExtendedType {}
struct BaseType {}
```
```swift
// MainModule
import ImportedModule
extension ExtendedType {
func extensionMethod()
}
```
With the above we have the following issues:
- `/ImportedModule/ExtendedType` **always** resolves to the type extension link
- `/ImportModule/BaseType` links are broken
Prioritize absolute links resolution to point to the module referenced in the link, so that `/ImportedModule/BaseType` finds the base type because the path starts with `/`.
To refer to the extended type or method, the non-absolute paths work in Xcode and with docc: `ImportedModule/ExtendedType` resolves to the type extension page, `ImportedModule/ExtendedType/extensionMethod()` resolves to the extension method page.
> ‼️🤖 Disclaimer: this is an AI-assisted change.
While AI was utilized to identify and apply the initial fix and create initial version of the tests, the code has been reviewed and modified where needed.
More importantly, I have tested the changes both with the sample project attached to the original issue and with a real work project where I'm using `xcodebuild docbuild`.
In the real world project I'm dealing with similar setup.
`ParentFramework` imports `ChildFramework` and extends `ChildType` and then uses paths like `/ChildFramework/ChildType` in the documentation.
By passing `DOCC_EXEC` build setting to `xcodebuild docbuild` invocation along with `--enable-experimental-combined-documentation` and other required flags I was able to produce doc archives for the 2 modules, then `docc merge` them into one and in the resulting doc archive all cross-linking works as expected.
I can also ue `ChildFramework/ChildType/extensionMethod()` links to create reference to the extension method doc page.
0 commit comments