summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2018-05-02 10:32:19 +0200
committerGitHub <noreply@github.com>2018-05-02 10:32:19 +0200
commitb0cf3628aa339504f0b069274cf64f6fe06bdf88 (patch)
tree92793575787ba5db1f850a3682a86df5b2b9e62e
parentfb917b55682f29deb0c3fdf4bcc86552b64bda34 (diff)
parentccd986f53e468321b9eeb09474c77cfab2c988da (diff)
Merge pull request #18452 from flashyincceo/enum-no-class
Fix enums without class name not opening docs page
-rw-r--r--modules/gdscript/gdscript_editor.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/modules/gdscript/gdscript_editor.cpp b/modules/gdscript/gdscript_editor.cpp
index db20b5450a..b38b30d4b8 100644
--- a/modules/gdscript/gdscript_editor.cpp
+++ b/modules/gdscript/gdscript_editor.cpp
@@ -2649,6 +2649,18 @@ Error GDScriptLanguage::lookup_code(const String &p_code, const String &p_symbol
context.function = p.get_completion_function();
context.base = p_owner;
context.base_path = p_base_path;
+
+ if (context._class && context._class->extends_class.size() > 0) {
+ bool success = false;
+ ClassDB::get_integer_constant(context._class->extends_class[0], p_symbol, &success);
+ if (success) {
+ r_result.type = ScriptLanguage::LookupResult::RESULT_CLASS_CONSTANT;
+ r_result.class_name = context._class->extends_class[0];
+ r_result.class_member = p_symbol;
+ return OK;
+ }
+ }
+
bool isfunction = false;
switch (p.get_completion_type()) {