[PATCH] D72498: [clangd] Print underlying type for decltypes in hover

Ilya Biryukov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Jan 12 20:39:35 PST 2020


ilya-biryukov added a comment.

In D72498#1815500 <https://reviews.llvm.org/D72498#1815500>, @lh123 wrote:

> - hover over the `front` , you'll see "instance-method `front` → `std::vector<int, class std::allocator<int> >::reference`".
> - hover over the `push_back`, you'll see "`std::vector<int, class std::allocator<int> >::value_type && __x`".


These look terrible and are the great examples where showing canonical types results in better output than canonical types.
I wonder why we add `std::vector<int, class std::allocator<int>>::` in the first place, I believe the standard library uses `value_type` in the declaration. Showing `value_type` is not great, but at least that doesn't uglify what was written in the code in the first place.
FWIW, I think the perfect output in those cases would be `int (aka value_type)`


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D72498/new/

https://reviews.llvm.org/D72498





More information about the cfe-commits mailing list