From 0202a36a7a0eb76dec9814728e30e00074dc7bb2 Mon Sep 17 00:00:00 2001 From: BooksBaum <15612932+Booksbaum@users.noreply.github.com> Date: Fri, 28 Jul 2023 17:06:08 +0200 Subject: 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> --- modules/gdscript/gdscript_editor.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'modules/gdscript/gdscript_editor.cpp') diff --git a/modules/gdscript/gdscript_editor.cpp b/modules/gdscript/gdscript_editor.cpp index 6cad3b2b90..5e626f0520 100644 --- a/modules/gdscript/gdscript_editor.cpp +++ b/modules/gdscript/gdscript_editor.cpp @@ -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 { -- cgit v1.2.3