-
-
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
Sort autocomplete options in a more useful way #4189
Sort autocomplete options in a more useful way #4189
Comments
I created an issue about it once: godotengine/godot#21726 |
@KoBeWi Ah, sorry, I tried to search but did "code complete" as my query. It may have come up anyway, but I missed it. I thought there would be an issue regarding it as I noticed it clearly coming from VS/Rider, so others would have too. |
Ok, I tried something. Here is the commit so you can see the changes: godotengine/godot@master...EricEzaM:better-code-completion Basic logic:
Note as of writing the implementation ONLY works for "attributes" on "Native" data types, like Also, future wishlist/stretch-goal item: Serialise and save which code completion options are selected in which contexts, and how often. Then push these options closer to the top. Like with |
Haha wow, yep, a straight up dupe of 99. Oops! I knew it was likely to be have reported somewhere before. |
If it makes you feel better, I knew the issue I was looking for and it still took me a few minutes to find it :) |
At any rate, it should be reopened temporarily as the PR was reverted pending some improvements to the code. |
Reopening, as this was reverted by godotengine/godot#59629. |
Theoretically it should be pretty easy with the additions in the linked PR. Theoretically :D |
Describe the project you are working on
N/A
Describe the problem or limitation you are having in your project
The sorting of autocompletion options is not very productive.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
Improve the sorting of the options to take into account the contents of (in order)
Godot Currently (4.0)
Good Example, Visual Studio. Just some random WPF project I had lying around
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
I looked at the code... would require a bit of work changing how code completion works, see
GDScriptLanguage::complete_code
.I am not really familiar with the code, there is heaps of it, and it's not really commented so I tried and promptly gave up on trying to do it.
Probably done by adding an additional property to
ScriptCodeCompletionOption
, something like 'location', which would specify the script path or class name from which the option comes from. e.g. 'Node', 'res://test/my_script.gd', 'Object', 'res://test/base_script.gd'Then, when filtering (in
CodeEdit
) use the value of the 'location' to determine the "weight" of the option. You would have access to theScript
there, so would be able to get a list of all the classes from which the script inherits (if any), and then loop through that list and assign weight to each.This File
= highest weight,Last base class
= lower weight,globals
= lowest weight.Just thinking out loud here, such a simple method may not work with some complexities, like accessing members of a 'static' class, like the
Input.
example in the images above.If this enhancement will not be used often, can it be worked around with a few lines of script?
Nope
Is there a reason why this should be core and not an add-on in the asset library?
Its the editor
The text was updated successfully, but these errors were encountered: