diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-07-07 00:12:59 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-07 00:12:59 +0200 |
commit | b96b0d90d7f433c576067305c889ebb2f1dc11be (patch) | |
tree | 89ad4f815b20f78a66e11fdac48379ccca98a5a9 /modules | |
parent | b8b634d2e6effeea85f832451d8deff57b62df66 (diff) | |
parent | 965436554721a344e8a1aa4873a6d01ebea1043d (diff) |
Merge pull request #40162 from vnen/autoloads-list
Add a map of autoloads to ProjectSettings
Diffstat (limited to 'modules')
-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))); } } |