diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2024-07-08 11:48:17 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2024-07-08 11:48:17 +0200 |
commit | 88296701fbfe675b64cb3b3dc192ce09bc5049af (patch) | |
tree | cdfeb1236535ced8703fd1079ac00fcca94c8453 | |
parent | e1a145bb3c0128a52c61104131b2f240142b39c5 (diff) | |
parent | 70488d40db9a98357f5d147ebc8ceb4e5f642a44 (diff) | |
download | redot-engine-88296701fbfe675b64cb3b3dc192ce09bc5049af.tar.gz |
Merge pull request #93815 from HolonProduction/comletion-variant-lookup
Autocompletion: Don't use `in` operator to decide over variant lookup
-rw-r--r-- | modules/gdscript/gdscript_editor.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/modules/gdscript/gdscript_editor.cpp b/modules/gdscript/gdscript_editor.cpp index f557727718..b58b44973e 100644 --- a/modules/gdscript/gdscript_editor.cpp +++ b/modules/gdscript/gdscript_editor.cpp @@ -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. |