clang: Improve argument hint code completion

Authored by mwolff on Jan 7 2018, 11:49 PM.

Description

clang: Improve argument hint code completion

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.

Reviewers: KDevelop

Subscribers: kdevelop-devel

Differential Revision: https://phabricator.kde.org/D9725

Details

Committed
mwolffJan 9 2018, 9:55 AM
Differential Revision
D9725: clang: Improve argument hint code completion
Parents
R32:2ad241710c46: Fix: correct order of QCOMPARE(actual, expected)
Branches
Unknown
Tags
Unknown