Bug 325488 - Quick Type Hierarchy: Toggle through the hierarchies by pressing Ctrl+T again
Summary: Quick Type Hierarchy: Toggle through the hierarchies by pressing Ctrl+T again
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-source-nav (show other bugs)
Version: 7.0   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 8.0   Edit
Assignee: Markus Schorn CLA
QA Contact: Markus Schorn CLA
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2010-09-16 12:03 EDT by Patrick Hofer CLA
Modified: 2010-09-30 04:23 EDT (History)
2 users (show)

See Also:


Attachments
proposed patch (14.63 KB, patch)
2010-09-16 12:22 EDT, Patrick Hofer CLA
mschorn.eclipse: iplog+
Details | Diff
proposal with changing title (15.61 KB, patch)
2010-09-29 11:49 EDT, Markus Schorn CLA
mschorn.eclipse: iplog-
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Patrick Hofer CLA 2010-09-16 12:03:00 EDT
Add key binding to toggle through the different hierarchy views (Type, Supertype, Subtype) by pressing Ctrl+T again. Another feature from JDT that was missing in the CDT.
Comment 1 Patrick Hofer CLA 2010-09-16 12:22:10 EDT
Created attachment 179044 [details]
proposed patch
Comment 2 Marc-André Laperle CLA 2010-09-25 13:35:49 EDT
I tried the patch, works great!
Comment 3 Markus Schorn CLA 2010-09-28 03:12:50 EDT
Great patch! I have an additional request:
When changing between the different kinds of hierarchies it is unclear which version is shown. This is especially the case when there are no sub-types or super-types. To make that clearer we should change the title of the control to
something like:

Type Hierarchy of '...'
Subtype Hierarchy of '...'
Sypertype Hierarchy of '...'
Declarations of '...' in Type Hierarchy of '...'
Declarations of '...' in Subtype Hierarchy of '...'
Declarations of '...' in Supertype Hierarchy of '...'
Comment 4 Markus Schorn CLA 2010-09-28 05:16:17 EDT
Fixed in 8.0 > 20100928.
Comment 5 Markus Schorn CLA 2010-09-28 05:16:55 EDT
Sorry, wrong bug.
Comment 6 Patrick Hofer CLA 2010-09-28 14:38:00 EDT
Thinking about your improvement I'm a little concerned if the string actually fits in, especially when the name of the type name is rather longish. I guess if there is no sub-type or super-type users will just keep on pressing the key-combination and give up as soon they recognize it's somehow useless asking for something that doesn't exist.
Personally I don't read any long message provided by an UI because I'm kind of lazy. Guess that's typical for a fair amount of programmers.

Another idea would be to offer the switch of hierarchy kind only if there is something "useful" to show. If there's nothing we wouldn't offer the keys at all. Any pointer on how to do that? I'm not that familiar with CDT's internals. That idea could lead to bug reports because the usage is somehow not deterministic (at least not obviously to some users). 

Good improvement request anyway, good chance to surpass JDT ;-)

Could we (actually you) put it in cvs "as is" and open a new bug for that specific concern. I'm pleased to work on the new one if desired.
Comment 7 Markus Schorn CLA 2010-09-29 03:49:49 EDT
(In reply to comment #6)
> Thinking about your improvement I'm a little concerned if the string actually
> fits in, especially when the name of the type name is rather longish. 
"Type|Subtype|Supertype Hierarchy of '...'", will be ok (just 5 characters longer than today)

For the other mode we can shorten the text to:
  "'...' in Type|Subtype|Supertype Hierarchy of '...'",
which is (typically) just a bit longer than the current
  "Types defining or implementing '...'"

> I guess
> if there is no sub-type or super-type users will just keep on pressing the
> key-combination and give up as soon they recognize it's somehow useless asking
> for something that doesn't exist.
> Personally I don't read any long message provided by an UI because I'm kind of
> lazy. Guess that's typical for a fair amount of programmers.
It's ok if you and many others do not read the message, we should still put it there.

> Another idea would be to offer the switch of hierarchy kind only if there is
> something "useful" to show. If there's nothing we wouldn't offer the keys at
> all. Any pointer on how to do that? I'm not that familiar with CDT's internals.
> That idea could lead to bug reports because the usage is somehow not
> deterministic (at least not obviously to some users). 
I would not do that for exactly the reason you give.

> Good improvement request anyway, good chance to surpass JDT ;-)
> Could we (actually you) put it in cvs "as is" and open a new bug for that
> specific concern. I'm pleased to work on the new one if desired.
There is no hurry, let's straighten out the new feature first.
Comment 8 Markus Schorn CLA 2010-09-29 11:49:00 EDT
Created attachment 179862 [details]
proposal with changing title

Here is a proposal that updates the title with:
Type hierarchy of '...', Subtypes of '...', Supertypes of '...'; 
Types declaring '...', Subtypes declaring '...', Supertypes declaring '...';

The titles are reasonably short, what do you think?
Comment 9 Patrick Hofer CLA 2010-09-29 17:48:25 EDT
I like it. It's kind of perfect! Very nice to have those texts as short as possible. I think you came up with a very nice solution.

I'm glad that you improved my proposal. Doing cdt hacking in my spare time imposes kind of limited resources that I can put in by myself. Good to have one todo less on my list. Thanks for taking care of it.
Comment 10 Patrick Hofer CLA 2010-09-30 02:28:50 EDT
Just one small nit-pick. 

There's a dot after "Subtypes declaring '...'." 
                                                             ^
We might want to remove it.
Comment 11 Markus Schorn CLA 2010-09-30 04:06:00 EDT
(In reply to comment #10)
> Just one small nit-pick. 
> There's a dot after "Subtypes declaring '...'." 
>                                                              ^
> We might want to remove it.
Good catch, I removed it.

Implemented in 8.0 > 20100930.