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

Fix toplevel symbols #260

Merged
merged 4 commits into from
Apr 26, 2021
Merged

Conversation

Lukas-Stuehrk
Copy link
Member

Looks like my assessment was wrong and we introduced a regression in #230.

There's a logic error when checking which symbols are considered top-level symbols. The path of a symbol's identifier always contains the symbol's own name. Because of this, swift-doc version 1.0.0-beta.6 is not including all top level symbols which are not structs or classes.

This change fixes that regression and adds some tests.

I think we should add some regression tests at some point to check which symbols are included in a generated documentation.

@mattt
Copy link
Contributor

mattt commented Apr 26, 2021

That's totally on me. I introduced this regression by making an unrelated change to Identifier path components in 0df8f0a, and failed to account for current usage.

Thank you for identifying this and adding test coverage. I think better and more extensive testability — especially around what gets built would be valuable. That was one of my goals for #67, but that got away from me in my first few attempts. I'd like to try again after 1.0.0.

As for this, I'm going to apply a hot fix and retag the existing release.

@mattt mattt merged commit 18b4d97 into SwiftDocOrg:master Apr 26, 2021
mattt added a commit that referenced this pull request Apr 26, 2021
* Add failing tests for top level symbols.

* Fix top level symbols.

* Update Sources/SwiftDoc/Interface.swift

* Remove print statement

Co-authored-by: Mattt <mattt@me.com>
@Lukas-Stuehrk Lukas-Stuehrk deleted the fix-toplevel-symbols branch April 26, 2021 16:08
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants