Skip to content

Commit fbede89

Browse files
committed
GDScript: Fix call hint appearance for complex callees
1 parent 88b9932 commit fbede89

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

modules/gdscript/editor/gdscript_docgen.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,9 @@ String GDScriptDocGen::docvalue_from_expression(const GDP::ExpressionNode *p_exp
303303
} break;
304304
case GDP::Node::CALL: {
305305
const GDP::CallNode *call = static_cast<const GDP::CallNode *>(p_expression);
306-
return call->function_name.operator String() + (call->arguments.is_empty() ? "()" : "(...)");
306+
if (call->get_callee_type() == GDP::Node::IDENTIFIER) {
307+
return call->function_name.operator String() + (call->arguments.is_empty() ? "()" : "(...)");
308+
}
307309
} break;
308310
case GDP::Node::DICTIONARY: {
309311
const GDP::DictionaryNode *dict = static_cast<const GDP::DictionaryNode *>(p_expression);
@@ -314,9 +316,11 @@ String GDScriptDocGen::docvalue_from_expression(const GDP::ExpressionNode *p_exp
314316
return id->name;
315317
} break;
316318
default: {
317-
return "<unknown>";
319+
// Nothing to do.
318320
} break;
319321
}
322+
323+
return "<unknown>";
320324
}
321325

322326
void GDScriptDocGen::_generate_docs(GDScript *p_script, const GDP::ClassNode *p_class) {

modules/gdscript/gdscript_editor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -832,7 +832,7 @@ static String _make_arguments_hint(const GDScriptParser::FunctionNode *p_functio
832832
const GDScriptParser::CallNode *call = static_cast<const GDScriptParser::CallNode *>(par->initializer);
833833
if (call->is_constant && call->reduced) {
834834
def_val = call->reduced_value.get_construct_string();
835-
} else {
835+
} else if (call->get_callee_type() == GDScriptParser::Node::IDENTIFIER) {
836836
def_val = call->function_name.operator String() + (call->arguments.is_empty() ? "()" : "(...)");
837837
}
838838
} break;

0 commit comments

Comments
 (0)