summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2024-07-08 11:48:17 +0200
committerRémi Verschelde <rverschelde@gmail.com>2024-07-08 11:48:17 +0200
commit88296701fbfe675b64cb3b3dc192ce09bc5049af (patch)
treecdfeb1236535ced8703fd1079ac00fcca94c8453
parente1a145bb3c0128a52c61104131b2f240142b39c5 (diff)
parent70488d40db9a98357f5d147ebc8ceb4e5f642a44 (diff)
downloadredot-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.cpp13
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.