Adds keywords to autocomplete predictions.

Adds keywords to the autocomplete prediction in GDScript so
they are not replaced by irrelevant predictions.

Fixes: #5972
(cherry picked from commit 6e32157a65)
This commit is contained in:
Anish 2018-04-30 20:54:03 +05:30 committed by Hein-Pieter van Braam
parent 09277c8fd8
commit 9a0a40042e
1 changed files with 7 additions and 0 deletions

View File

@ -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);