From 7ffc246aad2c6250f70971a3bfc8e5bf11407ebc Mon Sep 17 00:00:00 2001 From: Aiden Storey Date: Sun, 11 Feb 2024 10:01:03 -0500 Subject: [PATCH] Add fallback argument hints for default values --- modules/gdscript/gdscript_editor.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/gdscript/gdscript_editor.cpp b/modules/gdscript/gdscript_editor.cpp index 1a574b3f3e8e..babd2c177210 100644 --- a/modules/gdscript/gdscript_editor.cpp +++ b/modules/gdscript/gdscript_editor.cpp @@ -778,18 +778,24 @@ static String _make_arguments_hint(const GDScriptParser::FunctionNode *p_functio const GDScriptParser::CallNode *call = static_cast(par->initializer); if (call->is_constant && call->reduced) { def_val = call->function_name.operator String() + call->reduced_value.operator String(); + } else { + def_val = call->function_name.operator String() + (call->arguments.is_empty() ? "()" : "(...)"); } } break; case GDScriptParser::Node::ARRAY: { const GDScriptParser::ArrayNode *arr = static_cast(par->initializer); if (arr->is_constant && arr->reduced) { def_val = arr->reduced_value.operator String(); + } else { + def_val = arr->elements.is_empty() ? "[]" : "[...]"; } } break; case GDScriptParser::Node::DICTIONARY: { const GDScriptParser::DictionaryNode *dict = static_cast(par->initializer); if (dict->is_constant && dict->reduced) { def_val = dict->reduced_value.operator String(); + } else { + def_val = dict->elements.is_empty() ? "{}" : "{...}"; } } break; case GDScriptParser::Node::SUBSCRIPT: {