From ba0db95909a232e3f4d694294f077c9460ef00ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Wed, 17 Jun 2020 15:06:13 +0200 Subject: [PATCH] DocData: Skip language-specific ClassDoc without methods/constants Removes the useless `@C#`, `@NativeScript` and `@VisualScript` entries. --- doc/classes/@GlobalScope.xml | 3 +++ doc/classes/InputMap.xml | 18 +++++++++--------- doc/classes/OS.xml | 14 -------------- doc/classes/RenderingServer.xml | 10 +++++----- editor/doc_data.cpp | 17 +++++++++++++---- modules/gdnative/config.py | 1 - modules/gdnative/doc_classes/@NativeScript.xml | 13 ------------- modules/mono/config.py | 1 - modules/mono/doc_classes/@C#.xml | 13 ------------- modules/visual_script/config.py | 1 - .../doc_classes/@VisualScript.xml | 15 --------------- 11 files changed, 30 insertions(+), 76 deletions(-) delete mode 100644 modules/gdnative/doc_classes/@NativeScript.xml delete mode 100644 modules/mono/doc_classes/@C#.xml delete mode 100644 modules/visual_script/doc_classes/@VisualScript.xml diff --git a/doc/classes/@GlobalScope.xml b/doc/classes/@GlobalScope.xml index 41811a48b15..9a28a0d0852 100644 --- a/doc/classes/@GlobalScope.xml +++ b/doc/classes/@GlobalScope.xml @@ -33,6 +33,9 @@ The [Geometry3D] singleton. + + The [GodotSharp] singleton. + The [IP] singleton. diff --git a/doc/classes/InputMap.xml b/doc/classes/InputMap.xml index 842c69de27d..03212538c92 100644 --- a/doc/classes/InputMap.xml +++ b/doc/classes/InputMap.xml @@ -41,6 +41,15 @@ Removes all events from an action. + + + + + + + Returns an array of [InputEvent]s associated with a given action. + + @@ -95,15 +104,6 @@ Returns [code]true[/code] if the given event is part of an existing action. This method ignores keyboard modifiers if the given [InputEvent] is not pressed (for proper release detection). See [method action_has_event] if you don't want this behavior. - - - - - - - Returns an array of [InputEvent]s associated with a given action. - - diff --git a/doc/classes/OS.xml b/doc/classes/OS.xml index b131d2728c6..23473290c7b 100644 --- a/doc/classes/OS.xml +++ b/doc/classes/OS.xml @@ -254,20 +254,6 @@ [b]Note:[/b] This method is implemented on Android, Linux, macOS and Windows. - - - - - Returns the epoch time of the operating system in milliseconds. - - - - - - - Returns the epoch time of the operating system in seconds. - - diff --git a/doc/classes/RenderingServer.xml b/doc/classes/RenderingServer.xml index 516a16e053a..8832c0ec4dd 100644 --- a/doc/classes/RenderingServer.xml +++ b/doc/classes/RenderingServer.xml @@ -17,11 +17,6 @@ https://docs.godotengine.org/en/latest/tutorials/optimization/using_servers.html - - - If [code]false[/code], disables rendering completely, but the engine logic is still being processed. You can call [method force_draw] to draw a frame even with rendering disabled. - - @@ -3014,6 +3009,11 @@ + + + If [code]false[/code], disables rendering completely, but the engine logic is still being processed. You can call [method force_draw] to draw a frame even with rendering disabled. + + diff --git a/editor/doc_data.cpp b/editor/doc_data.cpp index c52d91b03db..54acbe9559a 100644 --- a/editor/doc_data.cpp +++ b/editor/doc_data.cpp @@ -662,18 +662,19 @@ void DocData::generate(bool p_basic_types) { } } - //built in script reference + // Built-in script reference. + // We only add a doc entry for languages which actually define any built-in + // methods or constants. { for (int i = 0; i < ScriptServer::get_language_count(); i++) { ScriptLanguage *lang = ScriptServer::get_language(i); String cname = "@" + lang->get_name(); - class_list[cname] = ClassDoc(); - ClassDoc &c = class_list[cname]; + ClassDoc c; c.name = cname; + // Get functions. List minfo; - lang->get_public_functions(&minfo); for (List::Element *E = minfo.front(); E; E = E->next()) { @@ -706,6 +707,7 @@ void DocData::generate(bool p_basic_types) { c.methods.push_back(md); } + // Get constants. List> cinfo; lang->get_public_constants(&cinfo); @@ -715,6 +717,13 @@ void DocData::generate(bool p_basic_types) { cd.value = E->get().second; c.constants.push_back(cd); } + + // Skip adding the lang if it doesn't expose anything (e.g. C#). + if (c.methods.empty() && c.constants.empty()) { + continue; + } + + class_list[cname] = c; } } } diff --git a/modules/gdnative/config.py b/modules/gdnative/config.py index 4b997e4bfe3..7603e7d69de 100644 --- a/modules/gdnative/config.py +++ b/modules/gdnative/config.py @@ -8,7 +8,6 @@ def configure(env): def get_doc_classes(): return [ - "@NativeScript", "XRInterfaceGDNative", "GDNative", "GDNativeLibrary", diff --git a/modules/gdnative/doc_classes/@NativeScript.xml b/modules/gdnative/doc_classes/@NativeScript.xml deleted file mode 100644 index 809b225e210..00000000000 --- a/modules/gdnative/doc_classes/@NativeScript.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/modules/mono/config.py b/modules/mono/config.py index 7980a86cb33..cd659057ef6 100644 --- a/modules/mono/config.py +++ b/modules/mono/config.py @@ -57,7 +57,6 @@ def configure(env): def get_doc_classes(): return [ - "@C#", "CSharpScript", "GodotSharp", ] diff --git a/modules/mono/doc_classes/@C#.xml b/modules/mono/doc_classes/@C#.xml deleted file mode 100644 index 83a7fbf02c6..00000000000 --- a/modules/mono/doc_classes/@C#.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/modules/visual_script/config.py b/modules/visual_script/config.py index bd459ca3449..b15479797c1 100644 --- a/modules/visual_script/config.py +++ b/modules/visual_script/config.py @@ -8,7 +8,6 @@ def configure(env): def get_doc_classes(): return [ - "@VisualScript", "VisualScriptBasicTypeConstant", "VisualScriptBuiltinFunc", "VisualScriptClassConstant", diff --git a/modules/visual_script/doc_classes/@VisualScript.xml b/modules/visual_script/doc_classes/@VisualScript.xml deleted file mode 100644 index a2b966bfbba..00000000000 --- a/modules/visual_script/doc_classes/@VisualScript.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - Built-in visual script functions. - - - A list of built-in visual script functions, see [VisualScriptBuiltinFunc] and [VisualScript]. - - - - - - - -