Skip to content

Support passing experimental flags for @_exported import symbol inclusion #113

Description

@Kyle-Ye

Description

swift-docc-plugin currently cannot include symbols from @_exported import declarations in generated documentation, even though the underlying symbolgraph-extract tool supports this via the --experimental-allowed-reexported-modules flag (implemented in swiftlang/swift#73080).

This creates an inconsistency with Xcode's documentation building, which does include @_exported symbols.

Current Limitation

The swift-docc-plugin uses symbolgraph-extract but has no mechanism to pass the --experimental-allowed-reexported-modules flag that would enable inclusion of @_exported symbols. This means packages that use @_exported imports to provide a unified API surface cannot generate complete documentation using swift-docc-plugin.

Example Impact

For a package that uses @_exported imports:

// DemoKit target
@_exported import _DemoKit  // C module
@_exported import DemoKitCore  // Swift module
  • Current behavior: Documentation only includes symbols directly defined in DemoKit
  • Expected behavior: Documentation includes symbols from DemoKit, _DemoKit, and DemoKitCore

Related Work

Next Steps

This issue depends on SwiftPM providing the necessary PackagePlugin API to pass experimental flags. Once that API is available, swift-docc-plugin can be updated to:

  1. Accept configuration for including @_exported symbols
  2. Pass the appropriate flags to symbolgraph-extract
  3. Generate documentation that matches the expected module interface

Workaround

Currently, there is no workaround available within swift-docc-plugin to include @_exported symbols in documentation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions