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

Render function candidates without using Sphinx directives #524

Merged
merged 1 commit into from
May 10, 2020

Conversation

jakobandersen
Copy link
Collaborator

The doxygenfunction directive works by

  1. finding all functions in the XML which matches the given name (without potential parameters)
  2. rendered each to docutil first nodes, and then converted the nodes to a string. The docutil nodes are discarded.
  3. the string is then parsed and an attempt at matching the parameters with the given parameters is made (this is where What is the best way to resolve the Warning re: multiple matches for a function? #289 is relevant).

Step 2 was performed using the normal rendering machinery, meaning Sphinx is told about the declarations, without them being present in the output. This results is "Duplicate declaration" warnings.

This PR uses the DefinitionParser from the C++ domain to directly parse the function signature without using the domain directives.

Fixes #504 and perhaps also #458.

(The change of base class for the BaseDirective to SphinxDirective is to get convenient access to location and config data.)

@vermeeren vermeeren added bug Problem in existing code code Source code labels May 10, 2020
@vermeeren vermeeren self-assigned this May 10, 2020
@vermeeren vermeeren self-requested a review May 10, 2020 16:54
@vermeeren vermeeren merged commit bb6bd04 into breathe-doc:master May 10, 2020
vermeeren added a commit that referenced this pull request May 10, 2020
@jakobandersen jakobandersen deleted the function_lookup branch May 10, 2020 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Problem in existing code code Source code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Duplicate declaration warning for overloaded functions
2 participants