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 sphinxrenderer.py variable and function visitors for C# #737

Merged
merged 1 commit into from
Sep 21, 2021

Conversation

rogerbarton
Copy link
Contributor

@rogerbarton rogerbarton commented Sep 3, 2021

Fixes #730 and rogerbarton/sphinx-csharp#5

C# requires slightly different treatment when visiting variables and functions.

@rogerbarton rogerbarton changed the title Fix sphinxrenderer.py visitors for C# Fix sphinxrenderer.py variable and function visitors for C# Sep 3, 2021
@michaeljones
Copy link
Collaborator

Thank you for contributing. Would you be able to provide an example in the 'specific examples' section of the documentation that covers this? That is the closest thing we have to regression checks at the moment :)

@rogerbarton
Copy link
Contributor Author

Yes I can have a look at adding some specific examples. I started adding some test examples in the sphinx-csharp repo but it makes more sense to have them here. The c# domain really needs some more testing/verification and docs. I will try to work on this...

Should I add a cs subfolder in examples/specific?

@jakobandersen
Copy link
Collaborator

Should I add a cs subfolder in examples/specific?

These tests will probably be revamped anyway, so for now I suggest not bothering with an extra folder, but prefixing the files with cs_ (similar to some of the current C and C++ tests).
For the actual addition, there are quite a few places to change. I think https://github.com/michaeljones/breathe/pull/723/files may provide an ok view of where changes are needed.

@jakobandersen
Copy link
Collaborator

I started adding some test examples in the sphinx-csharp repo but it makes more sense to have them here. The c# domain really needs some more testing/verification and docs. I will try to work on this...

As the C# domain can be used without Breathe I recommend leaving tests in that repo, and then add Breathe-specific tests here.

Copy link
Collaborator

@vermeeren vermeeren left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm personally fine with merging this despite the lack of tests, C# for Breathe is generally speaking not tested on this side currently, it was introduced with relatively simple PR #550 and so far afaik mainly sprinkles some if dom == 'cs' in specific areas, meaning the code will never run if it's not C#, so it can never break C/C++ in the first place.

In fact, C# support for Breathe is so niche it's not even mentioned in docs, it is only mentioned in changelog entries. I think it's safe to say that @rogerbarton is de-facto C# maintainer for Breathe at this point, considering he maintains the domain as well.

$ grep -rIin -e '[cC]#' -e '[cC][- _]sharp'
CHANGELOG.rst:42:  - Do not add inline modifier for C#. `#668 <https://github.com/michaeljones/breathe/pull/668>`__
CHANGELOG.rst:55:  - Add missing getter and setter for C#. `#661 <https://github.com/michaeljones/breathe/pull/661>`__
CHANGELOG.rst:125:  - Add support for C# using sphinx-csharp. `#550 <https://github.com/michaeljones/breathe/pull/550>`__

@michaeljones @jakobandersen Thoughts on creating a follow-up issue for C# doc/tests and getting this merged for the fix for now?

@vermeeren vermeeren added bug Problem in existing code code Source code labels Sep 18, 2021
@jakobandersen
Copy link
Collaborator

@michaeljones @jakobandersen Thoughts on creating a follow-up issue for C# doc/tests and getting this merged for the fix for now?

As you mention, the C# support is basically undocumented so I'm fine with merging as is and deferring the tests and docs for a later time.

@rogerbarton
Copy link
Contributor Author

I tried adding a C# test today, but I think this will just complicate the testing situation without much gain.
For example, you would need to have sphinx-csharp installed or else building the docs would fail.

I agree that the C# integration is quite harmless with mostly if dom == 'cs' checks. So I would be for merging this.
When more people are using the C# domain we can look at testing...
I should also write documentation first on how to use it.

@michaeljones
Copy link
Collaborator

Thank you for breaking it down @vermeeren. Very useful for some one as out of touch as I am. I agree with the reasoning. Merge away :)

@michaeljones
Copy link
Collaborator

I guess I might as well do it :)

@michaeljones michaeljones merged commit 943534f into breathe-doc:master Sep 21, 2021
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.

const keyword parsing in C#
4 participants