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

Add ability to change Script Editor default completion or use custom ones #1514

Closed
me2beats opened this issue Sep 15, 2020 · 3 comments
Closed

Comments

@me2beats
Copy link

Describe the project you are working on:
gdscript plugins

Describe the problem or limitation you are having in your project:
When there are many methods and properties in a script, then there is a desire to have flexible settings for displaying these properties and methods in the Code Editor autocomplete window (popup).
For example I really miss

Describe the feature / enhancement and how it helps to overcome the problem or limitation:
The solution could be to open access to the API for Autocomplete methods and, in general, in the ability to add a custom logic to Autocomplete using plugins.
This would allow flexible customization of autocomplete to fit ones needs.

Describe how your proposal will work, with code, pseudocode, mockups, and/or diagrams:

Ability to get a list of autocomplete results and filter them, sort and add new results.
Using a plugin, one could get the autocomplete class (say via get_editor_interface().get_script_editor().get_completion() and then use the methods, properties and signals of this class to modify the autocomplete results.

Or to create and use custom Autocompletions using Autocomplete plugins, for example by analogy with the Inspector plugins.

The ability to change the appearance of the autocomplete window would also be convenient (here's an example where tabs are added to the autocomplete window godotengine/godot#38449 (comment))

If this enhancement will not be used often, can it be worked around with a few lines of script?:
No, there's no way to work around it

Is there a reason why this should be core and not an add-on in the asset library?:
I think this couldn't be implemented as an add-on since there is no API for it

@me2beats
Copy link
Author

At the moment, I believe that adding the following API would cover most of the needs for customizing the autocomplete with plugins:

Methods (in order of importance):

  1. void add_option(option:String, icon:Texture) - I think this is the most important function here.
  2. Array get_options() (returns current options)
  3. void remove_option(option:String)
  4. void sort_custom(Object obj, String func) (sort results in custom order)
  5. void sort() (sorts results alphabetically)
  6. void show()/hide() (shows/hides autocompletion popup)
  7. bool is_hidden()

Signals:

  • hidden/shown

These methods could be in Completion singleton, that can be accessed with get_editor_interface().get_completion().

@me2beats
Copy link
Author

me2beats commented May 9, 2023

Closing due to lack of support

@me2beats me2beats closed this as completed May 9, 2023
@me2beats
Copy link
Author

me2beats commented May 9, 2023

See also #6839

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

2 participants