You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you put it before class_name but have other ## comments followed by a blank line, they override the class doc comment.
It seems like the first ## in a file should be the doc comment and other should either be appended to it or ignored. Using the last one seems less likely to be correct.
Workaround
Make sure any following doc strings are attached to another line (no blank whitespace):
## Force the global rotation to stay at 0 (never rotate).class_nameNilRotationextendsNode2D## Run every frame.func_process(_dt):
global_rotation=0
Steps to reproduce
Put doc comment before (or after!) class_name but have other ## comments, they override the doc comment:
## Force the global rotation to stay at 0 (never rotate).class_nameNilRotationextendsNode2D## Run every frame. (Oops, this becomes the class doc string.)func_process(_dt):
global_rotation=0
Or write a doc comment that contains a blank line for space:
class_nameNilRotationextendsNode2D## Force the global rotation to stay at 0 (never rotate).## Sometimes you don't want rotation to change.func_process(_dt):
global_rotation=0
You could argue these are both incorrect ways of writing class doc comments. If the implementation is simpler to assign the last doc comment for the class, then that's fine. But it's surprising as a user. Especially since doc comments usually precede what they annotate.
Minimal reproduction project (MRP)
trivially reproducible in new project.
The text was updated successfully, but these errors were encountered:
I tested this with v4.4.dev7.mono.official [46c8f8c5c] but I cannot reproduce the problem with either of the provided ways. The first ## comment is always displayed in the tooltip or on the help page.
Tested versions
Reproducible in v4.3.stable.official [77dcf97]
Class doc comments were added in d1231be, but I haven't checked if it occurred in that build.
System information
Godot v4.3.stable - Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 2060 (NVIDIA; 32.0.15.6590) - Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz (12 Threads)
Issue description
If you put it before class_name but have other
##
comments followed by a blank line, they override the class doc comment.It seems like the first
##
in a file should be the doc comment and other should either be appended to it or ignored. Using the last one seems less likely to be correct.Workaround
Make sure any following doc strings are attached to another line (no blank whitespace):
Steps to reproduce
Put doc comment before (or after!) class_name but have other
##
comments, they override the doc comment:Or write a doc comment that contains a blank line for space:
You could argue these are both incorrect ways of writing class doc comments. If the implementation is simpler to assign the last doc comment for the class, then that's fine. But it's surprising as a user. Especially since doc comments usually precede what they annotate.
Minimal reproduction project (MRP)
trivially reproducible in new project.
The text was updated successfully, but these errors were encountered: