Skip to content
Commit 26ee0da9 authored by Milian Wolff's avatar Milian Wolff
Browse files

Use type name as fallback ID for anon typedef'ed structs/unions etc.

The cursor pointing to the struct within `typedef struct {...} foo;`
has an empty cursor spelling, but its type spelling is set to `foo`.
This is ideal to disambiguate between different structs. Without that,
we would end up associating uses of different cursors to the first
declaration with an empty name. Now that we set a proper non-empty
name, we can correctly disambiguate and associate the uses correctly.

Sadly, clang_getCompletionParent is broken too for this case - it
doesn't return the typedef name :( We now work-around this limitation
by parsing the USR of the container which _does_ contain that info.
Very hacky but at least this makes it work for both, uses and code
completion! Also, we can get rid of the previous hack which tried to
match the type too, which is probably way more costly than this.

BUG: 409041
parent 9a545cb9
Pipeline #8078 canceled with stage
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment