diff options
Diffstat (limited to 'editor/doc')
-rw-r--r-- | editor/doc/doc_data.cpp | 22 | ||||
-rw-r--r-- | editor/doc/doc_dump.cpp | 21 |
2 files changed, 25 insertions, 18 deletions
diff --git a/editor/doc/doc_data.cpp b/editor/doc/doc_data.cpp index de3d13cdac..38ff9cd5fc 100644 --- a/editor/doc/doc_data.cpp +++ b/editor/doc/doc_data.cpp @@ -533,7 +533,7 @@ void DocData::generate(bool p_basic_types) { ClassDoc &c = class_list[cname]; c.name = cname; - Variant::CallError cerror; + Callable::CallError cerror; Variant v = Variant::construct(Variant::Type(i), NULL, 0, cerror); List<MethodInfo> method_list; @@ -555,18 +555,21 @@ void DocData::generate(bool p_basic_types) { argument_doc_from_arginfo(ad, mi.arguments[j]); ad.name = arginfo.name; - int defarg = mi.default_arguments.size() - mi.arguments.size() + j; - if (defarg >= 0) - ad.default_value = mi.default_arguments[defarg]; + int darg_idx = mi.default_arguments.size() - mi.arguments.size() + j; + if (darg_idx >= 0) { + Variant default_arg = mi.default_arguments[darg_idx]; + ad.default_value = default_arg.get_construct_string(); + } method.arguments.push_back(ad); } - if (mi.return_val.type == Variant::NIL) { - if (mi.return_val.name != "") - method.return_type = "Variant"; - } else { - method.return_type = Variant::get_type_name(mi.return_val.type); + return_doc_from_retinfo(method, mi.return_val); + + if (mi.flags & METHOD_FLAG_VARARG) { + if (method.qualifiers != "") + method.qualifiers += " "; + method.qualifiers += "vararg"; } c.methods.push_back(method); @@ -673,7 +676,6 @@ void DocData::generate(bool p_basic_types) { argument_doc_from_arginfo(ad, mi.arguments[j]); int darg_idx = j - (mi.arguments.size() - mi.default_arguments.size()); - if (darg_idx >= 0) { Variant default_arg = E->get().default_arguments[darg_idx]; ad.default_value = default_arg.get_construct_string(); diff --git a/editor/doc/doc_dump.cpp b/editor/doc/doc_dump.cpp index 5f7fa53ee7..b0a89ff4b8 100644 --- a/editor/doc/doc_dump.cpp +++ b/editor/doc/doc_dump.cpp @@ -161,10 +161,13 @@ void DocDump::dump(const String &p_file) { default_arg_text = "false"; break; case Variant::INT: - case Variant::REAL: + case Variant::FLOAT: //keep it break; case Variant::STRING: + case Variant::STRING_NAME: + default_arg_text = "@\"" + default_arg_text + "\""; + break; case Variant::NODE_PATH: default_arg_text = "\"" + default_arg_text + "\""; break; @@ -184,16 +187,18 @@ void DocDump::dump(const String &p_file) { case Variant::AABB: case Variant::BASIS: case Variant::COLOR: - case Variant::POOL_BYTE_ARRAY: - case Variant::POOL_INT_ARRAY: - case Variant::POOL_REAL_ARRAY: - case Variant::POOL_STRING_ARRAY: - case Variant::POOL_VECTOR3_ARRAY: - case Variant::POOL_COLOR_ARRAY: + case Variant::PACKED_BYTE_ARRAY: + case Variant::PACKED_INT32_ARRAY: + case Variant::PACKED_FLOAT32_ARRAY: + case Variant::PACKED_INT64_ARRAY: + case Variant::PACKED_FLOAT64_ARRAY: + case Variant::PACKED_STRING_ARRAY: + case Variant::PACKED_VECTOR3_ARRAY: + case Variant::PACKED_COLOR_ARRAY: default_arg_text = Variant::get_type_name(default_arg.get_type()) + "(" + default_arg_text + ")"; break; case Variant::OBJECT: - case Variant::DICTIONARY: // 20 + case Variant::DICTIONARY: case Variant::ARRAY: case Variant::_RID: |