Improved go-to definition (Ctrl + Click)

Co-Authored-By: Bojidar Marinov <bojidar.marinov.bg@gmail.com>
This commit is contained in:
janglee 2020-03-28 13:42:19 +05:30
parent 20edf69f96
commit be7a353c70
6 changed files with 64 additions and 3 deletions

View file

@ -1425,6 +1425,7 @@ static bool _guess_identifier_type_from_base(GDScriptCompletionContext &p_contex
// Variable used in the same expression
return false;
}
if (_guess_expression_type(p_context, m.expression, r_type)) {
return true;
}
@ -3485,6 +3486,17 @@ Error GDScriptLanguage::lookup_code(const String &p_code, const String &p_symbol
return OK;
}
} break;
case GDScriptParser::COMPLETION_TYPE_HINT: {
GDScriptParser::DataType base_type = context._class->base_type;
base_type.has_type = true;
base_type.kind = GDScriptParser::DataType::CLASS;
base_type.class_type = const_cast<GDScriptParser::ClassNode *>(context._class);
if (_lookup_symbol_from_base(base_type, p_symbol, false, r_result) == OK) {
return OK;
}
} break;
default: {
}
}