diff options
author | Thakee Nathees <thakeenathees@gmail.com> | 2020-11-29 08:07:57 +0530 |
---|---|---|
committer | Thakee Nathees <thakeenathees@gmail.com> | 2020-11-29 19:45:36 +0530 |
commit | d0e7d9b62f0bcc2ba438b12c8bfbf68d82fff0ea (patch) | |
tree | e2798248857411a781ac192cb847baed59ceb9f2 /core/object/script_language.h | |
parent | ef2d1f6d19f861f0f4d9cf7c581795bc7f4016d8 (diff) |
Documentation generation for GDScript
- ClassDoc added to GDScript and property reflection data were extracted
from parse tree
- GDScript comments are collected from tokenizer for documentation and
applied to the ClassDoc by the GDScript compiler
- private docs were excluded (name with underscore prefix and doesn't
have any doc comments)
- default values (of non exported vars), arguments are extraced from the
parser
- Integrated with GDScript 2.0 and new enums were added.
- merge conflicts fixed
Diffstat (limited to 'core/object/script_language.h')
-rw-r--r-- | core/object/script_language.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/core/object/script_language.h b/core/object/script_language.h index 3fd56c2f15..e34e5060a4 100644 --- a/core/object/script_language.h +++ b/core/object/script_language.h @@ -35,6 +35,7 @@ #include "core/io/resource.h" #include "core/templates/map.h" #include "core/templates/pair.h" +#include "editor/doc_data.h" class ScriptLanguage; @@ -145,6 +146,10 @@ public: virtual void set_source_code(const String &p_code) = 0; virtual Error reload(bool p_keep_state = false) = 0; +#ifdef TOOLS_ENABLED + virtual const Vector<DocData::ClassDoc> &get_documentation() const = 0; +#endif // TOOLS_ENABLED + virtual bool has_method(const StringName &p_method) const = 0; virtual MethodInfo get_method_info(const StringName &p_method) const = 0; @@ -305,6 +310,7 @@ public: virtual Ref<Script> get_template(const String &p_class_name, const String &p_base_class_name) const = 0; virtual void make_template(const String &p_class_name, const String &p_base_class_name, Ref<Script> &p_script) {} virtual bool is_using_templates() { return false; } + virtual bool has_documentation() { return false; } virtual bool validate(const String &p_script, int &r_line_error, int &r_col_error, String &r_test_error, const String &p_path = "", List<String> *r_functions = nullptr, List<Warning> *r_warnings = nullptr, Set<int> *r_safe_lines = nullptr) const = 0; virtual String validate_path(const String &p_path) const { return ""; } virtual Script *create_script() const = 0; |