Skip to content
Commit 203b02d4 authored by Milian Wolff's avatar Milian Wolff
Browse files

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
parent 2ad24171
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