You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
Fix signal completion in GDScript editor
This commit is contained in:
@@ -1057,6 +1057,14 @@ static void _find_identifiers_in_base(const GDScriptCompletionIdentifier &p_base
|
||||
r_result.insert(option.display, option);
|
||||
}
|
||||
|
||||
List<MethodInfo> signals;
|
||||
ClassDB::get_signal_list(type, &signals);
|
||||
for (const MethodInfo &E : signals) {
|
||||
int location = p_recursion_depth + _get_signal_location(type, StringName(E.name));
|
||||
ScriptLanguage::CodeCompletionOption option(E.name, ScriptLanguage::CODE_COMPLETION_KIND_SIGNAL, location);
|
||||
r_result.insert(option.display, option);
|
||||
}
|
||||
|
||||
if (!_static || Engine::get_singleton()->has_singleton(type)) {
|
||||
List<PropertyInfo> pinfo;
|
||||
ClassDB::get_property_list(type, &pinfo);
|
||||
@@ -3058,6 +3066,13 @@ static Error _lookup_symbol_from_base(const GDScriptParser::DataType &p_base, co
|
||||
}
|
||||
}
|
||||
|
||||
if (ClassDB::has_signal(class_name, p_symbol, true)) {
|
||||
r_result.type = ScriptLanguage::LOOKUP_RESULT_CLASS_SIGNAL;
|
||||
r_result.class_name = base_type.native_type;
|
||||
r_result.class_member = p_symbol;
|
||||
return OK;
|
||||
}
|
||||
|
||||
StringName enum_name = ClassDB::get_integer_constant_enum(class_name, p_symbol, true);
|
||||
if (enum_name != StringName()) {
|
||||
r_result.type = ScriptLanguage::LOOKUP_RESULT_CLASS_ENUM;
|
||||
|
||||
Reference in New Issue
Block a user