diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2021-07-30 15:28:05 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2021-07-30 15:29:52 +0200 |
commit | 7adf4cc9b5de6701a41e27690a69b9892d5eed85 (patch) | |
tree | 0019e6d1b7cd993b81d5bba268074cfc4e10a213 /editor | |
parent | a1c19b9a1e53f78c75c13cb418270db80057b21a (diff) |
doc: Use self-closing tags for `return` and `argument`
For the time being we don't support writing a description for those, preferring
having all details in the method's description.
Using self-closing tags saves half the lines, and prevents contributors from
thinking that they should write the argument or return documentation there.
Diffstat (limited to 'editor')
-rw-r--r-- | editor/doc_tools.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/editor/doc_tools.cpp b/editor/doc_tools.cpp index cbd4a1b916..c752d0d4fd 100644 --- a/editor/doc_tools.cpp +++ b/editor/doc_tools.cpp @@ -1208,8 +1208,7 @@ Error DocTools::save_classes(const String &p_default_path, const Map<String, Str if (m.return_enum != String()) { enum_text = " enum=\"" + m.return_enum + "\""; } - _write_string(f, 3, "<return type=\"" + m.return_type + "\"" + enum_text + ">"); - _write_string(f, 3, "</return>"); + _write_string(f, 3, "<return type=\"" + m.return_type + "\"" + enum_text + " />"); } for (int j = 0; j < m.arguments.size(); j++) { @@ -1221,12 +1220,10 @@ Error DocTools::save_classes(const String &p_default_path, const Map<String, Str } if (a.default_value != "") { - _write_string(f, 3, "<argument index=\"" + itos(j) + "\" name=\"" + a.name.xml_escape() + "\" type=\"" + a.type.xml_escape() + "\"" + enum_text + " default=\"" + a.default_value.xml_escape(true) + "\">"); + _write_string(f, 3, "<argument index=\"" + itos(j) + "\" name=\"" + a.name.xml_escape() + "\" type=\"" + a.type.xml_escape() + "\"" + enum_text + " default=\"" + a.default_value.xml_escape(true) + "\" />"); } else { - _write_string(f, 3, "<argument index=\"" + itos(j) + "\" name=\"" + a.name.xml_escape() + "\" type=\"" + a.type.xml_escape() + "\"" + enum_text + ">"); + _write_string(f, 3, "<argument index=\"" + itos(j) + "\" name=\"" + a.name.xml_escape() + "\" type=\"" + a.type.xml_escape() + "\"" + enum_text + " />"); } - - _write_string(f, 3, "</argument>"); } _write_string(f, 3, "<description>"); @@ -1274,8 +1271,7 @@ Error DocTools::save_classes(const String &p_default_path, const Map<String, Str _write_string(f, 2, "<signal name=\"" + m.name + "\">"); for (int j = 0; j < m.arguments.size(); j++) { const DocData::ArgumentDoc &a = m.arguments[j]; - _write_string(f, 3, "<argument index=\"" + itos(j) + "\" name=\"" + a.name.xml_escape() + "\" type=\"" + a.type.xml_escape() + "\">"); - _write_string(f, 3, "</argument>"); + _write_string(f, 3, "<argument index=\"" + itos(j) + "\" name=\"" + a.name.xml_escape() + "\" type=\"" + a.type.xml_escape() + "\" />"); } _write_string(f, 3, "<description>"); |