Skip to content
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 Doxygen bindings and clang-ast-dump #215

Merged
merged 14 commits into from
Oct 11, 2024
Merged

Add Doxygen bindings and clang-ast-dump #215

merged 14 commits into from
Oct 11, 2024

Conversation

TravisCardwell
Copy link
Collaborator

This PR includes:

  • Wrappers, bindings, and Haskell functions for all of clang-c/Documentation.h except for the following:
    • CXComment.ASTNode and CXComment.TranslationUnit (not needed)
    • CXAPISet, clang_createAPISet, and clang_disposeAPISet (not needed)
    • clang_getSymbolGraphForUSR and clang_getSymbolGraphForCursor (not needed)
  • An initial version of clang-ast-dump, as an executable in the hs-bindgen-libclang package.

The PR does not include reified Haskell types for the documentation cursor types. I will do that in a separate PR.

I have tested locally against all supported GHC versions, to make sure that it works with the configured dependency bounds.

Please feel free to change clang-ast-dump as desired, of course. It should be easy to add support for more cursor kinds, options, etc.

After merge, #212 should be ready to close.

@edsko
Copy link
Collaborator

edsko commented Oct 11, 2024

For the record: this will need rebasing after the reorganization in #216 (we discussed this prior to the refactoring).

All `libclang` parameter names are capitalized.

The header documentation is updated.
This commit is a squashed version of a number of previous commits,
rebased to work with a recent redesign of `Fold` as well as the
reorganized module hierarchy.

`FoldM` uses `MonadIO`, and I refactored the code to call `liftIO`
minimizing changes.  Now that we can use a `Reader`, it is possible to
track indentation within the `Reader` environment, using `local` for
indentation, but I have not implemented that.

The new version of `Fold` no longer provides `parent`, as the parent
cursor can be queried using the API.  I rewrote the code to query both
the semantic and lexical parents.  When they are equal and are not the
target file, just "parent" is displayed.  Otherwise, "semantic parent"
and "lexical parent" are displayed separately.
@edsko
Copy link
Collaborator

edsko commented Oct 11, 2024

Looks good! Thank you for your attention to detail, much appreciated :)

@edsko edsko merged commit 7f33f00 into main Oct 11, 2024
7 checks passed
@edsko edsko deleted the doxygen branch October 11, 2024 08:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants