Replies: 3 comments 6 replies
-
Implementation wise it is important to ensure that it does not break the native argument options, so the best place would probably be in The problem I see with this, is that how the editor uses this isn't really fool proof. It only handles strings well, we use it for enum options as well but the UX is bad (only being displayed before the user manually types something). Exposing this now will make it much harder to improve UX on this in the future, since backwards compatibility would become an issue. |
Beta Was this translation helpful? Give feedback.
-
I think before exposing we could extend the method's functionality to match add_code_completion_option(type: CodeCompletionKind, display_text: String, insert_text: String, text_color: Color = Color(1, 1, 1, 1), icon: Resource = null, value: Variant = null, location: int = 1024) -> void Before: virtual void get_argument_options(const StringName &p_function, int p_idx, List<String> *r_options) const; After: virtual void get_argument_options(const StringName &p_method, int p_arg_idx, List<ScriptLanguage::CodeCompletionOption> *r_options) const; _get_argument_options(method: StringName, arg_idx: int) -> Array[Dictionary] |
Beta Was this translation helpful? Give feedback.
-
I've thought about it for quite a while and I always felt like the internal |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
From the GDScript editor, autocomplete provides a list of existing animation names on an AnimationPlayer when calling AnimationPlayer.play, and a list of property names on Nodes when calling Node.get.
I think it could be a very useful feature to dynamically provide autocomplete suggestions via GDScript (and likely GDExtension).
Digging around in the source I'm seeing that there is a function to shim in this autocomplete logic.
Below is an example from AnimationPlayer.
This feature is similar to _get_property_list, allowing us to provide context for the editor.
The way these existing functions work is already so simple, flexible, and consistent, it would be great to extend it into GDScript and GDExtension.
I'm still learning this code base, and C++, so I'm not sure how I'd go about implementing it yet.
Currently trying to learn from examples of the existing virtual/overridable functions.
If this idea passes, I'd sure like to take a stab at it.
Any thoughts, suggestion, questions, or other discussion around this is appreciated. Thanks.
Beta Was this translation helpful? Give feedback.
All reactions