You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-08 12:40:44 +00:00
Merge pull request #93429 from dalexeev/fix-method-signature-appearance
GDScript: Fix call hint appearance for complex callees
This commit is contained in:
@@ -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<const GDP::CallNode *>(p_expression);
|
||||
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<const GDP::DictionaryNode *>(p_expression);
|
||||
@@ -314,9 +316,11 @@ String GDScriptDocGen::docvalue_from_expression(const GDP::ExpressionNode *p_exp
|
||||
return id->name;
|
||||
} break;
|
||||
default: {
|
||||
return "<unknown>";
|
||||
// Nothing to do.
|
||||
} break;
|
||||
}
|
||||
|
||||
return "<unknown>";
|
||||
}
|
||||
|
||||
void GDScriptDocGen::_generate_docs(GDScript *p_script, const GDP::ClassNode *p_class) {
|
||||
|
||||
@@ -841,7 +841,7 @@ 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->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;
|
||||
|
||||
Reference in New Issue
Block a user