Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Feature Requests
 Go to Type Declaration directly?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

tandr
Senior Member

43 Posts

Posted - Sep 01 2009 :  11:12:49 AM  Show Profile  Reply with Quote
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  Show Profile  Reply with Quote
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?
Go to Top of Page

tandr
Senior Member

43 Posts

Posted - Sep 01 2009 :  12:45:51 PM  Show Profile  Reply with Quote
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.
Go to Top of Page

sean
Whole Tomato Software

USA
2817 Posts

Posted - Sep 01 2009 :  4:18:23 PM  Show Profile  Reply with Quote
As an independent command, does the command do nothing if not invoked on an instance of a variable?
Go to Top of Page

tandr
Senior Member

43 Posts

Posted - Sep 01 2009 :  5:02:31 PM  Show Profile  Reply with Quote
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.
Go to Top of Page

sean
Whole Tomato Software

USA
2817 Posts

Posted - Sep 01 2009 :  8:36:17 PM  Show Profile  Reply with Quote
thanks for input.
Go to Top of Page

znakeeye
Tomato Guru

379 Posts

Posted - Sep 02 2009 :  06:59:13 AM  Show Profile  Reply with Quote
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.
Go to Top of Page

sean
Whole Tomato Software

USA
2817 Posts

Posted - Sep 02 2009 :  12:01:09 PM  Show Profile  Reply with Quote
They are both good ideas and aren't mutually exclusive.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000