From 9a0a40042e5dda31889f4a6b6f66ac6d49636bce Mon Sep 17 00:00:00 2001 From: Anish Date: Mon, 30 Apr 2018 20:54:03 +0530 Subject: [PATCH] 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 6e32157a65b208ba223c8e75c5e7a842d1684314) --- modules/gdscript/gdscript_editor.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/modules/gdscript/gdscript_editor.cpp b/modules/gdscript/gdscript_editor.cpp index c675e611c9d..3c6da1922fa 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 reserved_words; + GDScriptLanguage::get_singleton()->get_reserved_words(&reserved_words); + + for (List::Element *E = reserved_words.front(); E; E = E->next()) { + result.insert(E->get()); + } + //autoload singletons List props; ProjectSettings::get_singleton()->get_property_list(&props);