Renaming Made Easy


This is my first real post, so it will be light and short.

I am not going to discover Resharper now. I bet most (if not all) of you know it. It's wonderful, I barely can't live (code) without it.

I also bet you've heard the story before: codebase that starts as a "proof of concept" and grows, grows, and grows and turns into the core of the codebase. Yep, this happened at my current engagement. We had this branch in Team Foundation Server (TFS) source control and now we want to migrate it to the main trunk preserving history and changing namespaces.

TFS makes the thing easier than we thought. The Move command does the trick perfectly fine but still remains the massive namespace renaming. And, boy, was it going to be painful with good old Search & Replace. I am by no means a Resharper Jedi but I have used this tool for long enough to get to know that Rename and Move commands on types save loads of time. What I didn't know (but suspected) is that you can also Rename namespaces, and R# will take care of changing all files and references. SWEET. The trick? just Rename (F2 if using IDEA shortcuts in Visual Studio) the portion of the namespace to be renamed, perform a lot of checkouts and... Voilà I still needed to add a few using statement but this tool has done it again. I mean has saved me and my team a lot of time and effort. And frustration, as text manipulation is not the funniest part of development.

Hope it helps

share class