-
-
Notifications
You must be signed in to change notification settings - Fork 98
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
Implement script editor description hint on hover a symbol/word #1393
Implement script editor description hint on hover a symbol/word #1393
Comments
I'm glad to see that someone is finally working on this, thanks very much for the work! Would it also be possible associate the "show hint" action to a keyboard shortcut (i.e. show the hint corresponding to the symbol at the cursor's location)? I mainly use the keyboard when coding and having to take the mouse each time I want to check the documentation would be inconvient. |
Providing API for (optional) having this for custom classes and methods could be useful as well |
@me2beats This will probably be done automatically by godotengine/godot#41095. |
@me2beats yeah it's possible with godotengine/godot#41095 tested locally. |
Is work on this still ongoing? The last commit in the linked fork was over a year and a half ago |
@ThakeeNathees has been inactive on GitHub since July 2021, so godotengine/godot#41502 will likely have to be salvaged by another contributor. This won't be trivial to rebase against the latest |
I would really like to have this feature now. Is there any way to make a custom Godot Editor build with the functionality shown in the gif at the top? |
No, as there is no up-to-date branch with an implementation of this feature. As I mentioned above, the script editor received a large refactor last year, so most of the work would have to be redone from scratch. Efforts to rebase godotengine/godot#41502 against the latest |
I'm interested in taking a stab at this issue so I've done a quick review of (1) what we already have that is similar, (2) references to the solution in other applications, and (3) the possible features/requirements that may be considered. Review of Existing/Similar Implementations1. Generic tooltip2. Inspector elements tooltip on hover3. Intellisense dropdown4. The authoring comment of this issue.5. Existing draft for this issue (for Godot 4)
References1. Visual Studio (C#)2. WebStorm (JavaScript/TypeScript)3. Visual Studio Code (Python)4. Visual Studio Code (JavaScript/TypeScript)Review of Possible RequirementsGlossary
Implement a tooltip component for symbols.
NotesMy latest WIP branch for this issue: My PR Draft Some improvements I'd like to make to this comment include:
Question: Should I create another issue or a discussion for the contents of this comment? I'm not sure if the scope of this issue encompasses these possible features and if this is the right place for their discussion in case it leads to off topic comments. |
Definitely – I'd use the same delay as GUI tooltips and EditorHelpBits. In general, I'd recommend reusing the already existing EditorHelpBit rather than creating something bespoke for the script editor. (EditorHelpBit is what's used in the inspector when hovering property names.) |
Here are some UI designs that I experimented with (using HTML/CSS). You can find the file or preview it below.
Notes
|
Just to point out I have just rebased godotengine/godot#63908 to master. |
As a side-note, it's worth adding Editor Settings to determine what/how much is shown on the hovers. Personally, I'd never really want to hover and see function documentation. I'd mostly want to hover arguments to see their name and type (especially for custom functions), so a very minimal hover would be preferred. If the tooltip could automatically adjust it's content based on settings, it could remain one general hover, while still allowing users control over what information they see! |
Would also be nice if the tip showed on auto completions as a sub popup. |
Not sure if it is supported or not (the docs don't show support), so maybe this would be a new proposal, using a ## Do something with the two colors
## @param color1 Description of color 1
## @param color2 Description of color 2
func fancy_color(color1: Color, color2: Color):
# Do something with the two colors So, when creating a JavaScript/TypeScript function, the popup shows like this image, as seen, it auto formats the |
The way Godot class reference docs are written favors documenting parameters inline in the description, using For example: ## Do something with the two colors [param color1] (which is a fancy color)
## and [param color2] (which is an even fancier color).
func fancy_color(color1: Color, color2: Color):
# Do something with the two colors |
Describe the project you are working on:
Description hint on hover for the text edit(https://github.com/ThakeeNathees/godot/tree/TextEdit-hover-hint)
Describe the problem or limitation you are having in your project:
it's one of the essential feature for a fully featured script editor and currently we lack of. Also the implementation of GDScript doc comments (godotengine/godot#41095) it'll improve the user experience.
Describe the feature / enhancement and how it helps to overcome the problem or limitation:
when a symbol is hovered by the mouse, the text editor emits a signal to validate the symbol (like when it's being hovered with a ctrl), and when validating for that symbol it'll add some additional data (like description, type, class_name, return_type, arguments, etc.,) and display them at the text edit's draw call.
Describe how your proposal will work, with code, pseudocode, mockups, and/or diagrams:
A working example (this will work with doc comments when it'll be merged)
If this enhancement will not be used often, can it be worked around with a few lines of script?:
No, It would be a great usability improvement and can't be worked around with the script.
Is there a reason why this should be core and not an add-on in the asset library?:
there is no way to implement this with an add-on
Bugsquad edit (keywords for easier searching): tooltip
The text was updated successfully, but these errors were encountered: