-
Notifications
You must be signed in to change notification settings - Fork 40
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
Comment Support in JSON output #79
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…mong other tweaks
…ine documentation we may see. Support should be extended to some of these commands more formally (e.g., throw or warning.)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR takes comments parsed by clang and folds them into the processed json (the bulk of this work happens in the new
ProcessComment
routine inutilities.cpp
). This PR also incorporates these comments in the Hyde emitters for YAML output. Note that this feature takes advantage of the functionality already implemented in Clang to parse C++ comments for inline documentation. Not all inline documentation will be accounted for. Specifically, comments not tied to an AST node will be processed. For example, top-level fields like@file
will not show up in Hyde output, because they are not processed into a node in the Clang AST.__INLINED__
value. If a documentation field (e.g.,brief
) is found documented in-line in the C++ sources, the field will change from__MISSING__
to inlined, and the inlined value will be used. Fields marked__INLINED__
can still be filled in if additional documentation external to the source file is desired.owner
field, this requires a special@hyde-owner
in-source documentation, if such were to be used by a developer. Other fields will try to map intelligently from what may already be provided for other source documentation tools (e.g., Doxygen.)-hyde-fixup-subfield
mode, which will convert from Hyde v1 to Hyde v2 docs. This will move all fields exceptlayout
andtitle
into ahyde
subfield in the YAML. Note this mode is unique in that it takes pre-existing documentation as source(s), not a C++ source file.= default
, and= delete
routines will no longer require documentation, that is, all their__MISSING__
fields will be marked__OPTIONAL__
.brief
anddescription
fields from method/function overloads to the top-level page, reducing the amount of missing fields a developer must fill in.-Werror=documentation
is now specified for the driver to ensure the documentation in the sources accurately reflect the C++ entities with which they are associated.Example
Given the following source file
add_one.cpp
:Here is the resulting JSON output with the related
comments
fields added.