Description
Tested versions
Reproducible in v4.5.dev.custom_build [aef0065]
System information
Godot v4.5.dev (aef0065) - Manjaro Linux #1 SMP PREEMPT_DYNAMIC Wed, 14 May 2025 14:56:34 +0000 on Wayland - Wayland display driver, Multi-window, 2 monitors - Vulkan (Forward+) - dedicated AMD Radeon RX 7900 XT (RADV NAVI31) - AMD Ryzen 9 7900X 12-Core Processor (24 threads)
Issue description
When generating XML files with godot --doctool --gdscript-docs
, enums can display the following problems:
- they do not include any description, even when documented (see doctool --gdscript-docs is missing enum descriptions #105937);
- variables typed as
Array[MyEnum]
will outputenum="MyEnum[]"
instead ofenum="MyEnum"
(in addition totype="int[]"
); - crosslinks to enum values are broken (not directly related to XML files, this is more about in-editor help):
[constant SomeClass.SomeEnum.SOME_VALUE]
is formatted as a link, but does not lead anywhere.
Steps to reproduce
Create a script containing the following:
class_name DocToolIssue
extends Node
## My enum, not showing in exported XML files.
enum MyEnum {
FIRST_VALUE, ## An enum value for [enum MyEnum].
SECOND_VALUE, ## An enum value for [enum MyEnum].
}
## An array of [enum MyEnum] values. [constant MyEnum.FIRST_VALUE] means something,
## [constant MyEnum.SECOND_VALUE] means another thing.
var some_var: Array[MyEnum] = []
## This one works properly.
var another_var := MyEnum.FIRST_VALUE
Generate the XML file with godot --doctool --gdscript-docs res://
. The resulting XML file contains the following:
<class name="DocToolIssue" inherits="Node" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/godotengine/godot/master/doc/class.xsd">
<brief_description>
</brief_description>
<description>
</description>
<tutorials>
</tutorials>
<members>
<member name="some_var" type="int[]" setter="" getter="" enum="DocToolIssue.MyEnum[]" default="[]">
An array of [enum MyEnum] values. [constant MyEnum.FIRST_VALUE] means something, [constant MyEnum.SECOND_VALUE] means another thing.
</member>
<member name="another_var" type="int" setter="" getter="" enum="DocToolIssue.MyEnum" default="0">
This one works properly.
</member>
</members>
<constants>
<constant name="FIRST_VALUE" value="0" enum="MyEnum">
An enum value for [enum MyEnum].
</constant>
<constant name="SECOND_VALUE" value="1" enum="MyEnum">
An enum value for [enum MyEnum].
</constant>
</constants>
</class>
Minimal reproduction project (MRP)
The XML file is included in the docs folder. You can also check the broken link for [constant MyEnum.FIRST_VALUE]
(you might have to make the window or the help area smaller to force it to scroll, otherwise even working links won't appear to do anything).