[clangd] Add desugared type to hover
authorlh123 <1585086582@qq.com>
Wed, 8 Dec 2021 04:31:00 +0000 (12:31 +0800)
committerlh123 <1585086582@qq.com>
Wed, 8 Dec 2021 05:28:12 +0000 (13:28 +0800)
commitec64d10340daacb066ab1bbf6356727062a8236f
tree495424f91c5a894d44ee513b211305978fdae7a1
parent89ebd35daabee5bd5b6baab7230072316ee252b6
[clangd] Add desugared type to hover

Add desugared type to hover when the desugared type and the pretty-printed type are different.

```c++
template<typename T>
struct TestHover {
  using Type = T;
};

int main() {
  TestHover<int>::Type a;
}
```

```
variable a

Type: TestHover<int>::Type (aka int)
```

Reviewed By: sammccall

Differential Revision: https://reviews.llvm.org/D114522
clang-tools-extra/clangd/Hover.cpp
clang-tools-extra/clangd/Hover.h
clang-tools-extra/clangd/unittests/HoverTests.cpp
clang/include/clang/AST/ASTDiagnostic.h
clang/lib/AST/ASTDiagnostic.cpp