-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Symbol graph support #28678
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
Symbol graph support #28678
Conversation
@akyrtzi Can you add anyone else that you'd like to take a look? |
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!
@nkcsgexi this involves reading information from a Swift module, could you take a look? |
Adds a tool `swift-symbolgraph-extract` that reads an existing Swift module and prints a platform- and language-agnostic JSON description of the module, primarly for documentation. Adds a small sub-library `SymbolGraphGen` which houses the core implementation for collecting relevant information about declarations. The main entry point is integrated directly into the driver as a mode: the tool is meant to be run outside of the normal edit-compile-run/test workflow to avoid impacting build times. Along with common options for other tools, unique options include `pretty-print` for debugging, and a `minimum-access-level` options for including internal documentation. A symbol graph is a directed graph where the nodes are symbols in a module and the edges are relationships between them. For example, a `struct S` may have a member `var x`. The graph would have two nodes for `S` and `x`, and one "member-of" relationship edge. Other relationship kinds include "inherits-from" or "conforms to". The data format for a symbol graph is still under development and may change without notice until a specificiation and versioning scheme is published. Various aspects about a symbol are recorded in the nodes, such as availability, documentation comments, or data needed for printing the shapes of declarations without having to understand specifics about the langauge. Implicit and public-underscored stdlib declarations are not included by default. rdar://problem/55346798
@swift-ci Please smoke test |
@swift-ci Please test |
Build failed |
Build failed |
Per e-mail, we'll do post-commit review on this and refine it as needed. This uses its own driver mode so will not affect any other workflows in the compiler. |
This broke the windows builders: https://ci-external.swift.org/job/oss-swift-windows-x86_64/2422/ |
Adds a tool
swift-symbolgraph-extract
that reads an existing Swiftmodule and prints a platform- and language-agnostic JSON description of
the module, primarly for documentation.
Adds a small sub-library
SymbolGraphGen
which houses the coreimplementation for collecting relevant information about declarations.
The main entry point is integrated directly into the driver as a mode:
the tool is meant to be run outside of the normal edit-compile-run/test
workflow to avoid impacting build times.
Along with common options for other tools, unique options include
pretty-print
for debugging, and aminimum-access-level
options forincluding internal documentation.
A symbol graph is a directed graph where the nodes are symbols in a
module and the edges are relationships between them. For example, a
struct S
may have a membervar x
. The graph would have two nodes forS
andx
, and one "member-of" relationship edge. Other relationshipkinds include "inherits-from" or "conforms to". The data format for a
symbol graph is still under development and may change without notice
until a specificiation and versioning scheme is published.
Various aspects about a symbol are recorded in the nodes, such as
availability, documentation comments, or data needed for printing the
shapes of declarations without having to understand specifics about the
langauge.
Implicit and public-underscored stdlib declarations are not included by
default.
rdar://problem/55346798