Open stephencelis opened 2 years ago
Thanks for filing @stephencelis. There was some discussion about this in forums and we can continue the conversation there.
Hello, I meet the same problem, which is that when module A exports module B, DocC includes all symbols of module B in the documentation for module A.
I find this really annoying, given:
In the context of a private local package developed for an application that exports a public library package, this merging has even less meaning. The local package is obviously not the home for the library symbols! In the end, efforts of documenting the local package are hindered by the impossibility to get a focused doc :-/ This is really contrarian to the goals of DocC.
Looking at the Composable Architecture mentioned in the OP, I can see that:
I could not spot the cause of this difference. No special @
directive in the DocC files. No specific configuration in .spi.yml
.
But my main concern in the Xcode documentation window. Has anyone a clue for hiding exported symbols in the Xcode documentation window?
Description
Sometimes, a library will re-export the interface of an external dependency, especially if it relies on a hyper-modularized toolchain of dependencies.
While not quite "hyper," the Composable Architecture has 4 external dependencies that it re-exports:
https://github.com/pointfreeco/swift-composable-architecture/blob/main/Sources/ComposableArchitecture/Internal/Exports.swift#L1-L4
These dependencies are useful on their own, and they are documented on their own, but they also are required by the core library often enough that we feel it is unfair to push this burden of imports onto library users.
Duplicating their interfaces and documentation across multiple modules is confusing and wasteful in this instance, and creates a lot of work for us to hide all these symbols somehow.
I can see an argument for aggregating the documentation of internal modules that are re-exported (e.g., in Vapor), but external modules should probably be on the chopping block.
Checklist
main
branch of this package.Expected Behavior
I expect symbols from external dependencies that are
@_exported import
s to be omitted from my package's documentation.Actual behavior
All symbols are present.
Steps To Reproduce
d98e555d0e6559f1a0dc7d70603800cd33af7a03
)Swift-DocC Version Information
Xcode 14 beta 3
Swift Compiler Version Information