diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2024-02-12 13:35:07 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2024-02-12 13:35:07 +0100 |
commit | c8b3e39161f4f54afc34c6b0e161087bcd3dacda (patch) | |
tree | 7ce34170879f8f25b4c8c1ad75dc72ebfc76490a /modules | |
parent | 106efa44d46e2f0a2b367e2007273e56c7f633c0 (diff) | |
parent | 7ffc246aad2c6250f70971a3bfc8e5bf11407ebc (diff) | |
download | redot-engine-c8b3e39161f4f54afc34c6b0e161087bcd3dacda.tar.gz |
Merge pull request #88211 from bitwise-aiden/ba-default-arg-hints
Add fallback argument hints for default values
Diffstat (limited to 'modules')
-rw-r--r-- | modules/gdscript/gdscript_editor.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/modules/gdscript/gdscript_editor.cpp b/modules/gdscript/gdscript_editor.cpp index 1a574b3f3e..babd2c1772 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<const GDScriptParser::CallNode *>(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<const GDScriptParser::ArrayNode *>(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<const GDScriptParser::DictionaryNode *>(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: { |