From d0e7d9b62f0bcc2ba438b12c8bfbf68d82fff0ea Mon Sep 17 00:00:00 2001 From: Thakee Nathees Date: Sun, 29 Nov 2020 08:07:57 +0530 Subject: 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 --- editor/plugins/script_editor_plugin.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'editor/plugins/script_editor_plugin.cpp') 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(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; -- cgit v1.2.3 From 42bfa169960b59c5d9337e9f63862f5feae92d58 Mon Sep 17 00:00:00 2001 From: Thakee Nathees Date: Sun, 29 Nov 2020 09:12:06 +0530 Subject: Refactor DocData into core and editor (DocTools) parts --- editor/plugins/script_editor_plugin.cpp | 64 +++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) (limited to 'editor/plugins/script_editor_plugin.cpp') diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp index fa70415210..12790a6746 100644 --- a/editor/plugins/script_editor_plugin.cpp +++ b/editor/plugins/script_editor_plugin.cpp @@ -1249,13 +1249,35 @@ void ScriptEditor::_menu_option(int p_option) { RES resource = current->get_edited_resource(); Ref text_file = resource; + Ref