Skip to content

The documentation for a class defined by the keyword 'class_name' does not appear when searching using the '(doc) Search Help' #86577

@adrbodev

Description

@adrbodev

Tested versions

Reproducible in : 4.2.stable

System information

Godot v4.2.stable - Ubuntu 22.04.3 LTS 22.04 - X11 - Vulkan (Forward+) - dedicated Quadro M2000M (nvidia; 535.129.03) - Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz (8 Threads)

Issue description

The documentation for a class defined by the keyword 'class_name' does not appear when searching using the 'Search Help (doc)' bar located in the Workspace Script in the top-right corner of the script editor.

This documentation appears in the search bar the first time the file is loaded or the first time Godot is opened after modifying the file. Subsequent times, the class documentation is no longer suggested in the search bar.

Steps to reproduce

If you use the MRP (Minimal reproduction project), open the project and jump to the step 3.

  1. Download the following repository :
    git clone https://gitlab.com/Tomateauketchup/la-state-makina.git /tmp/la-state-makina

  2. Create a new empty project with Godot as follows:

  • Directory : /tmp/la-state-makina
  • Name : la-state-makina

Set Version Control metadata to None.

(ignore the warnings saying that the directory is not empty)

  1. Ignore the four errors associated with the following files:
  • unit_test_sm_clock.gd
  • unit_test_sm_clock.gd
  • unit_test_sm_json_serializer.gd
  • unit_test_sm_state_machine.gd

If you want to resolve these errors, install the gdUnit4 asset.
But this is not important and not needed to reproduce the bug.

  1. Do not exit the Godot editor. Click on "Script" in the Workspace. In the top-right corner of the script editor, click on "Search Help," and enter "SMStateMachine."

You should be able to open the SMStateMachine documentation, which should display correctly.

4 bis) (Optional) In the Godot editor, close all documentation, and scripts.

  1. Quit the godot IDE.

  2. Reopen the godot IDE.

If you didn't made the 4bis) operation, you should obtain the error :
"No loader found for resource: res://addons/la-state-makina/src/state_machine/sm_state_machine.gd (expected type: SMStateMachine)"
If you made the 4 bis) operation, you have no error.

  1. Click on "Script" in the Workspace. In the top-right corner of the script editor, click on "Search Help," and enter "SMStateMachine."

The search toolbar should not suggest SMStateMachine.

This is a bug because we don't change anything in our project and the editor was able to display previously the documentation !

  1. Quit the godot IDE.

  2. Modify the source code with an external IDE (like vim) :
    /tmp/la-state-makina/addons/la-state-makina/src/state_machine/sm_state_machine.gd
    Add an empty line at the end of the file.

  3. Reopen the godot IDE

  4. Click on "Script" in the Workspace. In the top-right corner of the script editor, click on "Search Help," and enter "SMStateMachine."

Now, the search toolbar should suggest SMStateMachine, and you should be able to open the SMStateMachine documentation, which should display correctly.

11bis) (optional) In the Godot editor, close all scenes, documentation, and scripts.

  1. Quit the godot IDE.

  2. Reopen the godot IDE

If you didn't made the 11bis) operation, you should obtain the error :
"No loader found for resource: res://addons/la-state-makina/src/state_machine/sm_state_machine.gd (expected type: SMStateMachine)"
If you made the 11bis) operation, you have no error.

  1. Click on "Script" in the Workspace. In the top-right corner of the script editor, click on "Search Help," and enter "SMStateMachine."

The search toolbar should no longer suggest SMStateMachine.

This is a bug, the editor was able to display previously the documentation.

Minimal reproduction project (MRP)

la-state-makina.zip

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Done

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions