diff options
author | Andy Maloney <andy@ackackgames.com> | 2021-03-01 09:39:03 -0500 |
---|---|---|
committer | Andy Maloney <andy@ackackgames.com> | 2021-03-01 09:39:03 -0500 |
commit | 4e89cb330b29a67af3954851d17e8e318e89bb2a (patch) | |
tree | 128a172503b2e4c2700ee819663378500656132a /modules | |
parent | bd42a6c51e384f55bbfda9ce64f85b471dbabda6 (diff) |
[script editor] Fix two special cases not being checked in code completion
When this code was changed for 4.0, a "break" statement inside a for loop in 3.x was changed to "return".
This means that the two special cases (autoloads and input actions) are never checked.
Removing the return lets these work properly in the editor.
(Also reorder conditionals to short-circuit and avoid expensive methods.)
Diffstat (limited to 'modules')
-rw-r--r-- | modules/gdscript/gdscript_editor.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/modules/gdscript/gdscript_editor.cpp b/modules/gdscript/gdscript_editor.cpp index b17971cf93..a9975c8602 100644 --- a/modules/gdscript/gdscript_editor.cpp +++ b/modules/gdscript/gdscript_editor.cpp @@ -2261,10 +2261,9 @@ static void _find_call_arguments(GDScriptParser::CompletionContext &p_context, c } r_arghint = _make_arguments_hint(info, p_argidx); - return; } - if (ClassDB::is_parent_class(class_name, "Node") && (p_method == "get_node" || p_method == "has_node") && p_argidx == 0) { + if (p_argidx == 0 && ClassDB::is_parent_class(class_name, "Node") && (p_method == "get_node" || p_method == "has_node")) { // Get autoloads List<PropertyInfo> props; ProjectSettings::get_singleton()->get_property_list(&props); |