Language Server: Improve hovered symbol resolution, fix renaming bugs, implement reference lookup

Co-Authored-By: Ryan Brue <56272643+ryanabx@users.noreply.github.com>
Co-Authored-By: BooksBaum <15612932+booksbaum@users.noreply.github.com>
This commit is contained in:
BooksBaum 2023-07-28 17:06:08 +02:00 committed by ryanabx
parent 221884e6bc
commit 0202a36a7a
18 changed files with 1661 additions and 360 deletions

View file

@ -1459,8 +1459,13 @@ static bool _guess_expression_type(GDScriptParser::CompletionContext &p_context,
if (p_expression->is_constant) {
// Already has a value, so just use that.
r_type = _type_from_variant(p_expression->reduced_value);
if (p_expression->get_datatype().kind == GDScriptParser::DataType::ENUM) {
r_type.type = p_expression->get_datatype();
switch (p_expression->get_datatype().kind) {
case GDScriptParser::DataType::ENUM:
case GDScriptParser::DataType::CLASS:
r_type.type = p_expression->get_datatype();
break;
default:
break;
}
found = true;
} else {