https://bugs.kde.org/show_bug.cgi?id=409041

Milian Wolff <m...@milianw.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
      Latest Commit|https://invent.kde.org/kde/ |https://invent.kde.org/kde/
                   |kdevelop/commit/a6df33cf7cd |kdevelop/commit/26ee0da99a0
                   |7463f146b724606bf4add169bad |cb9497fdebc0121576b34508e5d
                   |b8                          |9d
         Resolution|---                         |FIXED

--- Comment #7 from Milian Wolff <m...@milianw.de> ---
Git commit 26ee0da99a0cb9497fdebc0121576b34508e5d9d by Milian Wolff.
Committed on 21/09/2019 at 13:59.
Pushed by mwolff into branch '5.4'.

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.

M  +18   -16   plugins/clang/codecompletion/context.cpp
M  +8    -1    plugins/clang/duchain/builder.cpp
A  +42   -0    plugins/clang/tests/files/uses.c     [License: UNKNOWN]  *

The files marked with a * at the end have a non valid license. Please read:
https://community.kde.org/Policies/Licensing_Policy and use the headers which
are listed at that page.


https://invent.kde.org/kde/kdevelop/commit/26ee0da99a0cb9497fdebc0121576b34508e5d9d

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to