godot icon indicating copy to clipboard operation
godot copied to clipboard

Add option to open online doc for selected class in script editor

Open Gaktan opened this issue 1 year ago • 6 comments

When the script editor's current tab is a script (or no tab is opened): image

When the current tab is a class: image

There might be an issue if we try to open a custom class, but from what I can tell, it's not possible to open the documentation for a custom class in the editor. (At least I was not able to)

Gaktan avatar Apr 20 '24 16:04 Gaktan

Yes indeed, I did not test this since I was not able to open the documentation for the custom classes in my project. I assumed it was not possible.

Can you clarify the steps you used to open a custom class's documentation?

Gaktan avatar May 08 '24 20:05 Gaktan

Can you clarify the steps you used to open a custom class's documentation?

Add this line above an extends declaration in a script:

class_name Test

Then use Search Help in the top-right corner of the script editor and search for Test, and open its page.

Calinou avatar May 09 '24 00:05 Calinou

That's odd, it's not working for me: image

Do I need to enable an option somewhere?

Gaktan avatar May 09 '24 08:05 Gaktan

Nevermind, I figured it out. The documentation is not available for classes that only have private attributes and functions by the looks of it.

Gaktan avatar May 09 '24 11:05 Gaktan

This now works with custom classes. I have no idea if this fix works with custom C++ classes though, as I have no way to test this currently.

Gaktan avatar May 09 '24 12:05 Gaktan

Commits needs to be squashed (see https://docs.godotengine.org/en/latest/contributing/workflow/pr_workflow.html#the-interactive-rebase).

Chaosus avatar May 13 '24 17:05 Chaosus

Thanks! And congrats for your first merged Godot contribution :tada:

akien-mga avatar May 17 '24 09:05 akien-mga