-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add option to open online doc for selected class in script editor #90952
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested locally, it mostly works as expected. I've tested various classes such as HTTPClient, AnimatedSprite2D and so on. This feature makes sense to quickly access the online docs for the current class, which makes it easier to link to people (e.g. on forums).
One issue is that in user-defined classes, clicking Open in Online Docs will point to a nonexisting page. For instance, a class named Test
will point me to https://docs.godotengine.org/en/latest/classes/class_test.html
which doesn't exist. I suggest finding a way to disable this button for user-defined classes.
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? |
Add this line above an class_name Test Then use Search Help in the top-right corner of the script editor and search for |
Nevermind, I figured it out. The documentation is not available for classes that only have private attributes and functions by the looks of it. |
This now works with custom classes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The button now correctly displays Online Docs (instead of Open in Online Docs) when selecting a custom class named Test
, but clicking it still opens the page https://docs.godotengine.org/en/latest/classes/class_test.html
which doesn't exist.
Commits needs to be squashed (see https://docs.godotengine.org/en/latest/contributing/workflow/pr_workflow.html#the-interactive-rebase). |
0058812
to
af1029b
Compare
ae19825
to
cafa64c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested locally, it works as expected now. Code looks good to me.
Thanks! And congrats for your first merged Godot contribution 🎉 |
When the script editor's current tab is a script (or no tab is opened):
When the current tab is a class:
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)