summaryrefslogtreecommitdiffstats
path: root/modules/gdscript/gd_editor.cpp
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2016-08-06 22:11:03 -0300
committerJuan Linietsky <reduzio@gmail.com>2016-08-06 22:11:03 -0300
commit6671c6bdc78864bbe1d27c508ec9528f3b683ca2 (patch)
tree5363b49c0aab2cd1cfb6a198b7f5e9a9e79c80ec /modules/gdscript/gd_editor.cpp
parent3d7c10e9ceda7d57a2df0461e6f9b6c81c052f1d (diff)
downloadredot-engine-6671c6bdc78864bbe1d27c508ec9528f3b683ca2.tar.gz
Added yield() signal smart autocompletion.
Diffstat (limited to 'modules/gdscript/gd_editor.cpp')
-rw-r--r--modules/gdscript/gd_editor.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/modules/gdscript/gd_editor.cpp b/modules/gdscript/gd_editor.cpp
index 48f747ada9..2e5fb82f37 100644
--- a/modules/gdscript/gd_editor.cpp
+++ b/modules/gdscript/gd_editor.cpp
@@ -2389,7 +2389,24 @@ Error GDScriptLanguage::complete_code(const String& p_code, const String& p_base
}
}
} break;
+ case GDParser::COMPLETION_YIELD: {
+ const GDParser::Node *node = p.get_completion_node();
+
+ GDCompletionIdentifier t;
+ if (!_guess_expression_type(context,node,p.get_completion_line(),t))
+ break;
+
+ if (t.type==Variant::OBJECT && t.obj_type!=StringName()) {
+
+ List<MethodInfo> sigs;
+ ObjectTypeDB::get_signal_list(t.obj_type,&sigs);
+ for (List<MethodInfo>::Element *E=sigs.front();E;E=E->next()) {
+ options.insert("\""+E->get().name+"\"");
+ }
+ }
+
+ } break;
}