summaryrefslogtreecommitdiff
path: root/editor/doc_tools.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/doc_tools.cpp')
-rw-r--r--editor/doc_tools.cpp33
1 files changed, 28 insertions, 5 deletions
diff --git a/editor/doc_tools.cpp b/editor/doc_tools.cpp
index 47ea8cbe2a..befafec6cb 100644
--- a/editor/doc_tools.cpp
+++ b/editor/doc_tools.cpp
@@ -34,9 +34,9 @@
#include "core/config/project_settings.h"
#include "core/core_constants.h"
#include "core/io/compression.h"
+#include "core/io/dir_access.h"
#include "core/io/marshalls.h"
#include "core/object/script_language.h"
-#include "core/os/dir_access.h"
#include "core/version.h"
#include "scene/resources/theme.h"
@@ -206,14 +206,14 @@ static Variant get_documentation_default_value(const StringName &p_class_name, c
Variant default_value = Variant();
r_default_value_valid = false;
- if (ClassDB::can_instance(p_class_name)) {
+ if (ClassDB::can_instantiate(p_class_name)) {
default_value = ClassDB::class_get_default_property_value(p_class_name, p_property_name, &r_default_value_valid);
} else {
- // Cannot get default value of classes that can't be instanced
+ // Cannot get default value of classes that can't be instantiated
List<StringName> inheriting_classes;
ClassDB::get_direct_inheriters_from_class(p_class_name, &inheriting_classes);
for (List<StringName>::Element *E2 = inheriting_classes.front(); E2; E2 = E2->next()) {
- if (ClassDB::can_instance(E2->get())) {
+ if (ClassDB::can_instantiate(E2->get())) {
default_value = ClassDB::class_get_default_property_value(E2->get(), p_property_name, &r_default_value_valid);
if (r_default_value_valid) {
break;
@@ -394,13 +394,22 @@ void DocTools::generate(bool p_basic_types) {
method.qualifiers += " ";
}
method.qualifiers += "const";
- } else if (E->get().flags & METHOD_FLAG_VARARG) {
+ }
+
+ if (E->get().flags & METHOD_FLAG_VARARG) {
if (method.qualifiers != "") {
method.qualifiers += " ";
}
method.qualifiers += "vararg";
}
+ if (E->get().flags & METHOD_FLAG_STATIC) {
+ if (method.qualifiers != "") {
+ method.qualifiers += " ";
+ }
+ method.qualifiers += "static";
+ }
+
for (int i = -1; i < E->get().arguments.size(); i++) {
if (i == -1) {
#ifdef DEBUG_METHODS_ENABLED
@@ -647,6 +656,20 @@ void DocTools::generate(bool p_basic_types) {
method.qualifiers += "vararg";
}
+ if (mi.flags & METHOD_FLAG_CONST) {
+ if (method.qualifiers != "") {
+ method.qualifiers += " ";
+ }
+ method.qualifiers += "const";
+ }
+
+ if (mi.flags & METHOD_FLAG_STATIC) {
+ if (method.qualifiers != "") {
+ method.qualifiers += " ";
+ }
+ method.qualifiers += "static";
+ }
+
c.methods.push_back(method);
}