浏览代码

Fix: Ctrl + Click not working for subclasses

(cherry picked from commit 95b0a00d2cd282a50c2d7f3a638b7ccfd8648947)
Thakee Nathees 5 年之前
父节点
当前提交
438f1a8238
共有 1 个文件被更改,包括 8 次插入0 次删除
  1. 8 0
      modules/gdscript/gdscript_editor.cpp

+ 8 - 0
modules/gdscript/gdscript_editor.cpp

@@ -3117,6 +3117,14 @@ static Error _lookup_symbol_from_base(const GDScriptParser::DataType &p_base, co
 								return OK;
 								return OK;
 							}
 							}
 						}
 						}
+
+						for (int i = 0; i < base_type.class_type->subclasses.size(); i++) {
+							if (base_type.class_type->subclasses[i]->name == p_symbol) {
+								r_result.type = ScriptLanguage::LookupResult::RESULT_SCRIPT_LOCATION;
+								r_result.location = base_type.class_type->subclasses[i]->line;
+								return OK;
+							}
+						}
 					}
 					}
 					base_type = base_type.class_type->base_type;
 					base_type = base_type.class_type->base_type;
 				}
 				}