summaryrefslogtreecommitdiff
path: root/editor/doc_data.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2020-04-21 09:55:36 +0200
committerGitHub <noreply@github.com>2020-04-21 09:55:36 +0200
commit7343ec13d9d32cedb2511db0ab5d1ed454404d65 (patch)
treefb642956e458f8d4c12bf09abdc8756ed6b4a7e5 /editor/doc_data.cpp
parent40b2aea222807ab50a31c7ca718bfca76080caa0 (diff)
parentb30014f93f85303e01e32f7c2b87b1bd4c909bdc (diff)
Merge pull request #38047 from akien-mga/mono-docdata-hack
DocData: Keep Mono properties on non-Mono builds
Diffstat (limited to 'editor/doc_data.cpp')
-rw-r--r--editor/doc_data.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/editor/doc_data.cpp b/editor/doc_data.cpp
index a71427d6fc..dd9bacaa80 100644
--- a/editor/doc_data.cpp
+++ b/editor/doc_data.cpp
@@ -40,6 +40,9 @@
#include "core/version.h"
#include "scene/resources/theme.h"
+// Used for a hack preserving Mono properties on non-Mono builds.
+#include "modules/modules_enabled.gen.h"
+
void DocData::merge_from(const DocData &p_data) {
for (Map<String, ClassDoc>::Element *E = class_list.front(); E; E = E->next()) {
@@ -154,6 +157,23 @@ void DocData::merge_from(const DocData &p_data) {
break;
}
}
+
+#ifndef MODULE_MONO_ENABLED
+ // The Mono module defines some properties that we want to keep when
+ // re-generating docs with a non-Mono build, to prevent pointless diffs
+ // (and loss of descriptions) depending on the config of the doc writer.
+ // We use a horrible hack to force keeping the relevant properties,
+ // hardcoded below. At least it's an ad hoc hack... ¯\_(ツ)_/¯
+ // Don't show this to your kids.
+ if (c.name == "@GlobalScope") {
+ // Retrieve GodotSharp singleton.
+ for (int j = 0; j < cf.properties.size(); j++) {
+ if (cf.properties[j].name == "GodotSharp") {
+ c.properties.push_back(cf.properties[j]);
+ }
+ }
+ }
+#endif
}
}