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 enumerator values in documentation #175

Closed
jnikula opened this issue Aug 6, 2023 · 1 comment
Closed

Add enumerator values in documentation #175

jnikula opened this issue Aug 6, 2023 · 1 comment

Comments

@jnikula
Copy link
Owner

jnikula commented Aug 6, 2023

The Sphinx C and C++ domain directive for enumerators allows optionally specifying the enumerator value:

.. c:enumerator:: name = value

It would be straightforward to unconditionally add it (the Cursor for CursorKind.ENUM_CONSTANT_DECL has enum_value property), but the question is whether that is the right thing to do.

The alternatives:

  • Always display value
  • Display value if the source code explicitly sets it. This is what Doxygen appears to do. I think this requires looking at the tokens. I've implemented this in Enumerator values #176
  • Make it configurable, could be done globally and at c:autoenum::
  • Never display value (status quo)

I'm not really fond of adding a lot of configuration, and would prefer sane defaults instead.

@BrunoMSantos thoughts?

@BrunoMSantos
Copy link
Collaborator

I replied in #176, but to be explicit, I like the Doxygen behaviour here. I don't see much value in making it configurable personally and we can always add that later if anyone wants it I guess, keeping the Doxygen behaviour as default.

@jnikula jnikula closed this as completed Aug 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants