From 965436554721a344e8a1aa4873a6d01ebea1043d Mon Sep 17 00:00:00 2001 From: George Marques Date: Wed, 17 Jun 2020 20:45:08 -0300 Subject: Add a map of autoloads to ProjectSettings So places that need to look into it can use the list instead of parsing ProjectSettings details (like checking "*" in path for testing if it's singleton). --- modules/mono/editor/code_completion.cpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'modules/mono/editor/code_completion.cpp') diff --git a/modules/mono/editor/code_completion.cpp b/modules/mono/editor/code_completion.cpp index df1547607d..942c6d26a6 100644 --- a/modules/mono/editor/code_completion.cpp +++ b/modules/mono/editor/code_completion.cpp @@ -123,16 +123,11 @@ PackedStringArray get_code_completion(CompletionKind p_kind, const String &p_scr case CompletionKind::NODE_PATHS: { { // AutoLoads - List props; - ProjectSettings::get_singleton()->get_property_list(&props); + Map autoloads = ProjectSettings::get_singleton()->get_autoload_list(); - for (List::Element *E = props.front(); E; E = E->next()) { - String s = E->get().name; - if (!s.begins_with("autoload/")) { - continue; - } - String name = s.get_slice("/", 1); - suggestions.push_back(quoted("/root/" + name)); + for (Map::Element *E = autoloads.front(); E; E = E->next()) { + const ProjectSettings::AutoloadInfo &info = E->value(); + suggestions.push_back(quoted("/root/" + String(info.name))); } } -- cgit v1.2.3