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
 Ctrl+. shows current refactorings
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Staffan
Junior Member

Sweden
13 Posts

Posted - Sep 08 2006 :  06:47:45 AM  Show Profile  Reply with Quote
I'd like to see VA use some keyboard shortcut to show the list of refactorings for the symbol under the carret. (Just like VS in C# editor). I.e the same context menu that is shown if you click the small arrow when hovering over a symbol.

Regards

/Staffan

rhummer
Tomato Guru

USA
527 Posts

Posted - Sep 08 2006 :  08:59:39 AM  Show Profile  Reply with Quote
You can hold shift and right click to bring up the VA X menu that has a refactor submenu.

Tools Engineer - Raven Software
VS2005 SP2/VS2008 SP1 - VAX <LATEST> - Win 7 x64

Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19004 Posts

Posted - Sep 09 2006 :  09:37:18 AM  Show Profile  Reply with Quote
in addition you can place the caret in the correct position and to alt-a , r to open the VAssistX menu and then open the refactoring sub-menu, which is what i do all the time.

zen is the art of being at one with the two'ness
Go to Top of Page

Staffan
Junior Member

Sweden
13 Posts

Posted - Sep 09 2006 :  6:55:42 PM  Show Profile  Reply with Quote
This might be out of scope for VA, but I was shooting for the same functionallity as the C# editor. This has more to do with making the refactorings more accessible and easier to use than to actually change the behavior of the refactorings.

Try the following in a new C# project;

int j = 0;
j++;

Go to the declaration of j, hit backspace to remove it and write a 'k' instead.
A tiny square appears marking the availability of refactorings. <Ctrl+.> shows the list which in this case is

"rename 'j' to 'k'" and
"rename with preview"

The first item is selected so pressing <enter> will rename j to k.

Ctrl+. is just the default binding for "View.ShowSmartTag" and I guess all the editor does is add smarttags to the current symbol for the current refactorings. I don't know if SmartTags are available in the C++ editor, or if you could implement in in other ways.
However, this all provides a non-intrusive, yet very accessible, way of accessing the refactorings available as smarttags.

If you are really interested in the state of the art regarding refactorings, play with IntelliJ, the java editor from www.jetbrains.com. They are just awesome in how good they are figuring out what the user wants to do and then provide help to do so. Another example from the C#/java world is namespaces.

I don't know how much information is available to VA, but in the world or Java/C#, if I type a symbol that is in a namespace that are not currently available, it gives me a smarttags for either adding a using namespace clause for me, or prefixing the symbol that I entered with the correct namespace.

I'd love if that was possible in C++/VA.

Regards,

/Staffan

Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19004 Posts

Posted - Sep 10 2006 :  5:07:59 PM  Show Profile  Reply with Quote
C# seems to be an easier language to parse, and thus to offer "clever" refactoring's for. i suspect similar statements apply to Java. simply getting rid of #define would make VA's life a lot easier in C++

taking the specific rename example, if you do the same thing in C++, and then hover the mouse over the new name one of the options offered is to rename the symbol, via VA's existing rename refactoring.

this is what i get, via hovering the mouse, in VS2005, C# with VA 1534



and when i click on the icon



are you aware of this? are you simply asking for keyboard access to this icon? my first reaction is that all of these operations are already available via the VAssistX menu, but this is not available in VC6, and does not offer the "rename X to Y" option.

this seems sensible, so i have put in a feature request to allow the user to assign a keyboard shortcut for this.

case=2452

zen is the art of being at one with the two'ness
Go to Top of Page

Staffan
Junior Member

Sweden
13 Posts

Posted - Sep 13 2006 :  07:01:56 AM  Show Profile  Reply with Quote
Great!
You are right that all I asked for was a keyboard shortcut to easy open that list. My experience is that having the most common option selected also boost the feeling that the feature is very ease of use.

Regards

/Staffan
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19004 Posts

Posted - Sep 16 2006 :  3:43:18 PM  Show Profile  Reply with Quote
how do you define the most common option? the option i think is the most common option? the one you think is the most common? the one that was used last?

we do something similar with the suggestion listboxes, where VA makes a guess at what you are up to, but it is not always right. the problem with refactoring operations is the most useful will depend on what i am thinking / planning, which is something that VA does not know about.

zen is the art of being at one with the two'ness
Go to Top of Page

Staffan
Junior Member

Sweden
13 Posts

Posted - Sep 17 2006 :  05:15:34 AM  Show Profile  Reply with Quote
:)

You're right that I was less than clear. I guess I meant some sort of "highest frequece of use in the last X invocations" where X might be 10 or 42 :)

/Staffan
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19004 Posts

Posted - Sep 17 2006 :  10:55:45 AM  Show Profile  Reply with Quote
i wondered if that was what you meant. i think we will pass on that for now. we have quite a lot of outstanding bugs and features already, and this would require keeping track of which operations the user had selected.

beyond that i can see the bug report now "it keeps selecting a different item by default in the menu, why?"

zen is the art of being at one with the two'ness
Go to Top of Page

support
Whole Tomato Software

5566 Posts

Posted - Oct 30 2006 :  12:21:53 AM  Show Profile  Reply with Quote
case=2452

Keyboard access to refactoring menu is available in build 1540 but requires reset of VS.NET and VS2005. (Reset is not required if you do not need the RefactorContextMenu command.)
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