Skip to content
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

Prioritize files that are closer to the variable name in load()'s file suggestion list #741

Open
mount2010 opened this issue Apr 23, 2020 · 2 comments

Comments

@mount2010
Copy link

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.

@Jummit
Copy link

Jummit commented Apr 23, 2020

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.

@KoBeWi
Copy link
Member

KoBeWi commented Apr 24, 2020

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 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants