Fix member scope completion with nested members

First, the search for existing type with the given scope should be done
also for namespaces.

Second, with the string operations we get no scope as empty string ""
but the rest of TM functions expect scope to be set to NULL in such
case. Fix that.
This commit is contained in:
Jiří Techet 2016-01-19 00:40:06 +01:00
parent f10747ae5a
commit c653741a3c

View File

@ -941,6 +941,7 @@ static gboolean member_at_method_scope(const GPtrArray *tags, const gchar *metho
comps[len - 2] = NULL;
cls_scope = g_strjoinv(sep, comps);
comps[len - 2] = cls;
cls_scope = strlen(cls_scope) > 0 ? cls_scope : NULL;
/* check whether member inside the class */
if (g_strcmp0(member_tag->scope, member_scope) == 0)
@ -949,7 +950,7 @@ static gboolean member_at_method_scope(const GPtrArray *tags, const gchar *metho
GPtrArray *cls_tags = g_ptr_array_new();
/* check whether the class exists */
fill_find_tags_array(cls_tags, src, cls, cls_scope, TM_TYPE_WITH_MEMBERS, lang);
fill_find_tags_array(cls_tags, src, cls, cls_scope, TM_TYPE_WITH_MEMBERS | tm_tag_namespace_t, lang);
ret = cls_tags->len > 0;
g_ptr_array_free(cls_tags, TRUE);
}