Author |
Topic |
|
tandr
Senior Member
43 Posts |
Posted - Sep 01 2009 : 11:12:49 AM
|
Quite often if I am sitting on the piece of code that operates on struct or class members, I need to check "what else is there" in that struct, or (most common for me) to go to definition of operator= which is not handled by VAX yet (if ever be...).
To get to the definition of the struct I do double (or triple, in case of operator=) Alt-G -- first to jump to the current variable definition, then I move cursor to the type of the variable, and do Alt-G again to see the type definition.
I am not sure if there is a one-jump shortcut for the cases like these where I can jump to the type declaration, not the variable declaration?
Worst case scenario example (C++, might be not compilable)
struct A { int i_; float f_; A& operator=(const A& that); };
A& A::operator=(const A& that) { i_ = that.i_; f_ = that.f_; return *this; }
class C { A aa_; void func(const A& that) { aa_ =| that; } };
So, in the example above, I need to move cursor to aa_, then Alt-G, then move cursor to A, then Alt-G again, then go to operator=, and Alt-G again. If at least I would be able to just to "struct A" place directly from aa_, it would be great feature :)
Thank you very much, t.
PS. I am currently using VAX 1731 on VS2008
|
|
sean
Whole Tomato Software
USA
2817 Posts |
Posted - Sep 01 2009 : 12:34:16 PM
|
We are looking into doing this. case=9113
There are two options for starting this: - make it a separate bindable command or - append the additional location to the current goto menu (similar to how alt+g on a function gives you two choices) (optionally so that the old alt+g behavior can be retained)
I think this would only apply to alt+g when invoked on variables...
any thoughts?
|
|
|
tandr
Senior Member
43 Posts |
Posted - Sep 01 2009 : 12:45:51 PM
|
quote: Originally posted by sean
We are looking into doing this. case=9113
There are two options for starting this: - make it a separate bindable command or - append the additional location to the current goto menu (similar to how alt+g on a function gives you two choices) (optionally so that the old alt+g behavior can be retained)
I think this would only apply to alt+g when invoked on variables...
any thoughts?
Make both available - as option on Go-To suggestion box and as separate shortcut?
I can see some people would prefer Alt-G having Type info appended, and once they will get used to it, they will search for shorter shortcut (Alt-T? Shift-Alt-G?) . For heavy users they might find it annoying a bit, so to have option "Show Type in go-to suggestion box" would be welcomed.
|
|
|
sean
Whole Tomato Software
USA
2817 Posts |
Posted - Sep 01 2009 : 4:18:23 PM
|
As an independent command, does the command do nothing if not invoked on an instance of a variable? |
|
|
tandr
Senior Member
43 Posts |
Posted - Sep 01 2009 : 5:02:31 PM
|
quote: Originally posted by sean
As an independent command, does the command do nothing if not invoked on an instance of a variable?
if this thing is not something that has type and storage, then yes, it should do nothing (imho). Well, it is probably should apply to "int aa" cases as well -- do not jump to definition of "int" or "void" (in case of "void* p" ). In these cases I would love to see tooltip popping up with definition of that variable or message "inti is not declared" so at least I would know why it did not jump there. OTOH, it it did not jump on Alt-@ to the type definition, then I probably will try Alt-G immediately anyway, so tooltip is really optional :)
tandr
PS. Alt-@ is a placeholder for whatever shortcut it is going to be.
|
|
|
sean
Whole Tomato Software
USA
2817 Posts |
Posted - Sep 01 2009 : 8:36:17 PM
|
thanks for input. |
|
|
znakeeye
Tomato Guru
379 Posts |
Posted - Sep 02 2009 : 06:59:13 AM
|
I have pinpointed this at least twice before (see http://forum.wholetomato.com/forum/topic.asp?TOPIC_ID=6703).
The solution is so simple: Always put the cursor at an identifier, NOT at the beginning of the line.
Why? This makes it possible for "incremental" Alt+G functionality:
CMyClass myClass;
myClass| = foo; Alt+G jumps to variable above, producing this:
CMyClass myClass|;
myClass = foo; Alt+G jumps to type, producing this:
CMyClass| myClass;
myClass = foo; Alt+G jumps to implementation, producing this:
class CMyClass| I really cannot understand why you did not implement it like this from the beginning. It's 100% intuitive. |
|
|
sean
Whole Tomato Software
USA
2817 Posts |
Posted - Sep 02 2009 : 12:01:09 PM
|
They are both good ideas and aren't mutually exclusive. |
|
|
|
Topic |
|