Makes built-in vararg methods actual vararg methods
- Removes hardcoded parameters from built-in vararg methods and adds METHOD_FLAG_VARARG to them. - Makes EditorHelp display built-in vararg methods correctly.
This commit is contained in:
parent
ddb1ce08c3
commit
8bd92a96a4
@ -576,6 +576,12 @@ void DocData::generate(bool p_basic_types) {
|
||||
MethodDoc md;
|
||||
md.name = mi.name;
|
||||
|
||||
if (mi.flags & METHOD_FLAG_VARARG) {
|
||||
if (md.qualifiers != "")
|
||||
md.qualifiers += " ";
|
||||
md.qualifiers += "vararg";
|
||||
}
|
||||
|
||||
return_doc_from_retinfo(md, mi.return_val);
|
||||
|
||||
for (int i = 0; i < mi.arguments.size(); i++) {
|
||||
|
@ -1863,11 +1863,11 @@ static void _find_call_arguments(GDCompletionContext &context, const GDParser::N
|
||||
arghint += ", ";
|
||||
else
|
||||
arghint += " ";
|
||||
if (i == p_argidx) {
|
||||
if (i == p_argidx || (mi.flags & METHOD_FLAG_VARARG && i > p_argidx)) {
|
||||
arghint += String::chr(0xFFFF);
|
||||
}
|
||||
arghint += _get_visual_datatype(mi.arguments[i]) + " " + mi.arguments[i].name;
|
||||
if (i == p_argidx) {
|
||||
if (i == p_argidx || (mi.flags & METHOD_FLAG_VARARG && i > p_argidx)) {
|
||||
arghint += String::chr(0xFFFF);
|
||||
}
|
||||
}
|
||||
|
@ -1572,43 +1572,49 @@ MethodInfo GDFunctions::get_info(Function p_func) {
|
||||
} break;
|
||||
case TEXT_STR: {
|
||||
|
||||
MethodInfo mi("str", PropertyInfo(Variant::NIL, "what"), PropertyInfo(Variant::NIL, "..."));
|
||||
MethodInfo mi("str");
|
||||
mi.return_val.type = Variant::STRING;
|
||||
mi.flags |= METHOD_FLAG_VARARG;
|
||||
return mi;
|
||||
|
||||
} break;
|
||||
case TEXT_PRINT: {
|
||||
|
||||
MethodInfo mi("print", PropertyInfo(Variant::NIL, "what"), PropertyInfo(Variant::NIL, "..."));
|
||||
MethodInfo mi("print");
|
||||
mi.return_val.type = Variant::NIL;
|
||||
mi.flags |= METHOD_FLAG_VARARG;
|
||||
return mi;
|
||||
|
||||
} break;
|
||||
case TEXT_PRINT_TABBED: {
|
||||
|
||||
MethodInfo mi("printt", PropertyInfo(Variant::NIL, "what"), PropertyInfo(Variant::NIL, "..."));
|
||||
MethodInfo mi("printt");
|
||||
mi.return_val.type = Variant::NIL;
|
||||
mi.flags |= METHOD_FLAG_VARARG;
|
||||
return mi;
|
||||
|
||||
} break;
|
||||
case TEXT_PRINT_SPACED: {
|
||||
|
||||
MethodInfo mi("prints", PropertyInfo(Variant::NIL, "what"), PropertyInfo(Variant::NIL, "..."));
|
||||
MethodInfo mi("prints");
|
||||
mi.return_val.type = Variant::NIL;
|
||||
mi.flags |= METHOD_FLAG_VARARG;
|
||||
return mi;
|
||||
|
||||
} break;
|
||||
case TEXT_PRINTERR: {
|
||||
|
||||
MethodInfo mi("printerr", PropertyInfo(Variant::NIL, "what"), PropertyInfo(Variant::NIL, "..."));
|
||||
MethodInfo mi("printerr");
|
||||
mi.return_val.type = Variant::NIL;
|
||||
mi.flags |= METHOD_FLAG_VARARG;
|
||||
return mi;
|
||||
|
||||
} break;
|
||||
case TEXT_PRINTRAW: {
|
||||
|
||||
MethodInfo mi("printraw", PropertyInfo(Variant::NIL, "what"), PropertyInfo(Variant::NIL, "..."));
|
||||
MethodInfo mi("printraw");
|
||||
mi.return_val.type = Variant::NIL;
|
||||
mi.flags |= METHOD_FLAG_VARARG;
|
||||
return mi;
|
||||
|
||||
} break;
|
||||
@ -1640,8 +1646,9 @@ MethodInfo GDFunctions::get_info(Function p_func) {
|
||||
} break;
|
||||
case GEN_RANGE: {
|
||||
|
||||
MethodInfo mi("range", PropertyInfo(Variant::NIL, "..."));
|
||||
MethodInfo mi("range");
|
||||
mi.return_val.type = Variant::ARRAY;
|
||||
mi.flags |= METHOD_FLAG_VARARG;
|
||||
return mi;
|
||||
} break;
|
||||
case RESOURCE_LOAD: {
|
||||
|
Loading…
Reference in New Issue
Block a user