-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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
Some issues with custom class documentation generated from comments #67704
Comments
I had a look at the code and found this in editor_help.cpp when populating Property Descriptions: Lines 1488 to 1491 in 72b845b
But when creating the Properties list, we have this: Lines 794 to 798 in 72b845b
I think we should either check whether the property is private here as well, or filter the list beforehand, as it is done for methods in _update_method_descriptions .
As a test, I copy-pasted the above code and it fixes this particular issue, private properties no longer appear in Property Descriptions. |
This is intentional and documented.
TODO. This is an Editor Help issue. You can use
I didn't quite understand what you meant. Perhaps the point is outdated and it has been fixed? |
This last point is only true for built-in virtual functions, I think. If I make a custom script and document a function that has an underscore as its first character, it is treated as a normal function. (see last screenshot in the OP, this still appears the same after pulling the latest commits on the master branch, but I do see "virtual" next to built-in Node functions like in your screenshot) |
I still don't understand what you mean, sorry. All non-static GDScript functions are virtual, since the method implemented in the derived class is called (static functions have some issues: #72973, #77895). Adding the qualifier to the user documentation makes no sense and can be confusing since the When overriding a virtual built-in method, the user documentation no longer displays the ## _ready() override.
func _ready() -> void:
pass |
I agree it is correct not to show "virtual" next to an overridden method, and as it would probably be too much of a hassle to determine if a method is supposed to be overridden in the parent class, this point is probably moot. I was just thinking it could be nice to know in the custom documentation if a method was virtual or not. |
What I meant initially was just having "virtual" next to the method, just like the built-in ones in the Node class that you showed in your screenshot (when documenting a script with a method that you intend to be overridden). Pretty much in the same way that methods starting with an underscore are private by convention, those starting with an underscore, but documented, could be considered virtual by convention as well. I agree though this is more of a proposal than a bug either way. |
Godot version
v4.0.beta.custom_build [72b845b]
System information
Linux Mint 21
Issue description
The documentation generated from a script has some issues, below is the list of what I noticed so far:
[br]
(I assume this is on purpose to avoid unwanted line breaks - as a side note,[br]
adds spacing to the new line)Array
Variant
, even when explicitly typed[Array[int]]
for instance, this will only highlight[int]
and keep the brackets aroundArray
.virtual
appear next to virtual methods would be nice, but since other private methods are hidden, this should not be an issue.See MRP for some screenshots of the issues.
Steps to reproduce
Create a new script, add signals, enums, properties, methods as wanted, then open the help page of the created class.
Minimal reproduction project
GeneratedDocumentation.zip
I wrote a dummy class to test the documentation feature, here are some screenshots of the issues mentioned above:
Array
variable default value:Variant
:Array
(should beArray[float]
here):The text was updated successfully, but these errors were encountered: