summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2019-09-03 18:34:38 +0200
committerGitHub <noreply@github.com>2019-09-03 18:34:38 +0200
commit86c930998bc5620edb04df492117aa6f5e410a2e (patch)
treebc7d4d0ee79334d2d4833b6e73509dab0085cf0a
parenta00a9e868ee6c27adf90bdf2349a4fd9616ffa54 (diff)
parent9e9c16c1e5c497f03235d7bef064e759a2ae813a (diff)
Merge pull request #28122 from mrcdk/show_get_property_list_in_completion
When triggering completion show all the properties added with _get_property_list()
-rw-r--r--modules/gdscript/gdscript_editor.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/modules/gdscript/gdscript_editor.cpp b/modules/gdscript/gdscript_editor.cpp
index 925dbda620..b4c38e4d40 100644
--- a/modules/gdscript/gdscript_editor.cpp
+++ b/modules/gdscript/gdscript_editor.cpp
@@ -1936,9 +1936,18 @@ static void _find_identifiers_in_base(const GDScriptCompletionContext &p_context
Ref<GDScript> script = base_type.script_type;
if (script.is_valid()) {
if (!_static && !p_only_functions) {
- 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_context.base && p_context.base->get_script_instance()) {
+ List<PropertyInfo> members;
+ 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) {