Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect error reporting on older topic-style symbol reference that isn't used in code or documentation markdown #640

Closed
2 tasks done
heckj opened this issue Jun 23, 2023 · 1 comment · Fixed by #642
Closed
2 tasks done
Assignees
Labels
bug Something isn't working

Comments

@heckj
Copy link
Member

heckj commented Jun 23, 2023

Description

WIth the Swift 5.9 updates to DocC that change the symbols to allow full unicode character support, I've updated my documentation - but am continuing to get warnings about incorrect symbols. I'm opening this issue per a discussion on the swift forums.

The example that shows this is MeshGenerator, and a perfect example is the symbol TextureCoordinates/_=(_:_:)-38jci.

The kind of warning that is displayed (in both Xcode and from DocC on the command line) is:

/Users/heckj/src/MeshGenerator/Sources/MeshGenerator/MeshGenerator.docc/Extensions/TextureCoordinates.md: warning: '_=(_:_:)-38jci' doesn't exist at '/MeshGenerator/TextureCoordinates'

This package exhibits several of these warnings, all apparently related to synthesized methods from default protocol conformance.

I've also verified this behavior exists on the current main branch of DocC (commit 2131c4358d9345cb72007dd53cca33ef410cf6b6).

Checklist

  • If possible, I've reproduced the issue using the main branch of this package.
  • This issue hasn't been addressed in an existing GitHub issue.

Expected Behavior

No warnings displayed

Actual behavior

Warnings displayed, such as:

/Users/heckj/src/MeshGenerator/Sources/MeshGenerator/MeshGenerator.docc/Extensions/TextureCoordinates.md: warning: '_=(_:_:)-38jci' doesn't exist at '/MeshGenerator/TextureCoordinates'

When I've not added the symbol to any markdown (or more explicitly, I've replaced it)

Steps To Reproduce

Project: MeshGenerator

  • git clone https://github.com/heckj/MeshGenerator
  • cd MeshGenerator
  • git checkout 9912f61d3222a76364b156c6055be35fd48c348c

verify that the symbol isn't in use in code or markdown files:

  • grep -R "\_=(_:_:)-38jci" .

exhibit the errors

  • ./docbuild.bash

or the more explicit version:

  • $(xcrun --find swift) package generate-documentation --target MeshGenerator

Swift-DocC Version Information

5.9.0

Swift Compiler Version Information

swift-driver version: 1.82.2 Apple Swift version 5.9 (swiftlang-5.9.0.114.10 clang-1500.0.29.1)
Target: arm64-apple-macosx13.0
@heckj heckj added the bug Something isn't working label Jun 23, 2023
@d-ronnqvist
Copy link
Contributor

Oh. this stumped me for a bit but now I see what's happening here. [overly specific implementation details to follow]

While crawling the curation to build up the documentation hierarchy, resolved links are updated to their absolute resolved topic reference versions. Before visiting the content of these pages these updated resolved topic reference strings are added to a lookup. I didn't think these links would be visited again before that but if the there's a second crawling pass there's a code path that visits them again before they're added to the lookup. That explains why these warnings don't have a source location. These links don't exist in the actual content, so there can't be a source range for them.

Thanks for reporting this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants