Skip to content

Commit

Permalink
Autocompletion: Analyze CLASS types as they are encountered
Browse files Browse the repository at this point in the history
  • Loading branch information
HolonProduction committed May 7, 2024
1 parent 86bf835 commit d131064
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions modules/gdscript/gdscript_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<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()) {
Expand Down

0 comments on commit d131064

Please sign in to comment.