From 2dd302ff906285c5fdcb5f7bc822eb786870327a Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Tue, 16 Dec 2014 23:17:35 -0300 Subject: -fix compilation issue -fix missing built-ins in completion -fix parse error --- modules/gdscript/gd_editor.cpp | 52 ++++++++++++++++-------------------------- 1 file changed, 20 insertions(+), 32 deletions(-) (limited to 'modules/gdscript/gd_editor.cpp') diff --git a/modules/gdscript/gd_editor.cpp b/modules/gdscript/gd_editor.cpp index 7bec0ebd9..41caaa0dd 100644 --- a/modules/gdscript/gd_editor.cpp +++ b/modules/gdscript/gd_editor.cpp @@ -312,6 +312,7 @@ String GDScriptLanguage::make_function(const String& p_class,const String& p_nam } +#if defined(DEBUG_METHODS_ENABLED) && defined(TOOLS_ENABLED) struct GDCompletionIdentifier { @@ -1011,7 +1012,7 @@ static bool _guess_identifier_type(GDCompletionContext& context,int p_line,const } } - //globals + for(Map::Element *E=GDScriptLanguage::get_singleton()->get_global_map().front();E;E=E->next()) { if (E->key()==p_identifier) { @@ -1081,6 +1082,8 @@ static void _find_identifiers_in_class(GDCompletionContext& context,bool p_stati } } + //globals + Ref base = _get_parent_class(context); while(true) { @@ -1178,6 +1181,15 @@ static void _find_identifiers(GDCompletionContext& context,int p_line,bool p_onl result.insert(GDFunctions::get_func_name(GDFunctions::Function(i))); } + static const char*_type_names[Variant::VARIANT_MAX]={ + "null","bool","int","float","String","Vector2","Rect2","Vector3","Matrix32","Plane","Quat","AABB","Matrix3","Trasnform", + "Color","Image","NodePath","RID","Object","InputEvent","Dictionary","Array","RawArray","IntArray","FloatArray","StringArray", + "Vector2Array","Vector3Array","ColorArray"}; + + for(int i=0;i::Element *E=GDScriptLanguage::get_singleton()->get_global_map().front();E;E=E->next()) { result.insert(E->key().operator String()); } @@ -1286,6 +1298,7 @@ static void _find_type_arguments(const GDParser::Node*p_node,int p_line,const St } arghint = _get_visual_datatype(m->get_argument_info(-1))+" "+p_method.operator String()+String("("); + for(int i=0;iget_argument_count();i++) { if (i>0) arghint+=", "; @@ -1729,43 +1742,18 @@ Error GDScriptLanguage::complete_code(const String& p_code, const String& p_base for(Set::Element *E=options.front();E;E=E->next()) { r_options->push_back(E->get()); } -#if 0 - // don't care much about error I guess - const GDParser::Node* root = p.get_parse_tree(); - ERR_FAIL_COND_V(root->type!=GDParser::Node::TYPE_CLASS,ERR_INVALID_DATA); - - print_line("BASE: "+p_base); - const GDParser::ClassNode *cl = static_cast(root); - - List indices; - Vector spl = p_base.split("."); - - for(int i=0;i::Element *E=globals.front();E;E=E->next()) { - if (!indices.empty()) { - if (String(E->key())==indices.front()->get()) { + return OK; +} - _parse_completion_variant(global_array[E->get()],r_options,indices.front()->next()); +#else - return OK; - } - } else { - r_options->push_back(E->key()); - } - } -#endif +Error GDScriptLanguage::complete_code(const String& p_code, const String& p_base_path, Object*p_owner, List* r_options, String &r_call_hint) { return OK; } +#endif + void GDScriptLanguage::auto_indent_code(String& p_code,int p_from_line,int p_to_line) const { -- cgit v1.2.3-70-g09d2