-
Notifications
You must be signed in to change notification settings - Fork 140
add support for C++ symbol graphs and namespace symbols #766
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
add support for C++ symbol graphs and namespace symbols #766
Conversation
@swift-ci Please test |
@@ -230,6 +231,8 @@ extension AutomaticCuration { | |||
/// Add a symbol kind to `KindIdentifier.noPageKinds` if it should not generate a page in the | |||
/// documentation hierarchy. | |||
static let groupKindOrder: [SymbolGraph.Symbol.KindIdentifier] = [ | |||
.namespace, |
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.
Why should this C++ symbol be ordered first? And does the whitespace imply you're going to add more C++ symbol kinds here in a new group?
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.
I added namespaces at the top in their own pseudo-grouping because they're purely an organizational construct, as opposed to classes, protocols, and other kinds of symbols, which reflect some other aspect of the project's API. Swift and plain Objective-C projects will not come across this, since they won't contain namespace symbols.
@swift-ci Please test |
abbfe7d
to
f79279b
Compare
@swift-ci Please test |
Bug/issue #, if applicable: rdar://117904448
Summary
This PR starts adding support for C++ symbol graphs, based on Clang's initial support. For the moment, the
c++
symbol language is currently lumped into "Objective-C" alongside C itself; proper standalone support for a "C++" language kind should be coordinated with Swift-DocC-Render to ensure that there is full support.In addition, this PR also introduces support for namespace symbols, as those are new in C++ compared to Objective-C.
Dependencies
swiftlang/swift-docc-symbolkit#65
Testing
As C++ symbol graphs are in a state of preliminary support in Clang (they are currently on the main branch of
llvm/llvm-project
and are being integrated intoapple/llvm-project
), a basic symbol graph is included in this PR to test automatic curation. This can be used for testing as follows:Steps:
swift run docc preview 'Tests/SwiftDocCTests/Test Bundles/CxxNamespaces.docc'
Foo
namespace is properly curated and displayed, with classBar
underneath it.Checklist
Make sure you check off the following items. If they cannot be completed, provide a reason.
./bin/test
script and it succeeded