diff options
author | George Marques <george@gmarqu.es> | 2020-06-17 20:45:08 -0300 |
---|---|---|
committer | George Marques <george@gmarqu.es> | 2020-07-06 12:35:51 -0300 |
commit | 965436554721a344e8a1aa4873a6d01ebea1043d (patch) | |
tree | f972b2ac9fe722e78c75ef8181a58bb9499416b8 /modules/mono/editor/code_completion.cpp | |
parent | a535b9160dbbcfad1884ff4a147672a0eb366a9d (diff) |
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).
Diffstat (limited to 'modules/mono/editor/code_completion.cpp')
-rw-r--r-- | modules/mono/editor/code_completion.cpp | 13 |
1 files changed, 4 insertions, 9 deletions
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<PropertyInfo> props; - ProjectSettings::get_singleton()->get_property_list(&props); + Map<StringName, ProjectSettings::AutoloadInfo> autoloads = ProjectSettings::get_singleton()->get_autoload_list(); - for (List<PropertyInfo>::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<StringName, ProjectSettings::AutoloadInfo>::Element *E = autoloads.front(); E; E = E->next()) { + const ProjectSettings::AutoloadInfo &info = E->value(); + suggestions.push_back(quoted("/root/" + String(info.name))); } } |