From 3a827349bfe5cd9bc9b5b76b63fc1132b4a82eda Mon Sep 17 00:00:00 2001 From: cdemirer <41021322+cdemirer@users.noreply.github.com> Date: Mon, 4 Jul 2022 10:08:41 +0300 Subject: [PATCH] Fix autocomplete for variable which is assigned to in the current statement --- modules/gdscript/gdscript_editor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/gdscript/gdscript_editor.cpp b/modules/gdscript/gdscript_editor.cpp index 474c8094f2e..b0d2b11de6c 100644 --- a/modules/gdscript/gdscript_editor.cpp +++ b/modules/gdscript/gdscript_editor.cpp @@ -1843,7 +1843,7 @@ static bool _guess_identifier_type(GDScriptParser::CompletionContext &p_context, while (suite) { for (int i = 0; i < suite->statements.size(); i++) { - if (suite->statements[i]->start_line > p_context.current_line) { + if (suite->statements[i]->end_line >= p_context.current_line) { break; }