Don't show the goto popup for typedef synonyms
commitc84c41e44a69727a51abebf58936b65bd80659c6
authorJiří Techet <techet@gmail.com>
Sat, 5 Mar 2016 10:10:38 +0000 (5 11:10 +0100)
committerJiří Techet <techet@gmail.com>
Sat, 5 Mar 2016 10:10:38 +0000 (5 11:10 +0100)
tree0760c891a24adca9a06250ea6a8861c08a1c84f7
parentdebe14549d6c9ae488ae4fb2be20315a27d39e5d
Don't show the goto popup for typedef synonyms

For instance when performing goto tag for Foo and Foo is defined as

typedef struct Foo {} Foo;

go immediately to the struct location without showing the goto popup with
both the struct name and typedef. When there are more occurrences of the
name, filter the list and don't show the synonyms in the popup.

In addition, if the cursor is on the same line as the typedef, go to
the struct and vice versa.

Note the missing

g_strcmp0(second->var_type, first->name) == 0

in the check - in this particular case we won't get the type to which the
typedef refers inside var_type because at the time the typedef tag is
generated in c.c the struct tag doesn't exist yet. On the other hand
there's no second->var_type == NULL either because this behaviour seems
to be rather implementation-specific and might easily change in the
future. The existing checks are probably sufficient for the real-world
code.
src/symbols.c