summaryrefslogtreecommitdiff
path: root/modules/gdscript
diff options
context:
space:
mode:
authorAnish <anishbhobe@hotmail.com>2018-04-30 20:54:03 +0530
committerAnish <anishbhobe@hotmail.com>2018-05-01 11:48:16 +0530
commit6e32157a65b208ba223c8e75c5e7a842d1684314 (patch)
tree81123df8142d3bd886b5f43e302b22a0aec965f5 /modules/gdscript
parent613a8bee415381a8564d34092b479e1f159e8e60 (diff)
Adds keywords to autocomplete predictions.
Adds keywords to the autocomplete prediction in GDScript so they are not replaced by irrelevant predictions. Fixes: #5972
Diffstat (limited to 'modules/gdscript')
-rw-r--r--modules/gdscript/gdscript_editor.cpp7
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);