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

Fix error when using Sphinx renderer with C# enums #848

Closed

Conversation

Esvandiary
Copy link

@Esvandiary Esvandiary commented Jun 8, 2022

Fixes #847

The error appears to be related to Doxygen applying strong="yes" to the enums' memberdef tags in the XML, as seen in the example input here. This results in the Sphinx renderer marking their object type as enum-class rather than enum; however, there is no enum-class object type defined in the C# type mapping, so an exception occurs.

This PR takes the route of defining enum-class in the C# type mapping with an identical definition to enum; this seems like the least disruptive option, but I don't know if a different solution (e.g. checking if we're generating for C# when deciding the object type and not using the enum-class type if so) would be preferred.

@jakobandersen
Copy link
Collaborator

Thanks for reporting and for the PR. I find it a bit haxy to pretend a directive exists when it doesn't, so I have made #849 which fixes it in the way you allude to. Can you double-check that it fixes things on your end as well?

@Esvandiary
Copy link
Author

Agreed that #849 is much cleaner - I just wasn't familiar enough with the codebase to know how to achieve it 😄
I can confirm it also fixes my problem, so quite happy to close this in favour of your implementation!

@Esvandiary Esvandiary closed this Jun 9, 2022
@Esvandiary Esvandiary deleted the fix-csharp-enum-objtype branch June 15, 2022 09:55
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.

Rendering C# enums with the Sphinx renderer causes an exception
2 participants