diff options
author | Rémi Verschelde <remi@verschelde.fr> | 2022-05-12 16:36:40 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-12 16:36:40 +0200 |
commit | a38aafca3e25a5a2b7da497f0dd4baa9d5423605 (patch) | |
tree | 2f0a1fe2d8c75e731800656ccd2697ddd2889819 /modules | |
parent | ea9064c01f27351369c5c89d2c320ab051c47802 (diff) | |
parent | a439832035a0a07426b4557b4286b2e2e4992054 (diff) |
Merge pull request #60970 from Chaosus/gds_fix_signal_completion
Diffstat (limited to 'modules')
-rw-r--r-- | modules/gdscript/gdscript_editor.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/modules/gdscript/gdscript_editor.cpp b/modules/gdscript/gdscript_editor.cpp index 7021f0aa1e..226b4c24b1 100644 --- a/modules/gdscript/gdscript_editor.cpp +++ b/modules/gdscript/gdscript_editor.cpp @@ -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; |