aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémi Verschelde2017-11-09 09:55:02 +0100
committerGitHub2017-11-09 09:55:02 +0100
commit355c8fd968fbedcc52bcf57bf33bf3536cbfbdeb (patch)
treec078a56133685c73a55200f3bd8c9bc91a1afa62
parent7e0e415d4628cc7ba6b2efc52836a6a9e79cc6f0 (diff)
parentb7fd065f5c067c80a59433ac0a214899ce5bfbac (diff)
downloadgodot-355c8fd968fbedcc52bcf57bf33bf3536cbfbdeb.tar.gz
godot-355c8fd968fbedcc52bcf57bf33bf3536cbfbdeb.tar.zst
godot-355c8fd968fbedcc52bcf57bf33bf3536cbfbdeb.zip
-rw-r--r--modules/gdscript/gd_editor.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/modules/gdscript/gd_editor.cpp b/modules/gdscript/gd_editor.cpp
index d9b10ff3f..de8e35c40 100644
--- a/modules/gdscript/gd_editor.cpp
+++ b/modules/gdscript/gd_editor.cpp
@@ -1060,7 +1060,7 @@ static bool _guess_identifier_type_in_block(GDCompletionContext &context, int p_
}
//use the last assignment, (then backwards?)
- if (last_assign) {
+ if (last_assign && last_assign_line != p_line) {
return _guess_expression_type(context, last_assign, last_assign_line, r_type);
}
@@ -1194,6 +1194,8 @@ static bool _guess_identifier_type(GDCompletionContext &context, int p_line, con
r_type = _get_type_from_pinfo(context._class->variables[i]._export);
return true;
} else if (context._class->variables[i].expression) {
+ if (p_line <= context._class->variables[i].line)
+ return false;
bool rtype = _guess_expression_type(context, context._class->variables[i].expression, context._class->variables[i].line, r_type);
if (rtype && r_type.type != Variant::NIL)