Fix enums without class name not opening docs page

This commit is contained in:
Peter Folkins 2018-04-26 13:16:00 -05:00
parent e5a13e2626
commit ccd986f53e
1 changed files with 12 additions and 0 deletions

View File

@ -2641,6 +2641,18 @@ Error GDScriptLanguage::lookup_code(const String &p_code, const String &p_symbol
context.function = p.get_completion_function(); context.function = p.get_completion_function();
context.base = p_owner; context.base = p_owner;
context.base_path = p_base_path; 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; bool isfunction = false;
switch (p.get_completion_type()) { switch (p.get_completion_type()) {