-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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 tooltips for res://
and uid://
strings in ScriptEditor
#100803
Conversation
|
Makes sense, I will add that.
I will try adding the full resource path to the tooltip body instead of having it in the title. |
res://
and uid://
strings in ScriptEditor
I have now added support for
|
I made an attempt to make the width of the tooltip match the content width, but couldn't get it working because of problems similar to #93040. I do think it would make these tooltips look much nicer (regular code-related tooltips are good as they are however), but I'll leave it for someone with more |
I opened a very similar PR: |
The reason I didn't show the full path for I don't think the preview is questionable. I was thinking of adding that too but it would've been a little troublesome with how I implemented this PR, but your PR made me rethink my implementation a little. Overall, i like the design of my PR's tooltip since it's consistent with the existing I'm thinking of keeping the header as is (and keeping the detection of different kinds of file types), but implement the tooltip body using normal Controls instead of using the RTL.
and put a preview to the right of the buttons. This would make the tooltip much easier to maintain in the future, and also make it easier to add more features. Finally, I/we have forgotten about |
I gave this a test and it works great, I think it's good enough for a start. There are some corner cases, like files that don't exist in FileSystem (e.g. try opening
Not really. |
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.
Needs rebase.
I'll rebase it as this would be great to merge for 4.4.beta1 today. |
c8396cc
to
e813d30
Compare
Note that this would also benefit from godotengine/godot-proposals#11365, so you can make it show up without having to touch the mouse. It could even use the same keyboard shortcut (since string literals can't have documentation attached to them). |
Thanks! |
I just read the blog post, are we able to reverse search the uid to a file, as the uid has no meaning to humans and removes context to the underlying resource. I hope there is a way to quickly understand what the uid represents? |
Well, this PR allows UID lookup from script editor. There is no other built-in tool for that currently, you either have to paste in script editor and hover or run an EditorScript that translates UID to path. |
This occurred to me too... It would be nice if we could alias UIDs so that we can at least render the reference itself human-readable instead of having to copy-pasta magic strings all around the project. |
Thanks for adding this great addition to the engine. I'm keen on knowing if it's currently possible to drag and drop a resource file using the UID over the absolute file path. If there's no support for that, perhaps I or someone else could make a new MR to add a new Ctrl+Shift shortcut to use the UID instead of the file path when drag & dropping a file into the code editor as it's currently really cumbersome copy paste the UID each time. Also, I've noticed a bug where the Ctrl+Shift+Alt+C shortcut doesn't work for copying the UID when having the file selected. |
Closes godotengine/godot-proposals#5027
Following the addition of tooltips (#91060), this PR adds tooltips for
res://
anduid://
strings.res_uid_tooltips.mp4