Skip to content

Doctool --gdscript-docs issues with enums #106828

Open
@Cykyrios

Description

@Cykyrios

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 output enum="MyEnum[]" instead of enum="MyEnum" (in addition to type="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)

doctool-gdscript.zip

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).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions