D22455: Fix code completion for nameless structs/unions with the same member

Bernd Buschinski noreply at phabricator.kde.org
Sun Jul 14 15:43:58 BST 2019


buschinski created this revision.
buschinski added a reviewer: KDevelop.
Herald added a project: KDevelop.
Herald added a subscriber: kdevelop-devel.
buschinski requested review of this revision.

REVISION SUMMARY
  The code completion always shows the first declaration it finds for a matching name.
  This works fine as long as the parent has a name, for nameless structs/unions it just returns the first declaration it finds.
  Fix this by checking that the found declaration has the expected type.

TEST PLAN
  See https://bugs.kde.org/show_bug.cgi?id=409041 for example code
  or see the unit test in this patch.

REPOSITORY
  R32 KDevelop

REVISION DETAIL
  https://phabricator.kde.org/D22455

AFFECTED FILES
  plugins/clang/codecompletion/context.cpp
  plugins/clang/tests/test_codecompletion.cpp
  plugins/clang/tests/test_codecompletion.h

To: buschinski, #kdevelop
Cc: kdevelop-devel, hmitonneau, christiant, glebaccon, domson, antismap, iodelay, alexeymin, geetamc, Pilzschaf, akshaydeo, surgenight, arrowd
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20190714/18c15fe8/attachment.html>


More information about the KDevelop-devel mailing list