From d13106484158b56e3f1843f4a706e6f213d47f42 Mon Sep 17 00:00:00 2001 From: HolonProduction Date: Tue, 7 May 2024 10:45:28 +0200 Subject: [PATCH] Autocompletion: Analyze CLASS types as they are encountered --- modules/gdscript/gdscript_editor.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/gdscript/gdscript_editor.cpp b/modules/gdscript/gdscript_editor.cpp index 74d383c57f93..76d121af3750 100644 --- a/modules/gdscript/gdscript_editor.cpp +++ b/modules/gdscript/gdscript_editor.cpp @@ -2064,6 +2064,12 @@ static bool _guess_expression_type(GDScriptParser::CompletionContext &p_context, found = false; } + // If the found type was not fully analyzed we analyze it now. + if (found && r_type.type.kind == GDScriptParser::DataType::CLASS && !r_type.type.class_type->resolved_body) { + Error err; + Ref r = GDScriptCache::get_parser(r_type.type.script_path, GDScriptParserRef::FULLY_SOLVED, err); + } + // Check type hint last. For collections we want chance to get the actual value first // This way we can detect types from the content of dictionaries and arrays if (!found && p_expression->get_datatype().is_hard_type()) {