diff options
author | Anish <anishbhobe@hotmail.com> | 2018-04-30 20:54:03 +0530 |
---|---|---|
committer | Anish <anishbhobe@hotmail.com> | 2018-05-01 11:48:16 +0530 |
commit | 6e32157a65b208ba223c8e75c5e7a842d1684314 (patch) | |
tree | 81123df8142d3bd886b5f43e302b22a0aec965f5 | |
parent | 613a8bee415381a8564d34092b479e1f159e8e60 (diff) |
Adds keywords to autocomplete predictions.
Adds keywords to the autocomplete prediction in GDScript so
they are not replaced by irrelevant predictions.
Fixes: #5972
-rw-r--r-- | modules/gdscript/gdscript_editor.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/modules/gdscript/gdscript_editor.cpp b/modules/gdscript/gdscript_editor.cpp index 0d52f0a995..f698057744 100644 --- a/modules/gdscript/gdscript_editor.cpp +++ b/modules/gdscript/gdscript_editor.cpp @@ -1521,6 +1521,13 @@ static void _find_identifiers(GDScriptCompletionContext &context, int p_line, bo result.insert(_type_names[i]); } + List<String> reserved_words; + GDScriptLanguage::get_singleton()->get_reserved_words(&reserved_words); + + for (List<String>::Element *E = reserved_words.front(); E; E = E->next()) { + result.insert(E->get()); + } + //autoload singletons List<PropertyInfo> props; ProjectSettings::get_singleton()->get_property_list(&props); |