diff --git a/modules/gdscript/gd_editor.cpp b/modules/gdscript/gd_editor.cpp index 7bec0ebd912..41caaa0ddd0 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()) { - - _parse_completion_variant(global_array[E->get()],r_options,indices.front()->next()); - - return OK; - } - } else { - r_options->push_back(E->key()); - } - } -#endif return OK; } +#else + +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 { diff --git a/modules/gdscript/gd_parser.cpp b/modules/gdscript/gd_parser.cpp index 1c46a2f4fa0..f727512ff55 100644 --- a/modules/gdscript/gd_parser.cpp +++ b/modules/gdscript/gd_parser.cpp @@ -374,7 +374,7 @@ GDParser::Node* GDParser::_parse_expression(Node *p_parent,bool p_static,bool p_ completion_built_in_constant=bi_type; } - if (identifier!=StringName()) { + if (identifier==StringName()) { _set_error("Built-in type constant expected after '.'"); return NULL;