diff --git a/modules/gdscript/gdscript_editor.cpp b/modules/gdscript/gdscript_editor.cpp index 8479884154e..0a1e1a22fbf 100644 --- a/modules/gdscript/gdscript_editor.cpp +++ b/modules/gdscript/gdscript_editor.cpp @@ -1855,7 +1855,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; }