Don't use enums for scoped search

Even though enums contain members, their members are accessed in a
different way than members of classes and structs. E.g. consider:

typedef enum {A, B, C, D} MyEnum;

Variable of this type is declared as

MyEnum myVar;

myVar can be assigned a value from MyEnum; however, we don't access myVar
over the dot operator so we don't need the list of all members after
typing

myVar.

This patch eliminates some false positives after typing .
This commit is contained in:
Jiří Techet 2015-05-10 12:12:55 +02:00
parent bf17c90bd6
commit 30fa28bac7

View File

@ -59,7 +59,7 @@ static TMTagAttrType global_tags_sort_attrs[] =
static TMTagType TM_MEMBER_TYPE_MASK = static TMTagType TM_MEMBER_TYPE_MASK =
tm_tag_function_t | tm_tag_prototype_t | tm_tag_function_t | tm_tag_prototype_t |
tm_tag_member_t | tm_tag_field_t | tm_tag_member_t | tm_tag_field_t |
tm_tag_method_t | tm_tag_enumerator_t; tm_tag_method_t;
static TMWorkspace *theWorkspace = NULL; static TMWorkspace *theWorkspace = NULL;
@ -824,8 +824,7 @@ find_scope_members (const GPtrArray *tags_array, GPtrArray *member_array,
TMTag *tag = NULL; TMTag *tag = NULL;
GPtrArray *type_tags; GPtrArray *type_tags;
TMTagType types = (tm_tag_class_t | tm_tag_namespace_t | TMTagType types = (tm_tag_class_t | tm_tag_namespace_t |
tm_tag_struct_t | tm_tag_typedef_t | tm_tag_struct_t | tm_tag_union_t | tm_tag_typedef_t);
tm_tag_union_t | tm_tag_enum_t);
type_tags = g_ptr_array_new(); type_tags = g_ptr_array_new();
if (typedef_file) if (typedef_file)