diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-02-15 13:14:58 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-15 13:14:58 +0100 |
commit | 78a767edb38134bcfaa9df793214af9756c097c0 (patch) | |
tree | 901c660504b60a7cde62463afe36291652db2001 /editor | |
parent | efb179c3074feab6f7d8de61e92d2a83da9d789e (diff) | |
parent | b68dd2e1894450dd69ffddf05a45c40e6c01a36a (diff) |
Merge pull request #35679 from Calinou/doc-add-xml-schema
Diffstat (limited to 'editor')
-rw-r--r-- | editor/doc_tools.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/editor/doc_tools.cpp b/editor/doc_tools.cpp index 749ab7e2f6..36ae19cb23 100644 --- a/editor/doc_tools.cpp +++ b/editor/doc_tools.cpp @@ -1356,7 +1356,12 @@ Error DocTools::save_classes(const String &p_default_path, const Map<String, Str header += " inherits=\"" + c.inherits + "\""; } header += String(" version=\"") + VERSION_BRANCH + "\""; - header += ">"; + // Reference the XML schema so editors can provide error checking. + // Modules are nested deep, so change the path to reference the same schema everywhere. + const String schema_path = save_path.find("modules/") != -1 ? "../../../doc/class.xsd" : "../class.xsd"; + header += vformat( + R"( xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="%s">)", + schema_path); _write_string(f, 0, header); _write_string(f, 1, "<brief_description>"); |