1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-08 12:40:44 +00:00

Fix code completion for new getnode syntax

This commit is contained in:
Juan Linietsky
2017-01-08 03:01:52 -03:00
parent 8b912d1115
commit 8963ca3d17
4 changed files with 37 additions and 8 deletions

View File

@@ -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<String> opts;
p_owner->get_argument_options("get_node",0,&opts);
for (List<String>::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;