Merge pull request #91653 from HolonProduction/autocompletion-analyze-recursively-but-leave-the-parser-alone

Autocompletion: Analyze CLASS types as they are encountered
This commit is contained in:
Rémi Verschelde 2024-05-19 11:21:11 +02:00
commit 4ce95d684c
No known key found for this signature in database
GPG Key ID: C3336907360768E1
1 changed files with 6 additions and 0 deletions

View File

@ -2088,6 +2088,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<GDScriptParserRef> 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()) {