Add support for 'union' symbol kinds #785
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Bug/issue #, if applicable: rdar://120374980
Summary
Clang's upcoming C++ support changed how C unions are represented in the symbol graph by giving them their own union symbol kind. This PR adds support for dedicated union symbols.
Dependencies
swiftlang/swift-docc-symbolkit#68
Testing
Support for union symbols is currently only available on Clang's
main
branch, where its C++ support was added. Additionally, it appears that union symbols are only properly generated for C++ code, rather than C code. TheCxxNamespaces
test bundle i added last month for C++ namespaces has been renamed intoCxxSymbols
, and aMyUnion
symbol has been added to it. It can be used in lieu of building Clang yourself.Steps:
swift run docc preview Tests/SwiftDocCTests/Test\ Bundles/CxxSymbols.docc
MyUnion
symbol is properly curated under the "Unions" header in the landing page.Checklist
Make sure you check off the following items. If they cannot be completed, provide a reason.
./bin/test
script and it succeeded