Show size and alignment information in tooltips for typedef or alias

Authored by mwolff on Jan 8 2019, 1:24 PM.



This patch lets us view the size information when inspecting type
aliases. E.g. for C++ code like the following, we'll now see the
size (8) and alignment (also 8) when hovering Bar. Previously,
that was only shown when hovering Foo:

struct Foo { double m; };
using Bar = Foo;

Sadly, this patch by its own isn't yet enough for the more interesting
cases, namely aliases of explicit template instantiations, such as

using Ptr = std::shared_ptr<int>;

Here, we still don't show any size information, since we don't track
that information properly. In the builder, we only encounter std::shared_ptr
as a template, which doesn't have any size information yet. We would
need to build a declaration for the template instantiation of
std::shared_ptr, at which point we could ask libclang for the concrete size...

Still, this patch goes into the right direction already, I believe.

Diff Detail

R32 KDevelop
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.
mwolff created this revision.Jan 8 2019, 1:24 PM
Restricted Application added a project: KDevelop. · View Herald TranscriptJan 8 2019, 1:24 PM
Restricted Application added a subscriber: kdevelop-devel. · View Herald Transcript
mwolff requested review of this revision.Jan 8 2019, 1:24 PM
This revision was not accepted when it landed; it landed in state Needs Review.Jan 10 2019, 3:22 PM
This revision was automatically updated to reflect the committed changes.