diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-07-24 23:26:30 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-24 23:26:30 +0200 |
commit | b7a47bfc09cc581e27fec051b71f1dfc6c68b7ad (patch) | |
tree | 48f4a7d42a7ec587a5a5043eab6d1d0081ffc796 /core/doc_data.cpp | |
parent | 9233a6be041ffe6440f6cffc5c7c5d4d450cd065 (diff) | |
parent | 5d49df8d97f4e7c0cafae80115f784f1d0e97044 (diff) |
Merge pull request #63098 from Xwdit/fix_qualifiers_script_doc
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); } |