ソースを参照

Adds keywords to autocomplete predictions.

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

Fixes: #5972
Anish 7 年 前
コミット
6e32157a65
1 ファイル変更7 行追加0 行削除
  1. 7 0
      modules/gdscript/gdscript_editor.cpp

+ 7 - 0
modules/gdscript/gdscript_editor.cpp

@@ -1521,6 +1521,13 @@ static void _find_identifiers(GDScriptCompletionContext &context, int p_line, bo
 		result.insert(_type_names[i]);
 		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
 	//autoload singletons
 	List<PropertyInfo> props;
 	List<PropertyInfo> props;
 	ProjectSettings::get_singleton()->get_property_list(&props);
 	ProjectSettings::get_singleton()->get_property_list(&props);