From fbede895733f3f0a9954747741c4e95290697168 Mon Sep 17 00:00:00 2001 From: Danil Alexeev Date: Mon, 23 Jun 2025 19:18:22 +0300 Subject: [PATCH] GDScript: Fix call hint appearance for complex callees --- modules/gdscript/editor/gdscript_docgen.cpp | 8 ++++++-- modules/gdscript/gdscript_editor.cpp | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/modules/gdscript/editor/gdscript_docgen.cpp b/modules/gdscript/editor/gdscript_docgen.cpp index 0b67ab42eb..3d57db7f64 100644 --- a/modules/gdscript/editor/gdscript_docgen.cpp +++ b/modules/gdscript/editor/gdscript_docgen.cpp @@ -303,7 +303,9 @@ String GDScriptDocGen::docvalue_from_expression(const GDP::ExpressionNode *p_exp } break; case GDP::Node::CALL: { const GDP::CallNode *call = static_cast(p_expression); - return call->function_name.operator String() + (call->arguments.is_empty() ? "()" : "(...)"); + if (call->get_callee_type() == GDP::Node::IDENTIFIER) { + return call->function_name.operator String() + (call->arguments.is_empty() ? "()" : "(...)"); + } } break; case GDP::Node::DICTIONARY: { const GDP::DictionaryNode *dict = static_cast(p_expression); @@ -314,9 +316,11 @@ String GDScriptDocGen::docvalue_from_expression(const GDP::ExpressionNode *p_exp return id->name; } break; default: { - return ""; + // Nothing to do. } break; } + + return ""; } void GDScriptDocGen::_generate_docs(GDScript *p_script, const GDP::ClassNode *p_class) { diff --git a/modules/gdscript/gdscript_editor.cpp b/modules/gdscript/gdscript_editor.cpp index 1c507750f6..5efd5b9707 100644 --- a/modules/gdscript/gdscript_editor.cpp +++ b/modules/gdscript/gdscript_editor.cpp @@ -832,7 +832,7 @@ 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->reduced_value.get_construct_string(); - } else { + } else if (call->get_callee_type() == GDScriptParser::Node::IDENTIFIER) { def_val = call->function_name.operator String() + (call->arguments.is_empty() ? "()" : "(...)"); } } break;