Skip to content
This repository was archived by the owner on Jun 1, 2023. It is now read-only.
This repository was archived by the owner on Jun 1, 2023. It is now read-only.

Internal variables from namespace extensions are exposed in the generated documentation #194

Closed
@sitomani

Description

@sitomani

When running swift-doc on code block displayed below, the internal variables from namespace extensions get exposed in the generated documentation. There will not be documentation generated for the internal extensions though.

Reproducable with 1.0.0.beta.5

public class RootController {
    internal init() {}

    public static func build() -> RootController {
        return RootController()
    }
}


public extension RootController {
    class ControllerExtension {
        public init() {}
        
        public var public_properties: ExtendedProperties = ExtendedProperties()

        internal var internal_properties: InternalProperties = InternalProperties()
    }
}


public extension RootController.ControllerExtension {
    struct ExtendedProperties {
        public init() {}
        public var public_prop: Int = 1
    }
}


internal extension RootController.ControllerExtension {
    struct InternalProperties {
        internal init() {}
        internal var internal_prop: String = "FOO"
    }
}

If you run swift-doc on this code, it will result in RootController_ControllerExtension.md exposing the variable internal_properties, but there will not be a documentation file RootController_ControllerExtension_InternalProperties.md. There will be one for RootController_ControllerExtension_ExtendedProperties which is public.

I can see that there are some PRs / Issues raised around more granular control over the documentation based on given access level or options to exclude certain symbols from the documentation. However, in my view this is related but different; if the generation is supposed to only process open/public interfaces by default, this behaviour is not met with the included example.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions