diff options
author | Xwdit <xwditfr@gmail.com> | 2022-07-17 07:26:57 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2022-07-24 23:00:19 +0200 |
commit | 5d49df8d97f4e7c0cafae80115f784f1d0e97044 (patch) | |
tree | 70cefd179cbbc71ad748ad2448e733a4d0769c39 /core/doc_data.cpp | |
parent | b50acebd48d7e45a1444e553a5ea9878ef87592a (diff) | |
download | redot-engine-5d49df8d97f4e7c0cafae80115f784f1d0e97044.tar.gz |
Fix missing method qualifiers in script doc
Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
Diffstat (limited to 'core/doc_data.cpp')
-rw-r--r-- | core/doc_data.cpp | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/core/doc_data.cpp b/core/doc_data.cpp index 89e7a8dc71..df86cd1dc2 100644 --- a/core/doc_data.cpp +++ b/core/doc_data.cpp @@ -115,6 +115,31 @@ void DocData::method_doc_from_methodinfo(DocData::MethodDoc &p_method, const Met p_method.name = p_methodinfo.name; p_method.description = p_desc; + if (p_methodinfo.flags & METHOD_FLAG_VIRTUAL) { + p_method.qualifiers = "virtual"; + } + + if (p_methodinfo.flags & METHOD_FLAG_CONST) { + if (!p_method.qualifiers.is_empty()) { + p_method.qualifiers += " "; + } + p_method.qualifiers += "const"; + } + + if (p_methodinfo.flags & METHOD_FLAG_VARARG) { + if (!p_method.qualifiers.is_empty()) { + p_method.qualifiers += " "; + } + p_method.qualifiers += "vararg"; + } + + if (p_methodinfo.flags & METHOD_FLAG_STATIC) { + if (!p_method.qualifiers.is_empty()) { + p_method.qualifiers += " "; + } + p_method.qualifiers += "static"; + } + return_doc_from_retinfo(p_method, p_methodinfo.return_val); for (int i = 0; i < p_methodinfo.arguments.size(); i++) { @@ -123,7 +148,7 @@ void DocData::method_doc_from_methodinfo(DocData::MethodDoc &p_method, const Met int default_arg_index = i - (p_methodinfo.arguments.size() - p_methodinfo.default_arguments.size()); if (default_arg_index >= 0) { Variant default_arg = p_methodinfo.default_arguments[default_arg_index]; - argument.default_value = default_arg.get_construct_string(); + argument.default_value = default_arg.get_construct_string().replace("\n", ""); } p_method.arguments.push_back(argument); } |