You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the project you are working on:
This suggestion does not apply to a particular project.
Describe the problem or limitation you are having in your project:
I'd like selecting a file to load, especially when working dynamically with classes, to be faster. Right now, it follows alphabetical order.
Describe the feature / enhancement and how it helps to overcome the problem or limitation:
I'd like load() to prioritize files closer to the variable name.
Describe how your proposal will work, with code, pseudocode, mockups, and/or diagrams:
For instance, if I named the variable Item, the file "res://Item.gd" should be at the top of the list. var Item = load("
Godot will suggest "res://item.gd". If it is possible to read files at this stage, a possible way of "guessing" the right file might be to read the class_name of said files. Otherwise, a simple Llevenstein distance sort of files would be nice.
If this enhancement will not be used often, can it be worked around with a few lines of script?:
Not sure.
Is there a reason why this should be core and not an add-on in the asset library?:
Don't think load() can be changed by an add-on.
The text was updated successfully, but these errors were encountered:
I think this is not the right solution to the problem. I think load autocomplete isn't good too, but I find making it depend on the variable name very questionable.
I also agree that making it dependent on variable name is not a really good idea.
But the autocompletion in general should be improved, see godotengine/godot#21726
There was a PR resolving this issue, but it kind of died :/
Calinou
changed the title
Prioritize files that are closer to the variable name in load()'s file suggestion list.
Prioritize files that are closer to the variable name in load()'s file suggestion list
May 4, 2020
Describe the project you are working on:
This suggestion does not apply to a particular project.
Describe the problem or limitation you are having in your project:
I'd like selecting a file to load, especially when working dynamically with classes, to be faster. Right now, it follows alphabetical order.
Describe the feature / enhancement and how it helps to overcome the problem or limitation:
I'd like load() to prioritize files closer to the variable name.
Describe how your proposal will work, with code, pseudocode, mockups, and/or diagrams:
For instance, if I named the variable Item, the file "res://Item.gd" should be at the top of the list.
var Item = load("
Godot will suggest
"res://item.gd"
. If it is possible to read files at this stage, a possible way of "guessing" the right file might be to read the class_name of said files. Otherwise, a simple Llevenstein distance sort of files would be nice.If this enhancement will not be used often, can it be worked around with a few lines of script?:
Not sure.
Is there a reason why this should be core and not an add-on in the asset library?:
Don't think load() can be changed by an add-on.
The text was updated successfully, but these errors were encountered: