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

Interfaces are created with "inheritdoc" xml comments #57

Open
realbart opened this issue Aug 12, 2024 · 4 comments · May be fixed by #63
Open

Interfaces are created with "inheritdoc" xml comments #57

realbart opened this issue Aug 12, 2024 · 4 comments · May be fixed by #63
Labels
bug Something isn't working enhancement New feature or request help wanted Extra attention is needed

Comments

@realbart
Copy link

As interfaces are typically at the top of the inheritance chain (interface -> abstract class -> concrete class) inheriting documentation does not make sense.

In manual code, inheritdoc is often used in the concrete class, but since we generate our interface, we put the xml documentation in the class itself. Inheriting bottom up does not work, so if you want to do anything with xml comments at all, I'd suggest you simply copy them.

@ChristianSauer
Copy link
Collaborator

When I started this, i actually copied them.
The problem is that it was diffcult to get the raw XML strings - I had only access to the parsed comments, and putting them into XML again is not trivial and error prone.
I am open to suggestions

@ChristianSauer ChristianSauer added bug Something isn't working enhancement New feature or request help wanted Extra attention is needed labels Aug 13, 2024
@realbart
Copy link
Author

realbart commented Aug 13, 2024 via email

@fjmorel
Copy link

fjmorel commented Aug 14, 2024

It should be possible to use inheritdoc with a specific cref like this to pull class comments onto the interface:

/// <inheritdoc cref="ClassName.MethodName{Generic1,Generic2}(Param1Type,Param2Type)"/>

It worked for this random method I tried it on in Rider. I don't know how hard it is to write as as source generator.

@ChaseFlorell
Copy link

ChaseFlorell commented Nov 4, 2024

It should be possible to use inheritdoc with a specific cref like this to pull class comments onto the interface:

/// <inheritdoc cref="ClassName.MethodName{Generic1,Generic2}(Param1Type,Param2Type)"/>

It worked for this random method I tried it on in Rider. I don't know how hard it is to write as as source generator.

@fjmorel This appears to work, at least for Jetbrains Rider. I have submitted a PR (#63) and my initial testing seems positive.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
4 participants