Hints are shown for the individual bindings, not the aggregate.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
clang-tools-extra/clangd/InlayHints.cpp | ||
---|---|---|
40 | While playing around with this, it did occur to me that in some cases it's more helpful to print sugared types than canonical types, for example in a case like this: template <typename, typename, typename> struct SomeLongType {}; using ShortType = SomeLongType<int, float, double>; ShortType func(); auto x = func(); // would prefer "ShortType" as hint However, it turns out that AutoType doesn't retain the sugared type to begin with (there's a FIXME about that here), so setting PrintCanonicalTypes=true doesn't actually regress cases like this (they were already printing the canonical type). |
Cool!
clang-tools-extra/clangd/InlayHints.cpp | ||
---|---|---|
40 | This makes sense - can you add a comment with a short version of this? | |
clang-tools-extra/clangd/unittests/InlayHintTests.cpp | ||
466 | since we have the handy assertTypeHints function, can we split this into several separate tests? |
While playing around with this, it did occur to me that in some cases it's more helpful to print sugared types than canonical types, for example in a case like this:
However, it turns out that AutoType doesn't retain the sugared type to begin with (there's a FIXME about that here), so setting PrintCanonicalTypes=true doesn't actually regress cases like this (they were already printing the canonical type).