Skip to content

Commit 6277e9d

Browse files
committed
Merge pull request #93429 from dalexeev/fix-method-signature-appearance
GDScript: Fix call hint appearance for complex callees
2 parents b93719c + fbede89 commit 6277e9d

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
@@ -841,7 +841,7 @@ static String _make_arguments_hint(const GDScriptParser::FunctionNode *p_functio
841841
const GDScriptParser::CallNode *call = static_cast<const GDScriptParser::CallNode *>(par->initializer);
842842
if (call->is_constant && call->reduced) {
843843
def_val = call->reduced_value.get_construct_string();
844-
} else {
844+
} else if (call->get_callee_type() == GDScriptParser::Node::IDENTIFIER) {
845845
def_val = call->function_name.operator String() + (call->arguments.is_empty() ? "()" : "(...)");
846846
}
847847
} break;

0 commit comments

Comments
 (0)