Refactor - cannot get it to work

I just loaded Refactor on my system that has VS 2005 Pro on it. After starting VS2005 I edited a few projects. I placed the cursor on a line and pressed Ctrl+~ , but nothing happened. I even created a new project, added some code, and pressed Ctrl+~ ...again nothing. I have even rebooted (when all else fails). Still cannot get it to work.

Any ideas would be appreciated.

Thanks,

Tom



Answer this question

Refactor - cannot get it to work

  • deen

    Tom, in the off chance that you are still having a problem, I was having the same thing happen (or not happen) and I discovered that if you select the entire line with a mouse click on the left of the line then the option to do a refactor comes up. At least it does for me.

    Maybe this will help you or someone else that reads this thread.

    Bill Langston



  • Gravy

    Tom,

    First, can you get it to work using the smart tags That is, place the cursor over a variable, method or whatever, and then click on the paste button that comes up under the cursor and you're presented with relevant refactorings for that context.

    Second, I too for some time couldn't figure out how to get the keyboard shortcut to work. It turns out that by default it is not assigned. You can do so by going to Tools->Options->Keyboard and selecting CodeRush.Refactor and assigning it to a keyboard combination of your choice.

    Third, after several months of having this tool I only noticed a few days ago that the help for it adds itself to Visual Studio's Help (DevExpress.Refactor!)! That's how I discovered the key binding. So have a read of that. I'm also only now using refactoring in anger, due to a project I've just started. Prior to this I was just playing.

    Kevin


  • Christopher61

    I was refering to the Refactor! product at this URL:

    http://msdn.microsoft.com/vbasic/downloads/tools/refactor/

    Thanks,

    Tom


  • Jeremy Jarrell

    What is refactor If it's this:

    http://www.knowdotnet.com/articles/netrefactorproducthome.html

    then you need to ask them.



  • Toby Leduc

    Yes, it's very cool. In fact I may well buy the Pro version in the near future because

    1. You get about 50 or so refactorings.
    2. It supports C#.
    3. It supports both VS 2003 and 2005

    And as I work as a contractor I'm likely to be working in all these scenarios in the next couple of years, i.e., using VS 2003 and 2005 and using C# and VB.

    You don't have to use refactoring for long before not having it feels like not having intellisense!


  • kblackwell

    OK, so when you have installed refactor if you go to

    Tools -> Add In Manager

    You should see DevExpress Tools as one of the options, do you see this

    Create a simple windows forms project with a single button on a form and add the following code

    Dim x As Integer

    x = 2

    in the button click event.

    Now hover the mouse over the second line x (A tooltip should appear saying dim x as integer) and right click the mouse to bring up the context menu. At the bottom there should be a menu item Refactor! which then should have an option Move Intialization To Declaration. Do you see this

    If you highlight the x in the second line and with the item highlighted press Ctrl and ` at the same time then a refactor action takes places - although I cant seem to recall what happens if there are multiple actions that are valid.

    If you not seeing the refactor menu item then it looks like an install issue.


  • PikachuTrAiNeR

    NewWorldMan,

    Thanks for your reply.

    I did get it to work. I got on the DevExpress website and entered a case. They were very helpful it in getting it working. I get the idea from them that others are having the same problem getting it working. Once it is working it is really a nice feature to use.

    Regards,

    Tom


  • Refactor - cannot get it to work