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

Ilya Biryukov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 10 06:09:17 PST 2020


ilya-biryukov added a comment.

In D72498#1813962 <https://reviews.llvm.org/D72498#1813962>, @sammccall wrote:

> Maybe we want both the normal type and the canonical type?
>
> Canonical types are often *really* ugly, especially with STL types (we don't have the "as written" form). And presenting the types twice might be at least as confusing/noisy as helpful. But if you have examples where this would be better, it'd be interesting.


I'm mostly trying to find a consistent rule we can apply to make these decision.
`auto`, `decltype` and typedefs are very similar in this regard, it's a bit confusing we use different rules for those. Although I can see how `auto` and `decltype` could easily be perceived differently and fall into a different group.

STL types are unfortunate, that is so true. And most other types aren't. It could be worth looking into the rules clang applies in diagnostics (have you seen those that say `type X(aka vector<int>)`?
I have no easy answer, though, it feels this will inevitably lead to terrible presentations of some types. FWIW, showing underlying type of decltype could lead us there too.


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