-
Notifications
You must be signed in to change notification settings - Fork 153
accept sameShape constraint kind from SymbolKit #1290
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
base: main
Are you sure you want to change the base?
Conversation
@swift-ci Please test |
} | ||
|
||
func testRenderSameShape() async throws { | ||
let (_, bundle, context) = try await testBundleAndContext(copying: "LegacyBundle_DoNotUseInNewTests", excludingPaths: []) { bundleURL in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't use this test fixture in new tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't use "LegacyBundle_DoNotUseInNewTests" in new tests. Please create a new minimal tests setup that reproduces the problem and use that in the test instead.
It looks like DocC doesn't use constraint information directly from a symbol (instead only sourcing it from extensions), and Swift places |
cb1d63e
to
6d81acb
Compare
@swift-ci Please test |
Is there some place where it would make sense to display this information on the page? That would both help us verify that DocC handles this type of constraint and would communicate that information to the reader. |
case .conformance: return "conforms to" | ||
case .sameType: return "is" | ||
case .superclass: return "inherits" | ||
case .sameShape: return "is the same shape as" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Considering that we this user-facing text. Should this PR also display that somewhere?
)! | ||
|
||
let catalog = Folder(name: "unit-test.docc", content: [ | ||
InfoPlist(displayName: "SameShapeConstraint", identifier: "com.test.example"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI: this isn't needed
InfoPlist(displayName: "SameShapeConstraint", identifier: "com.test.example"), |
It would probably make sense to insert conditionals like this as part of the declarations section or something like that. I don't think Swift-DocC-Render is equipped to display conformance information there, though, so an update to display this data would also require an update there. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Bug/issue #, if applicable: rdar://129338238, swiftlang/swift-docc-symbolkit#97
Summary
This PR updates Swift-DocC to render constraint information for
sameShape
constraints, as received from SymbolKit.sameShape
constraints are used in functions with parameter packs, to ensure that the packs have the same length and/or type data.Dependencies
swiftlang/swift-docc-symbolkit#103
Testing
Generate a symbol graph for a function that uses multiple parameter packs, such as this one from the above-linked issue:
Steps:
swift run docc convert /path/to/test.docc
Checklist
Make sure you check off the following items. If they cannot be completed, provide a reason.
./bin/test
script and it succeeded