D9725: clang: Improve argument hint code completion

Milian Wolff noreply at phabricator.kde.org
Mon Jan 8 00:02:07 UTC 2018


mwolff created this revision.
mwolff added a reviewer: KDevelop.
Restricted Application added a subscriber: kdevelop-devel.
mwolff requested review of this revision.

REVISION SUMMARY
  Previously, the overload candidates never got an DUChain Declaration
  associated, meaning we could not inspect the API documentation in-line
  from the code completion. The reason was that most of the time the
  hinted declaration is also a valid "normal" completion item, and thus
  was found a second time. The findDeclaration call then returned null
  for the second call, since we added the declaration to the exclusion
  set after the first call. Instead, use a separate set for overload
  candidates to fix this. Note that the expanded argument hint item
  is still not showing any documentation in-line... Apparently there's
  more to fix to get this done properly.
  
  While at it, also use the ArgumentHintItem for the situations where
  we (now) find a Declaration, to get proper current-argument
  highlighting.
  
  Then fix the unit test to expect the default arguments. Though
  potentially this is clang-version dependent? Anyhow, this makes the
  test pass for me on my machine with libclang from LLVM 5.0.0.

REPOSITORY
  R32 KDevelop

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

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

To: mwolff, #kdevelop
Cc: kdevelop-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20180108/fc0ccec1/attachment-0001.html>


More information about the KDevelop-devel mailing list