Skip to content

Commit

Permalink
Merge pull request #93815 from HolonProduction/comletion-variant-lookup
Browse files Browse the repository at this point in the history
Autocompletion: Don't use `in` operator to decide over variant lookup
  • Loading branch information
akien-mga committed Jul 8, 2024
2 parents e1a145b + 70488d4 commit 8829670
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions modules/gdscript/gdscript_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1959,11 +1959,14 @@ static bool _guess_expression_type(GDScriptParser::CompletionContext &p_context,
break;
}

if (base.value.in(index.value)) {
Variant value = base.value.get(index.value);
r_type = _type_from_variant(value, p_context);
found = true;
break;
{
bool valid;
Variant value = base.value.get(index.value, &valid);
if (valid) {
r_type = _type_from_variant(value, p_context);
found = true;
break;
}
}

// Look if it is a dictionary node.
Expand Down

0 comments on commit 8829670

Please sign in to comment.