GoingNative 20: "Rename" Refactoring for Visual C++ (??!!)

Play GoingNative 20: "Rename" Refactoring for Visual C++ (??!!)
Sign in to queue


The C++ language is large and complex with context-sensitive syntax subtleties that make it difficult to create a reliable and fast rename refactoring tool. For years we wanted to include rename refactoring in Visual C++ but it never quite made it. We were concerned about scalability, performance and accuracy for different user scenarios. Rename refactoring might take longer on more complex or larger projects. 

Recently, we decided to give it a try. The result is the Rename Refactor Helper for Visual Studio 2013. Once installed, you can easily right click on a symbol >refactor>rename in your C++ project. You might still need to manually go through unknown/unconfirmed results proportional to the scope of the refactoring for complex refactors, but for many common scenarios little intervention is required. Make sure you have Tools->Options->Text Editor->C/C++-> Advanced->Disable Resolving set to False. This will allow us to validated the candidate references for the selected symbol.

Our goal with this release is to understand how useful this functionality is for Visual C++ developers. We hope it replaces find/replace in files or copy/paste (ugh!) – and with your feedback, we will continue trying to make it better.

Please try it out for yourself, and if it works well enough for you, let us know and we'll try to add other refactoring types to the tool as well!


Bogdan Mihalcea (bogdan.mihalcea at microsoft.com)

VC++ IDE Team



Download this episode

The Discussion

  • User profile image

    We hope it replaces find/replace in files or copy/paste (ugh!)

    You should hope it replaces VisualAssistX !! that's the goal !!

  • User profile image

    keep them coming! it really works, thanks guys!

  • User profile image

    any plans for more refactors?

  • User profile image

    It's a small step for humanity, but a big step for Visual C++ Wink

  • User profile image
    David Lowndes

    You appear to have inherited the C# refactor window tool poor UI behaviour - which can be witnessed by the fact that the first thing the user of the demo does is resize the window.

    1. The initial default size of the window showing the preview is way too small to be useful to view real code in - make it much bigger.
    2. Remember the size that the user changes that window to so that they don't have to keep resizing it each time they use it.

  • User profile image

    To David: Very good feedback. We are using the same VS Preview service. I will pass on your feedback. I would suggest you to open a bug in that way you will have an easy way to check the progress.

Add Your 2 Cents