瀏覽代碼

GDScript: Fix autocomplete inside a block with a type test condition

(cherry picked from commit e289a4ab2c404991d684b6c77b65d24f41be5b63)
Dmitrii Maganov 2 年之前
父節點
當前提交
23f2c1234c
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      modules/gdscript/gdscript_editor.cpp

+ 1 - 1
modules/gdscript/gdscript_editor.cpp

@@ -1956,7 +1956,7 @@ static bool _guess_identifier_type(GDScriptParser::CompletionContext &p_context,
 				GDScriptParser::CompletionContext c = p_context;
 				c.current_line = type_test->operand->start_line;
 				c.current_suite = suite;
-				if ((!id_type.is_set() || id_type.is_variant()) && type_test->test_datatype.is_hard_type()) {
+				if (type_test->test_datatype.is_hard_type()) {
 					id_type = type_test->test_datatype;
 					if (last_assign_line < c.current_line) {
 						// Override last assignment.