From 8963ca3d17ff6e1340cb5c2eb88a6485ec422a64 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Sun, 8 Jan 2017 03:01:52 -0300 Subject: Fix code completion for new getnode syntax --- modules/gdscript/gd_editor.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'modules/gdscript/gd_editor.cpp') diff --git a/modules/gdscript/gd_editor.cpp b/modules/gdscript/gd_editor.cpp index fbd81a61bf..ebb753d129 100644 --- a/modules/gdscript/gd_editor.cpp +++ b/modules/gdscript/gd_editor.cpp @@ -2154,6 +2154,27 @@ Error GDScriptLanguage::complete_code(const String& p_code, const String& p_base } break; case GDParser::COMPLETION_PARENT_FUNCTION: { + } break; + case GDParser::COMPLETION_GET_NODE: { + + if (p_owner) { + List opts; + p_owner->get_argument_options("get_node",0,&opts); + + for (List::Element *E=opts.front();E;E=E->next()) { + + String opt = E->get().strip_edges(); + if (opt.begins_with("\"") && opt.ends_with("\"")) { + String idopt=opt.substr(1,opt.length()-2); + if (idopt.replace("/","_").is_valid_identifier()) { + options.insert(idopt); + } else { + options.insert(opt); + } + } + } + + } } break; case GDParser::COMPLETION_METHOD: isfunction=true; -- cgit v1.2.3