How to use comment documentation in GDscript?

Viewed 382

I trying to figure out how Godot documentation comments are working. I apply them in my code, but I don't see any hints in a code editor, or in property-inspector.

Where it should be shown? How can I see these hints?

And related subquestion is there a way to document function parameters?

Godot documentation comments : "If an exported variable is documented, its description is used as a tooltip in the editor. This documentation can be generated as XML files by the editor."

But export keyword already in use, or do I get it wrong? And there is no information about how to document function parameters.

1 Answers

The documentation you are looking at is for Godot 4.0. Comment documentation is a Godot 4.0 feature, and does not work in Godot 3.x. I suspect you are using Godot 3.x given that you say:

export keyword already in use

In Godot 4.0 export is no longer keyword. Instead, it is an annotation.


About documenting parameters, Godot does not generate per parameter documentation. See the method descriptions for any class that Godot provides to see what I mean.

Also @desc and @tutorial are the only supported tags in Godot 4.0 source at the time of writing. Instead explain to the parameters in the description. I believe the convention is to place the parameter name between [code] and [/code]. To reiterate, this is a Godot 4.0 feature.

Related