-
Notifications
You must be signed in to change notification settings - Fork 10.6k
don't split attribute fragments with a separate typeIdentifier fragment #63637
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
Conversation
|
@swift-ci Please test |
|
Should we consider keeping these separated? I wouldn't expect the |
|
I could go either way. In my head, the |
I can see the argument for that. Maybe we already have precedent here with other syntax elements like Even though |
|
|
|
Right I agree – but when I click on |
|
I think Sendable is probably a better example: https://developer.apple.com/documentation/swift/sendable. It can be written both as a protocol conformance and as an attribute so I think it would be odd to link to a different piece of text in the attribute-case. |
|
I went ahead and pushed a commit that breaks the token apart again like before, just with the |
|
@swift-ci Please test |
|
@swift-ci Please smoke test |
Resolves rdar://104930571
When SymbolGraphGen renders a custom attribute which it knows the USR for, it splits the declaration fragment for that attribute into two: one with the
@sign with kindattribute, and one with the name of the attribute with nametypeIdentifierand a reference to the attribute definition USR. SymbolGraphGen forces any fragment with a link USR needs to be of kindtypeIdentifierdue to an implementation detail of Swift-DocC-Render; however, this produces an awkward rendering where the attribute appears in two colors because of the differing fragment kinds.This PR changes the rendering code to keep
attributefragments intact when printing a type reference, instead of breaking off a separatetypeIdentifierfragment.