summaryrefslogtreecommitdiff
path: root/editor/plugins
diff options
context:
space:
mode:
authorThakee Nathees <thakeenathees@gmail.com>2020-11-29 08:07:57 +0530
committerThakee Nathees <thakeenathees@gmail.com>2020-11-29 19:45:36 +0530
commitd0e7d9b62f0bcc2ba438b12c8bfbf68d82fff0ea (patch)
treee2798248857411a781ac192cb847baed59ceb9f2 /editor/plugins
parentef2d1f6d19f861f0f4d9cf7c581795bc7f4016d8 (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 'editor/plugins')
-rw-r--r--editor/plugins/script_editor_plugin.cpp12
-rw-r--r--editor/plugins/script_editor_plugin.h1
2 files changed, 13 insertions, 0 deletions
diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp
index 6ee8193291..fa70415210 100644
--- a/editor/plugins/script_editor_plugin.cpp
+++ b/editor/plugins/script_editor_plugin.cpp
@@ -2900,6 +2900,18 @@ void ScriptEditor::_help_class_goto(const String &p_desc) {
_save_layout();
}
+void ScriptEditor::update_doc(const String &p_name) {
+ ERR_FAIL_COND(!EditorHelp::get_doc_data()->has_doc(p_name));
+
+ for (int i = 0; i < tab_container->get_child_count(); i++) {
+ EditorHelp *eh = Object::cast_to<EditorHelp>(tab_container->get_child(i));
+ if (eh && eh->get_class() == p_name) {
+ eh->update_doc();
+ return;
+ }
+ }
+}
+
void ScriptEditor::_update_selected_editor_menu() {
for (int i = 0; i < tab_container->get_child_count(); i++) {
bool current = tab_container->get_current_tab() == i;
diff --git a/editor/plugins/script_editor_plugin.h b/editor/plugins/script_editor_plugin.h
index f1453c3d20..cc02a1ccbe 100644
--- a/editor/plugins/script_editor_plugin.h
+++ b/editor/plugins/script_editor_plugin.h
@@ -482,6 +482,7 @@ public:
void close_builtin_scripts_from_scene(const String &p_scene);
void goto_help(const String &p_desc) { _help_class_goto(p_desc); }
+ void update_doc(const String &p_name);
bool can_take_away_focus() const;