[clangd] Fix handling of inline/anon namespaces and names of deduced types in hover
authorKadir Cetinkaya <kadircet@google.com>
Mon, 16 Dec 2019 13:22:48 +0000 (14:22 +0100)
committerKadir Cetinkaya <kadircet@google.com>
Tue, 17 Dec 2019 15:33:22 +0000 (16:33 +0100)
commit9ab15f303efdfc841f475918535ab4e13960491b
treee97fb9a929f0efc8c6dc48c2a8d546cd26a9b9a6
parent3d15605358ebadcbd7740a61c92b4fea4d6241e5
[clangd] Fix handling of inline/anon namespaces and names of deduced types in hover

Summary:
Clangd normally skips inline and anon namespaces while printing nested name
specifiers. It also drops any tag specifiers since we make use of `HoverInfo::Kind`
instead of some text in `HoverInfo::Name`

There was a bug causing us to print innermost inline/anon namespace, this patch
fixes that by skipping those.
Also changes printing and kind detection of deduced types to be similar to decl
case.

Also improves printing for lambdas, currently clangd prints lambdas as
`(anonymous class)`, we can improve it by at least printing `(lambda)`
instead.

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D71543
clang-tools-extra/clangd/AST.cpp
clang-tools-extra/clangd/Hover.cpp
clang-tools-extra/clangd/unittests/HoverTests.cpp