-
-
Notifications
You must be signed in to change notification settings - Fork 97
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
Show documentation when using autocompletion in the script editor #408
Comments
Was mentioned in godotengine/godot#23188 |
Thanks, I close this request! |
Reopening. The purpose of this repo is to move all (or most) of the proposals here, so if anything, the other one should be closed. |
Related to #1393. This is a good idea, but care needs to be taken as many property/method descriptions are long. Trimming based on a number of characters can remove useful information. Trimming after the first sentence is prone to hiding important caveats as well. We'll need to figure out a good way to make descriptions short enough to fit within < 5 lines, while keeping the essential information. |
Describe the project you are working on:
Retreiving the doc of the functions when auto complete.
Q: What is auto complete refer to?
A: In Code Editor (script editor, class referance) when you type "self." after the dot you will see panel showing suggested auto complete entries, such as "transform", "get_node(" and more.
Q: What is the doc refering to?
A: If lets say "self." contains entry called "transform" (member of Sparial class) then the doc of transform will be "Local space Transform of this node, with respect to the parent node.". (Actual doc of godot api for the Sparial class for 'transform' member).
Describe the problem or limitation you are having in your project:
I didn't find any referance to getting a documentation given anything. It doesn't handle it.
Describe how this feature / enhancement will help you overcome this problem or limitation:
Adding to 'gdbscript_editor.cpp' a function that takes in entry of auto complete and returns doc.
Show a mock up screenshots/video or a flow diagram explaining how your proposal will work:
https://imgur.com/a/fW2bmho
Describe implementation detail for your proposal (in code), if possible:
I am not sure, its my first time contributing to anything.
Create datatype (in typedef.cpp?) of GDDoc that contains: path of doc (doc/xxx), string that is the code we want to auto complete, string that is the auto complete code
Or better yet a single function that translates : by given: code to auto complete and the current auto complete suggestion (that the user selected in the panel) return Path to the doc.
Another function: By given path of doc, return the 1-5 first lines (the short documentation, description) of the doc. Don't return ALL the doc, with the tables, only a few lines.
We can extend this by returning the whole doc, then display the whole doc in another panel.
If this enhancement will not be used often, can it be worked around with a few lines of script?:
It will be used often, but it is not easy.
Is there a reason why this should be core and not an add-on in the asset library?:
Yes, because it is the built in Code Editor of Godot and is core functionality
The text was updated successfully, but these errors were encountered: