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

Documentation extension links can't use link resolution features #561

Closed
2 tasks done
d-ronnqvist opened this issue Apr 22, 2023 · 0 comments · Fixed by #565
Closed
2 tasks done

Documentation extension links can't use link resolution features #561

d-ronnqvist opened this issue Apr 22, 2023 · 0 comments · Fixed by #565
Assignees
Labels
bug Something isn't working link resolution About DocC's link resolution system

Comments

@d-ronnqvist
Copy link
Contributor

Description

When associating documentation extension files with symbols, DocC relies on exact resolved reference matches instead of using the link resolver infrastructure to find the symbol.

This means that a link that would be unambiguous in content may not be an accepted documentation extension heading link.

Together with #560 there's a risk that a developer would copy a link that works in the content into a documentation extension file and not notice that the link doesn't work there.

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

Symbol links in documentation extension headers should have the same capabilities as symbol link in content.

Actual behavior

Symbol links in documentation extension headers need to exactly match the resolved reference and its added disambiguation.

Steps To Reproduce

In a Swift package with a documentation catalog;

  • Add code where two symbols have the same case insensitive name:
public struct Outer {
    public enum Inner {}
    public var inner: Inner
}
  • Add a documentation extension file and link to one of the symbols without disambiguation:
# ``MyModule/Outer/Inner``

The content of this file is ignored because the heading link doesn't resolve without disambiguation.
  • The documentation extension file doesn't get associated with the symbol.

Swift-DocC Version Information

e135c5b

Swift Compiler Version Information

swift-driver version: 1.80.1 Apple Swift version 5.9 (swiftlang-5.9.0.108.11 clang-1500.0.19.2)
Target: arm64-apple-macosx14.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working link resolution About DocC's link resolution system
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant