summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Hilbrunner <mhilbrunner@users.noreply.github.com>2021-09-07 21:05:09 +0200
committerGitHub <noreply@github.com>2021-09-07 21:05:09 +0200
commit886ad727f8bf0d2268bef589540173e2f090197e (patch)
tree17856b4e5297f5d80cfc6472c65adaaf5432443b
parent9ada29e918625c27248c301f1d45f93e7b871b72 (diff)
parentb2f858870d1e7ff9dc8c0e498be434b441748463 (diff)
Merge pull request #52267 from williamd67/lookup-symbol-builtin-functions
Show help for built-in functions (@GlobalScope)
-rw-r--r--editor/editor_help.cpp2
-rw-r--r--modules/gdscript/gdscript_editor.cpp9
2 files changed, 11 insertions, 0 deletions
diff --git a/editor/editor_help.cpp b/editor/editor_help.cpp
index 24b6ba1a14..490c8f287f 100644
--- a/editor/editor_help.cpp
+++ b/editor/editor_help.cpp
@@ -1328,6 +1328,8 @@ void EditorHelp::_help_callback(const String &p_topic) {
} else if (what == "class_global") {
if (constant_line.has(name)) {
line = constant_line[name];
+ } else if (method_line.has(name)) {
+ line = method_line[name];
} else {
Map<String, Map<String, int>>::Element *iter = enum_values_line.front();
while (true) {
diff --git a/modules/gdscript/gdscript_editor.cpp b/modules/gdscript/gdscript_editor.cpp
index 70e18c6e6c..f809a4dab8 100644
--- a/modules/gdscript/gdscript_editor.cpp
+++ b/modules/gdscript/gdscript_editor.cpp
@@ -3078,6 +3078,15 @@ static Error _lookup_symbol_from_base(const GDScriptParser::DataType &p_base, co
r_result.class_member = p_symbol;
return OK;
}
+ } else {
+ List<StringName> utility_functions;
+ Variant::get_utility_function_list(&utility_functions);
+ if (utility_functions.find(p_symbol) != nullptr) {
+ r_result.type = ScriptLanguage::LookupResult::RESULT_CLASS_TBD_GLOBALSCOPE;
+ r_result.class_name = "@GlobalScope";
+ r_result.class_member = p_symbol;
+ return OK;
+ }
}
}
} break;