Merge pull request #28122 from mrcdk/show_get_property_list_in_completion

When triggering completion show all the properties added with _get_property_list()
This commit is contained in:
Rémi Verschelde 2019-09-03 18:34:38 +02:00 committed by GitHub
commit 86c930998b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1936,9 +1936,18 @@ static void _find_identifiers_in_base(const GDScriptCompletionContext &p_context
Ref<GDScript> script = base_type.script_type; Ref<GDScript> script = base_type.script_type;
if (script.is_valid()) { if (script.is_valid()) {
if (!_static && !p_only_functions) { if (!_static && !p_only_functions) {
for (const Set<StringName>::Element *E = script->get_members().front(); E; E = E->next()) { if (p_context.base && p_context.base->get_script_instance()) {
ScriptCodeCompletionOption option(E->get().operator String(), ScriptCodeCompletionOption::KIND_MEMBER); List<PropertyInfo> members;
r_result.insert(option.display, option); p_context.base->get_script_instance()->get_property_list(&members);
for (List<PropertyInfo>::Element *E = members.front(); E; E = E->next()) {
ScriptCodeCompletionOption option(E->get().name, ScriptCodeCompletionOption::KIND_MEMBER);
r_result.insert(option.display, option);
}
} else {
for (const Set<StringName>::Element *E = script->get_members().front(); E; E = E->next()) {
ScriptCodeCompletionOption option(E->get().operator String(), ScriptCodeCompletionOption::KIND_MEMBER);
r_result.insert(option.display, option);
}
} }
} }
if (!p_only_functions) { if (!p_only_functions) {