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 documentation comments to the .NET library. #39703

Closed
HubKing opened this issue Jun 19, 2020 · 11 comments
Closed

Add documentation comments to the .NET library. #39703

HubKing opened this issue Jun 19, 2020 · 11 comments

Comments

@HubKing
Copy link

HubKing commented Jun 19, 2020

Your Godot version:
3.2

Issue description:
It seems that the documentation data are already there,
image
, but the writers of the C# library forgot to add the documentation comments to the C# library in lots of cases.

Since the data are already there, can't it be done mechanically (by some kind of code) to insert method descriptions into the C# library (like below) so that C# users could see the documentation while they code? In the example below, the usage example is GDScript, so it doest not exactly match C#, but many users will be able to guess the C# code from that, and it is better than having nothing. Even if you do not like having GDScript example in C#, you could then at least add the summary ("Converts one or ...") part.

image

URL to the documentation page (if already existing):

@neikeq
Copy link
Contributor

neikeq commented Jun 20, 2020

I think this belongs to the main repo instead of godot-docs.
We need to set a rule that no new additions are undocumented. Then we need to start the process of documenting the existing cases.

@Calinou Calinou transferred this issue from godotengine/godot-docs Jun 20, 2020
@Calinou
Copy link
Member

Calinou commented Jun 20, 2020

We need to set a rule that no new additions are undocumented.

This was done here: 6d0e8f9

@neikeq
Copy link
Contributor

neikeq commented Jun 20, 2020

I'm talking specifically about the part of the C# API that's not auto-generated: https://github.com/godotengine/godot/tree/master/modules/mono/glue/GodotSharp/GodotSharp/Core

@aaronfranke
Copy link
Member

aaronfranke commented Jun 21, 2020

@neikeq What are the goals here, do we want to document every single class and method? I can do that if it's desired.

EDIT: I will do this myself once my other PRs that touch the Mono module are merged. I don't want to cause even more conflicts with myself.

EDIT 2: Eh I'll just add the documentation now and rebase those other PRs later.

@neikeq
Copy link
Contributor

neikeq commented Jun 26, 2020

Yes, that would be ideal. Since this part of the API is not generated, we should also try to follow the xml comments convention more closely (the generated API adds everything into a summary).

@Anutrix
Copy link
Contributor

Anutrix commented Oct 26, 2021

What's remaining on this?

@raulsntos
Copy link
Member

The GodotSharp project which contains the code that users are most likely to interact with is pretty much fully documented now, the remaining undocumented code is:

  • modules/mono/glue/GodotSharp/GodotSharp/Core/Dispatcher.cs
  • modules/mono/glue/GodotSharp/GodotSharp/Core/GodotTaskScheduler.cs
  • modules/mono/glue/GodotSharp/GodotSharp/Core/GodotSynchronizationContext.cs
  • modules/mono/glue/GodotSharp/GodotSharp/Core/Interfaces/IAwaitable.cs
  • modules/mono/glue/GodotSharp/GodotSharp/Core/Interfaces/IAwaiter.cs
  • modules/mono/glue/GodotSharp/GodotSharp/Core/Interfaces/ISerializationListener.cs
  • modules/mono/glue/GodotSharp/GodotSharp/Core/Attributes/AssemblyHasScriptsAttribute.cs
  • modules/mono/glue/GodotSharp/GodotSharp/Core/Attributes/DisableGodotGeneratorsAttribute.cs
  • modules/mono/glue/GodotSharp/GodotSharp/Core/Attributes/ExportAttribute.cs
  • modules/mono/glue/GodotSharp/GodotSharp/Core/Attributes/GodotMethodAttribute.cs
  • modules/mono/glue/GodotSharp/GodotSharp/Core/Attributes/RPCAttributes.cs
  • modules/mono/glue/GodotSharp/GodotSharp/Core/Attributes/ScriptPathAttribute.cs
  • modules/mono/glue/GodotSharp/GodotSharp/Core/Attributes/ToolAttribute.cs
  • modules/mono/glue/GodotSharp/GodotSharp/Core/Attributes/SignalAttribute.cs

A lot of this code is probably something the user won't use directly so it may not need to be documented, I would say the attributes (Export, Tool, Signal, and the RPCAttributes) are the ones that should be documented the most.

There are editor projects in the mono module that are also undocumented but this issue probably doesn't care about those, these would be nice to document for developers looking to contribute to the mono module:

  • modules/mono/editor/GodotTools/**/*.cs
  • modules/mono/editor/Godot.NET.Sdk/Godot.SourceGenerators/**/*.cs

@aaronfranke
Copy link
Member

aaronfranke commented Oct 26, 2021

@Anutrix The operators are also undocumented. They're a minor thing to write documentation for, but Godot now has entries for them in the XML class reference, and C# IDEs show a warning about missing docs for operators. I plan to write documentation for operators for both core and C# but I'm waiting on #53452 (which I could still improve, so no rush merging it).

EDIT: The operators are now documented as of #54581

@JoshIQui
Copy link
Contributor

JoshIQui commented May 2, 2022

I have just updated my pull request on #60128 to have all of the requested files documented.

@aaronfranke aaronfranke removed their assignment May 3, 2022
@akien-mga
Copy link
Member

akien-mga commented Oct 3, 2022

@godotengine/dotnet Is this sufficiently solved by #60128 or is there more that needs to be documented? And if so, is that "more" still a good task for first time contributors?

@aaronfranke
Copy link
Member

Closing as solved by #54581, #60128, and likely a few others.

@aaronfranke aaronfranke added this to the 4.0 milestone Feb 1, 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

8 participants