-
Notifications
You must be signed in to change notification settings - Fork 128
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
Fixits produce invalid references when used with the regular markdown link syntax #470
Open
1 of 2 tasks
Labels
bug
Something isn't working
Comments
3 tasks
theMomax
added a commit
to theMomax/swift-docc
that referenced
this issue
Jan 29, 2023
- add DescribedError conformance TopicReferenceResolutionError - improve Hashable implementation of TopicReferenceResolutionError by storing properties demanded by DescribedError instead of raw Error - conform Replacement and Solution to Hashable to aid Hashable implementation of TopicReferenceResolutionError - add fixme regarding support for regular markdown link-style references when creating solutions (swiftlang#470) - add basic semantic information about possible solutions back into PathHierarchyTests - remove debug print in SymbolTests
theMomax
added a commit
to theMomax/swift-docc
that referenced
this issue
Feb 8, 2023
- add DescribedError conformance TopicReferenceResolutionError - improve Hashable implementation of TopicReferenceResolutionError by storing properties demanded by DescribedError instead of raw Error - conform Replacement and Solution to Hashable to aid Hashable implementation of TopicReferenceResolutionError - add fixme regarding support for regular markdown link-style references when creating solutions (swiftlang#470) - add basic semantic information about possible solutions back into PathHierarchyTests - remove debug print in SymbolTests
theMomax
added a commit
to theMomax/swift-docc
that referenced
this issue
Feb 9, 2023
- add DescribedError conformance TopicReferenceResolutionError - improve Hashable implementation of TopicReferenceResolutionError by storing properties demanded by DescribedError instead of raw Error - conform Replacement and Solution to Hashable to aid Hashable implementation of TopicReferenceResolutionError - add fixme regarding support for regular markdown link-style references when creating solutions (swiftlang#470) - add basic semantic information about possible solutions back into PathHierarchyTests - remove debug print in SymbolTests
d-ronnqvist
pushed a commit
that referenced
this issue
Feb 27, 2023
…s) (#455) * fix #438 (Structure suggestions for link resolution warnings as fixits) * address review feedback - create TopicReferenceResolutionError with minimal public interface - replace TopicReferenceResolutionResult.failure's errorMessage with TopicReferenceResolutionError - add support for non-symbol reference syntax - add Solution for PathHierarchy.Error.nonSymbolMatchForSymbolLink - add meaningful information to Solution.summary - scope Replacements as small as possible (on disambiguation, path segment, or reference delimiters) - add note listing all available candidates even if near-miss suggestions are available - add Solutions if no near-miss is available, but there are only three candidates or less - make offsetWithRange mutating - remove XCTAssertElements test helper * address review feedback - add DescribedError conformance TopicReferenceResolutionError - improve Hashable implementation of TopicReferenceResolutionError by storing properties demanded by DescribedError instead of raw Error - conform Replacement and Solution to Hashable to aid Hashable implementation of TopicReferenceResolutionError - add fixme regarding support for regular markdown link-style references when creating solutions (#470) - add basic semantic information about possible solutions back into PathHierarchyTests - remove debug print in SymbolTests * add assertions for solutions in SymbolTests/testUnresolvedReferenceWarningsInDocComment() + improve improve documentation about indices in source locations --------- Co-authored-by: David Rönnqvist <[email protected]> rdar://103279313
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
Fixits (see #438) produce invalid references when used with the regular markdown link syntax (e.g.
[doc:my/reference](doc:my/reference)
, or[custom title](doc:my/reference)
).The reason for that is that the code generating the replacements can only differentiate between symbol-link (
``my/reference``
) and non-symbol-link. It always assumes the reference to be written in DocC's custom link syntax (<doc:my/reference>
) in the non-symbol-link case and thus uses wrong offsets when encountering a link written in the standard markdown link syntax ([doc:my/reference](doc:my/reference)
, or[custom title](doc:my/reference)
).Checklist
main
branch of this package.Expected Behavior
Assuming that e.g.
MyClass/init()
requires the disambiguation suffix-33vaw
forinit()
, the fixit should transform the link as follows:[custom title](doc:MyClass/init())
->[custom title](doc:MyClass/init()-33vaw)
Actual behavior
[custom title](doc:MyClass/init())
->[custom title](doc:-33vawMyClass/init())
Steps To Reproduce
With
DOCC_USE_HIERARCHY_BASED_LINK_RESOLVER=YES
, runSymbolTests/testUnresolvedReferenceWarningsInDocumentationExtension()
after adding the faulty link- [custom title](doc:MyClass/init())
to the initial extension comment and analyse the resulting problem as it is done for the others.Swift-DocC Version Information
This bug was introduced in #455
Swift Compiler Version Information
The text was updated successfully, but these errors were encountered: